summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings/basic.string/string.modifiers/string_replace
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-04-28 22:28:23 +0000
committerEric Fiselier <eric@efcs.ca>2016-04-28 22:28:23 +0000
commit1f4231f8cf138c810a55a398c07a422908add70f (patch)
tree37862fd2450b478ac9fcaf5742d8e2ccdd65be43 /libcxx/test/std/strings/basic.string/string.modifiers/string_replace
parent174f8b19815cef8507fe0dbf03e5e639f3a60ba9 (diff)
downloadbcm5719-llvm-1f4231f8cf138c810a55a398c07a422908add70f.tar.gz
bcm5719-llvm-1f4231f8cf138c810a55a398c07a422908add70f.zip
Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros
llvm-svn: 267947
Diffstat (limited to 'libcxx/test/std/strings/basic.string/string.modifiers/string_replace')
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp4
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp2
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp5
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_size_char.pass.cpp5
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp5
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp5
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp5
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp3
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp3
-rw-r--r--libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp5
10 files changed, 20 insertions, 22 deletions
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
index 70c713b4f90..cc37e79c793 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
@@ -29,7 +29,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, It f, It l, S ex
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, f, l);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = std::distance(f, l);
assert(s.size() == old_size - xlen + rlen);
@@ -48,7 +48,7 @@ test_exceptions(S s, typename S::size_type pos1, typename S::size_type n1, It f,
assert(false);
}
catch (...) {}
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(s == aCopy);
}
#endif
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp
index c7551b928ec..730fc1a501c 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp
@@ -29,7 +29,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, const typename S
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, str);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = S::traits_type::length(str);
assert(s.size() == old_size - xlen + rlen);
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp
index 087df7824ac..4a910e49981 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp
@@ -12,12 +12,11 @@
// basic_string<charT,traits,Allocator>&
// replace(const_iterator i1, const_iterator i2, const charT* s, size_type n);
-#include <stdio.h>
-
#include <string>
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -30,7 +29,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, const typename S
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, str, n2);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = n2;
assert(s.size() == old_size - xlen + rlen);
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_size_char.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_size_char.pass.cpp
index 8be8b529823..4dbc8ab1f22 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_size_char.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_size_char.pass.cpp
@@ -12,12 +12,11 @@
// basic_string<charT,traits,Allocator>&
// replace(const_iterator i1, const_iterator i2, size_type n, charT c);
-#include <stdio.h>
-
#include <string>
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -30,7 +29,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, typename S::size
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, n2, c);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = n2;
assert(s.size() == old_size - xlen + rlen);
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp
index b85a1063ebe..190e10d5c83 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp
@@ -12,12 +12,11 @@
// basic_string<charT,traits,Allocator>&
// replace(const_iterator i1, const_iterator i2, const basic_string& str);
-#include <stdio.h>
-
#include <string>
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -29,7 +28,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S expecte
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, str);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = str.size();
assert(s.size() == old_size - xlen + rlen);
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp
index eb0e982ef16..3beb074c0fd 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp
@@ -13,13 +13,12 @@
// basic_string<charT,traits,Allocator>&
// replace(size_type pos, size_type n1, const charT* s);
-#include <stdio.h>
-
#include <string>
#include <stdexcept>
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -32,7 +31,7 @@ test(S s, typename S::size_type pos, typename S::size_type n1,
try
{
s.replace(pos, n1, str);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp
index 898ab2a144c..d961e9e8f76 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp
@@ -13,13 +13,12 @@
// basic_string<charT,traits,Allocator>&
// replace(size_type pos, size_type n1, const charT* s, size_type n2);
-#include <stdio.h>
-
#include <string>
#include <stdexcept>
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -33,7 +32,7 @@ test(S s, typename S::size_type pos, typename S::size_type n1,
try
{
s.replace(pos, n1, str, n2);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp
index e616ecc0426..d4696fba8a8 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp
@@ -18,6 +18,7 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -31,7 +32,7 @@ test(S s, typename S::size_type pos, typename S::size_type n1,
try
{
s.replace(pos, n1, n2, c);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
index ea311dd1564..1be45d8a662 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
@@ -18,6 +18,7 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -29,7 +30,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S expecte
try
{
s.replace(pos1, n1, str);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(pos1 <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
diff --git a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp
index 01f4a1f6cce..3f4bf450d85 100644
--- a/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp
@@ -20,6 +20,7 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -33,7 +34,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1,
try
{
s.replace(pos1, n1, str, pos2, n2);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(pos1 <= old_size && pos2 <= str.size());
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
@@ -58,7 +59,7 @@ test_npos(S s, typename S::size_type pos1, typename S::size_type n1,
try
{
s.replace(pos1, n1, str, pos2);
- assert(s.__invariants());
+ LIBCPP_ASSERT(s.__invariants());
assert(pos1 <= old_size && pos2 <= str.size());
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
OpenPOWER on IntegriCloud