#include "../../../Emplaceable.h"
#include "min_allocator.h"
+#include "test_macros.h"
int main()
{
assert(c.size() == 2);
assert(r->first == 3);
assert(r->second == Emplaceable(5, 6));
- assert(r == next(c.begin()));
+ LIBCPP_ASSERT(r == next(c.begin()));
r = c.emplace_hint(r, std::piecewise_construct, std::forward_as_tuple(3),
std::forward_as_tuple(6, 7));
assert(c.size() == 3);
assert(r->first == 3);
assert(r->second == Emplaceable(6, 7));
- assert(r == next(c.begin()));
+ LIBCPP_ASSERT(r == next(c.begin()));
r = c.begin();
assert(r->first == 3);
- assert(r->second == Emplaceable());
+ LIBCPP_ASSERT(r->second == Emplaceable());
r = next(r, 2);
assert(r->first == 3);
- assert(r->second == Emplaceable(5, 6));
+ LIBCPP_ASSERT(r->second == Emplaceable(5, 6));
}
#if TEST_STD_VER >= 11
{
assert(c.size() == 2);
assert(r->first == 3);
assert(r->second == Emplaceable(5, 6));
- assert(r == next(c.begin()));
+ LIBCPP_ASSERT(r == next(c.begin()));
r = c.emplace_hint(r, std::piecewise_construct, std::forward_as_tuple(3),
std::forward_as_tuple(6, 7));
assert(c.size() == 3);
assert(r->first == 3);
assert(r->second == Emplaceable(6, 7));
- assert(r == next(c.begin()));
+ LIBCPP_ASSERT(r == next(c.begin()));
r = c.begin();
assert(r->first == 3);
- assert(r->second == Emplaceable());
+ LIBCPP_ASSERT(r->second == Emplaceable());
r = next(r, 2);
assert(r->first == 3);
- assert(r->second == Emplaceable(5, 6));
+ LIBCPP_ASSERT(r->second == Emplaceable(5, 6));
}
#endif
#if _LIBCPP_DEBUG >= 1
c = std::move(c0);
LIBCPP_ASSERT(c.bucket_count() == 7);
assert(c.size() == 6);
- C::const_iterator i = c.cbegin();
- assert(*i == 4);
- ++i;
- assert(*i == 3);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 1);
- ++i;
- assert(*i == 1);
+ assert(c.count(1) == 2);
+ assert(c.count(2) == 2);
+ assert(c.count(3) == 1);
+ assert(c.count(4) == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());
C c(std::move(c0), A());
assert(c.bucket_count() >= 7);
assert(c.size() == 6);
- C::const_iterator i = c.cbegin();
- assert(*i == 4);
- ++i;
- assert(*i == 3);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 2);
- ++i;
- assert(*i == 1);
- ++i;
- assert(*i == 1);
+ assert(c.count(1) == 2);
+ assert(c.count(2) == 2);
+ assert(c.count(3) == 1);
+ assert(c.count(4) == 1);
assert(c.hash_function() == test_hash<std::hash<int> >(8));
assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
assert(c.get_allocator() == A());