Index: libcxx/test/std/containers/associative/map/map.access/iterator.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/map/map.access/iterator.pass.cpp +++ libcxx/test/std/containers/associative/map/map.access/iterator.pass.cpp @@ -77,6 +77,15 @@ i->second = 2.5; assert(i->second == 2.5); } + assert(i == m.end()); + for (int j = m.size(); j >= 1; --j) + { + --i; + assert(i->first == j); + assert(i->second == 2.5); + i->second = 1; + assert(i->second == 1); + } } { typedef std::pair V; @@ -119,6 +128,13 @@ assert(i->first == j); assert(i->second == 1); } + assert(i == m.end()); + for (int j = m.size(); j >= 1; --j) + { + --i; + assert(i->first == j); + assert(i->second == 1); + } } #if TEST_STD_VER >= 11 { @@ -164,6 +180,15 @@ i->second = 2.5; assert(i->second == 2.5); } + assert(i == m.end()); + for (int j = m.size(); j >= 1; --j) + { + --i; + assert(i->first == j); + assert(i->second == 2.5); + i->second = 1; + assert(i->second == 1); + } } { typedef std::pair V; @@ -206,6 +231,13 @@ assert(i->first == j); assert(i->second == 1); } + assert(i == m.end()); + for (int j = m.size(); j >= 1; --j) + { + --i; + assert(i->first == j); + assert(i->second == 1); + } } #endif #if TEST_STD_VER > 11 Index: libcxx/test/std/containers/associative/map/map.ops/count.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/map/map.ops/count.pass.cpp +++ libcxx/test/std/containers/associative/map/map.ops/count.pass.cpp @@ -20,6 +20,15 @@ #include "private_constructor.h" #include "is_transparent.h" +#if TEST_STD_VER >= 11 + template + struct FinalCompare final { + bool operator()(const T& x, const T& y) const { + return x < y; + } + }; +#endif + int main(int, char**) { { @@ -97,6 +106,43 @@ assert(r == 0); } } + { + typedef std::pair V; + typedef std::map > M; + { + typedef M::size_type R; + V ar[] = + { + V(5, 5), + V(6, 6), + V(7, 7), + V(8, 8), + V(9, 9), + V(10, 10), + V(11, 11), + V(12, 12) + }; + const M m(ar, ar+sizeof(ar)/sizeof(ar[0])); + R r = m.count(5); + assert(r == 1); + r = m.count(6); + assert(r == 1); + r = m.count(7); + assert(r == 1); + r = m.count(8); + assert(r == 1); + r = m.count(9); + assert(r == 1); + r = m.count(10); + assert(r == 1); + r = m.count(11); + assert(r == 1); + r = m.count(12); + assert(r == 1); + r = m.count(4); + assert(r == 0); + } + } #endif #if TEST_STD_VER > 11 { Index: libcxx/test/std/containers/associative/multimap/iterator.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/multimap/iterator.pass.cpp +++ libcxx/test/std/containers/associative/multimap/iterator.pass.cpp @@ -78,6 +78,16 @@ i->second = 2.5; assert(i->second == 2.5); } + assert(i == m.end()); + for (int j = 8; j >= 1; --j) + for (double d = 1; d <= 2; d += .5) + { + --i; + assert(i->first == j); + assert(i->second == 2.5); + i->second = d; + assert(i->second == d); + } } { typedef std::pair V; @@ -121,6 +131,14 @@ assert(i->first == j); assert(i->second == d); } + assert(i == m.end()); + for (int j = 8; j >= 1; --j) + for (double d = 2; d >= 1; d -= .5) + { + --i; + assert(i->first == j); + assert(i->second == d); + } } #if TEST_STD_VER >= 11 { @@ -167,6 +185,16 @@ i->second = 2.5; assert(i->second == 2.5); } + assert(i == m.end()); + for (int j = 8; j >= 1; --j) + for (double d = 1; d <= 2; d += .5) + { + --i; + assert(i->first == j); + assert(i->second == 2.5); + i->second = d; + assert(i->second == d); + } } { typedef std::pair V; @@ -210,6 +238,14 @@ assert(i->first == j); assert(i->second == d); } + assert(i == m.end()); + for (int j = 8; j >= 1; --j) + for (double d = 2; d >= 1; d -= .5) + { + --i; + assert(i->first == j); + assert(i->second == d); + } } #endif #if TEST_STD_VER > 11 Index: libcxx/test/std/containers/associative/multiset/iterator.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/multiset/iterator.pass.cpp +++ libcxx/test/std/containers/associative/multiset/iterator.pass.cpp @@ -73,6 +73,12 @@ for (int j = 1; j <= 8; ++j) for (int n = 0; n < 3; ++n, ++i) assert(*i == j); + assert(i == m.end()); + for (int j = 8; j >= 1; --j) + for (int n = 0; n < 3; ++n) { + --i; + assert(*i == j); + } } { typedef int V; @@ -113,6 +119,12 @@ for (int j = 1; j <= 8; ++j) for (int k = 0; k < 3; ++k, ++i) assert(*i == j); + assert(i == m.end()); + for (int j = 8; j >= 1; --j) + for (int n = 0; n < 3; ++n) { + --i; + assert(*i == j); + } } #if TEST_STD_VER >= 11 { @@ -154,6 +166,12 @@ for (int j = 1; j <= 8; ++j) for (int n = 0; n < 3; ++n, ++i) assert(*i == j); + assert(i == m.end()); + for (int j = 8; j >= 1; --j) + for (int n = 0; n < 3; ++n) { + --i; + assert(*i == j); + } } { typedef int V; @@ -194,6 +212,12 @@ for (int j = 1; j <= 8; ++j) for (int k = 0; k < 3; ++k, ++i) assert(*i == j); + assert(i == m.end()); + for (int j = 8; j >= 1; --j) + for (int n = 0; n < 3; ++n) { + --i; + assert(*i == j); + } } #endif #if TEST_STD_VER > 11 Index: libcxx/test/std/containers/associative/set/iterator.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/set/iterator.pass.cpp +++ libcxx/test/std/containers/associative/set/iterator.pass.cpp @@ -72,6 +72,11 @@ assert(i == k); for (int j = 1; static_cast(j) <= m.size(); ++j, ++i) assert(*i == j); + assert(i == m.end()); + for (int j = m.size(); j >= 1; --j) { + --i; + assert(*i == j); + } } { typedef int V; @@ -111,6 +116,11 @@ i = m.begin(); for (int j = 1; static_cast(j) <= m.size(); ++j, ++i) assert(*i == j); + assert(i == m.end()); + for (int j = m.size(); j >= 1; --j) { + --i; + assert(*i == j); + } } #if TEST_STD_VER >= 11 { @@ -151,6 +161,11 @@ assert(i == k); for (int j = 1; static_cast(j) <= m.size(); ++j, ++i) assert(*i == j); + assert(i == m.end()); + for (int j = m.size(); j >= 1; --j) { + --i; + assert(*i == j); + } } { typedef int V; @@ -190,6 +205,11 @@ i = m.begin(); for (int j = 1; static_cast(j) <= m.size(); ++j, ++i) assert(*i == j); + assert(i == m.end()); + for (int j = m.size(); j >= 1; --j) { + --i; + assert(*i == j); + } } #endif #if TEST_STD_VER > 11