Fix sign-compare warning in test; Oddly this only appears on OS X

llvm-svn: 296851
This commit is contained in:
Eric Fiselier 2017-03-03 02:02:07 +00:00
parent 7935a2246e
commit 412e9dbc60
1 changed files with 5 additions and 7 deletions

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <forward_list>
// forward_list(forward_list&& x, const allocator_type& a);
@ -21,7 +23,6 @@
int main()
{
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
typedef test_allocator<T> A;
@ -33,7 +34,7 @@ int main()
unsigned n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
assert(n == static_cast<unsigned>(std::end(t) - std::begin(t)));
assert(c0.empty());
assert(c.get_allocator() == A(10));
}
@ -48,11 +49,10 @@ int main()
unsigned n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
assert(n == static_cast<unsigned>(std::end(t) - std::begin(t)));
assert(!c0.empty());
assert(c.get_allocator() == A(9));
}
#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef min_allocator<T> A;
@ -64,10 +64,8 @@ int main()
unsigned n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
assert(n == std::end(t) - std::begin(t));
assert(n == static_cast<unsigned>(std::end(t) - std::begin(t)));
assert(c0.empty());
assert(c.get_allocator() == A());
}
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}