summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/container/test/comparison_test.hpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/container/test/comparison_test.hpp
parentInitial commit. (diff)
downloadceph-upstream.tar.xz
ceph-upstream.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/container/test/comparison_test.hpp')
-rw-r--r--src/boost/libs/container/test/comparison_test.hpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/boost/libs/container/test/comparison_test.hpp b/src/boost/libs/container/test/comparison_test.hpp
new file mode 100644
index 00000000..7f3f1b3a
--- /dev/null
+++ b/src/boost/libs/container/test/comparison_test.hpp
@@ -0,0 +1,58 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2017-2017. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_COMPARISON_TEST_HPP
+#define BOOST_CONTAINER_TEST_COMPARISON_TEST_HPP
+
+#include <deque>
+#include <boost/core/lightweight_test.hpp>
+
+namespace boost {
+namespace container {
+namespace test {
+
+
+template<class Cont>
+bool test_container_comparisons()
+{
+ typedef typename Cont::value_type value_type;
+
+ Cont cont;
+ cont.push_back(value_type(1));
+ cont.push_back(value_type(2));
+ cont.push_back(value_type(3));
+
+ Cont cont_equal(cont);
+
+ Cont cont_less;
+ cont_less.push_back(value_type(1));
+ cont_less.push_back(value_type(2));
+ cont_less.push_back(value_type(2));
+
+ BOOST_TEST(cont == cont_equal);
+ BOOST_TEST(!(cont != cont_equal));
+ BOOST_TEST(cont != cont_less);
+ BOOST_TEST(cont_less < cont);
+ BOOST_TEST(cont_less <= cont);
+ BOOST_TEST(!(cont_less > cont));
+ BOOST_TEST(!(cont_less >= cont));
+ BOOST_TEST(!(cont < cont_less));
+ BOOST_TEST(!(cont <= cont_less));
+ BOOST_TEST(cont > cont_less);
+ BOOST_TEST(cont >= cont_less);
+
+ return ::boost::report_errors() == 0;
+}
+
+} //namespace test {
+} //namespace container {
+} //namespace boost {
+
+#endif //#ifndef BOOST_CONTAINER_TEST_COMPARISON_TEST_HPP