Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <iterator>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "test_allocator.h"
|
||||
#include "../input_iterator.h"
|
||||
#include "min_allocator.h"
|
||||
@@ -30,7 +31,7 @@ test(It first, It last)
|
||||
typedef typename S::traits_type T;
|
||||
typedef typename S::allocator_type A;
|
||||
S s2(first, last);
|
||||
assert(s2.__invariants());
|
||||
LIBCPP_ASSERT(s2.__invariants());
|
||||
assert(s2.size() == std::distance(first, last));
|
||||
unsigned i = 0;
|
||||
for (It it = first; it != last; ++it, ++i)
|
||||
@@ -47,7 +48,7 @@ test(It first, It last, const A& a)
|
||||
typedef std::basic_string<charT, std::char_traits<charT>, A> S;
|
||||
typedef typename S::traits_type T;
|
||||
S s2(first, last, a);
|
||||
assert(s2.__invariants());
|
||||
LIBCPP_ASSERT(s2.__invariants());
|
||||
assert(s2.size() == std::distance(first, last));
|
||||
unsigned i = 0;
|
||||
for (It it = first; it != last; ++it, ++i)
|
||||
@@ -86,7 +87,7 @@ int main()
|
||||
test(input_iterator<const char*>(s), input_iterator<const char*>(s+50));
|
||||
test(input_iterator<const char*>(s), input_iterator<const char*>(s+50), A(2));
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef min_allocator<char> A;
|
||||
const char* s = "12345678901234567890123456789012345678901234567890";
|
||||
|
||||
Reference in New Issue
Block a user