diff --git a/test/unordered/transparent_tests.cpp b/test/unordered/transparent_tests.cpp index f17bf156..4c544092 100644 --- a/test/unordered/transparent_tests.cpp +++ b/test/unordered/transparent_tests.cpp @@ -164,11 +164,10 @@ template void test_transparent_find() int n = 5; for (int i = 0; i < n; ++i) { - map[key(i)] = i; + map.insert(std::make_pair(i, i)); } - int const expected_key_count = 2 * n; - BOOST_TEST_EQ(key::count_, expected_key_count); + int const expected_key_count = key::count_; // explicitly test `find()` and `find() const` separately // @@ -226,12 +225,10 @@ template void test_non_transparent_find() int n = 5; for (int i = 0; i < n; ++i) { - map[key(i)] = i; + map.insert(std::make_pair(i, i)); } - int key_count = 2 * n; - - BOOST_TEST_EQ(key::count_, key_count); + int key_count = key::count_; // explicitly test `find()` and `find() const` separately // @@ -738,7 +735,8 @@ template void test_non_transparent_extract() BOOST_TEST_EQ(key::count_, key_count); } -UNORDERED_AUTO_TEST (unordered_map_transparent_count) { +void test_unordered_map() +{ { typedef boost::unordered_map @@ -790,4 +788,47 @@ UNORDERED_AUTO_TEST (unordered_map_transparent_count) { } } +void test_unordered_multimap() +{ + { + typedef boost::unordered_multimap + unordered_multimap; + + test_transparent_find(); + } + + { + // non-transparent Hash, non-transparent KeyEqual + // + typedef boost::unordered_multimap + unordered_multimap; + + test_non_transparent_find(); + } + + { + // transparent Hash, non-transparent KeyEqual + // + typedef boost::unordered_multimap + unordered_multimap; + + test_non_transparent_find(); + } + + { + // non-transparent Hash, transparent KeyEqual + // + typedef boost::unordered_multimap + unordered_multimap; + + test_non_transparent_find(); + } +} + +UNORDERED_AUTO_TEST (transparent_ops) { + test_unordered_map(); + test_unordered_multimap(); +} + RUN_TESTS()