]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/container_hash/test/hash_vector_test.cpp
2 // Copyright 2005-2009 Daniel James.
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include "./config.hpp"
8 #ifdef BOOST_HASH_TEST_EXTENSIONS
9 # ifdef BOOST_HASH_TEST_STD_INCLUDES
10 # include <functional>
12 # include <boost/container_hash/hash.hpp>
16 #include <boost/core/lightweight_test.hpp>
18 #ifdef BOOST_HASH_TEST_EXTENSIONS
23 #define CONTAINER_TYPE vector
24 #include "./hash_sequence_test.hpp"
26 #endif // BOOST_HASH_TEST_EXTENSIONS
28 namespace vector_bool_tests
30 void vector_bool_test() {
31 std::vector
<bool> x_empty1
,x_empty2
,x1
,x1a
,x2
,x3
;
39 BOOST_HASH_TEST_NAMESPACE::hash
<std::vector
<bool> > hasher
;
41 BOOST_TEST_EQ(hasher(x_empty1
), hasher(x_empty1
));
42 BOOST_TEST_EQ(hasher(x_empty1
), hasher(x_empty2
));
43 BOOST_TEST_NE(hasher(x_empty1
), hasher(x1
));
44 BOOST_TEST_NE(hasher(x_empty1
), hasher(x2
));
45 BOOST_TEST_NE(hasher(x_empty1
), hasher(x3
));
47 BOOST_TEST_EQ(hasher(x1
), hasher(x1
));
48 BOOST_TEST_EQ(hasher(x1
), hasher(x1a
));
49 BOOST_TEST_NE(hasher(x1
), hasher(x2
));
50 BOOST_TEST_NE(hasher(x1
), hasher(x3
));
52 BOOST_TEST_EQ(hasher(x2
), hasher(x2
));
53 BOOST_TEST_NE(hasher(x2
), hasher(x3
));
55 BOOST_TEST_EQ(hasher(x3
), hasher(x3
));
61 #ifdef BOOST_HASH_TEST_EXTENSIONS
62 vector_tests::vector_hash_integer_tests();
65 vector_bool_tests::vector_bool_test();
67 return boost::report_errors();