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/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