summaryrefslogtreecommitdiff
path: root/test/std/strings/basic.string/string.modifiers/string_assign
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/strings/basic.string/string.modifiers/string_assign')
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp46
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp20
-rw-r--r--test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp24
3 files changed, 45 insertions, 45 deletions
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
index e5312e6db6ce..cb83f25d7117 100644
--- a/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
@@ -33,10 +33,10 @@ template <class S, class It>
void
test_exceptions(S s, It first, It last)
{
- S aCopy = s;
+ S aCopy = s;
try {
- s.assign(first, last);
- assert(false);
+ s.assign(first, last);
+ assert(false);
}
catch (...) {}
LIBCPP_ASSERT(s.__invariants());
@@ -165,7 +165,7 @@ int main()
}
#endif
#ifndef TEST_HAS_NO_EXCEPTIONS
- { // test iterator operations that throw
+ { // test iterator operations that throw
typedef std::string S;
typedef ThrowingIterator<char> TIter;
typedef input_iterator<TIter> IIter;
@@ -177,32 +177,32 @@ int main()
test_exceptions(S(), TIter(s, s+10, 4, TIter::TAIncrement), TIter());
test_exceptions(S(), TIter(s, s+10, 5, TIter::TADereference), TIter());
test_exceptions(S(), TIter(s, s+10, 6, TIter::TAComparison), TIter());
- }
+ }
#endif
- { // test assigning to self
+ { // test assigning to self
typedef std::string S;
- S s_short = "123/";
- S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
- s_short.assign(s_short.begin(), s_short.end());
- assert(s_short == "123/");
- s_short.assign(s_short.begin() + 2, s_short.end());
- assert(s_short == "3/");
+ s_short.assign(s_short.begin(), s_short.end());
+ assert(s_short == "123/");
+ s_short.assign(s_short.begin() + 2, s_short.end());
+ assert(s_short == "3/");
- s_long.assign(s_long.begin(), s_long.end());
- assert(s_long == "Lorem ipsum dolor sit amet, consectetur/");
+ s_long.assign(s_long.begin(), s_long.end());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/");
- s_long.assign(s_long.begin() + 30, s_long.end());
- assert(s_long == "nsectetur/");
- }
+ s_long.assign(s_long.begin() + 30, s_long.end());
+ assert(s_long == "nsectetur/");
+ }
- { // test assigning a different type
+ { // test assigning a different type
typedef std::string S;
- const uint8_t p[] = "ABCD";
+ const uint8_t p[] = "ABCD";
- S s;
- s.assign(p, p + 4);
- assert(s == "ABCD");
- }
+ S s;
+ s.assign(p, p + 4);
+ assert(s == "ABCD");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp
index b0876b388d83..b592455a350e 100644
--- a/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp
@@ -62,17 +62,17 @@ int main()
}
#endif
- { // test assignment to self
+ { // test assignment to self
typedef std::string S;
- S s_short = "123/";
- S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
- s_short.assign(s_short.c_str());
- assert(s_short == "123/");
- s_short.assign(s_short.c_str() + 2);
- assert(s_short == "3/");
+ s_short.assign(s_short.c_str());
+ assert(s_short == "123/");
+ s_short.assign(s_short.c_str() + 2);
+ assert(s_short == "3/");
- s_long.assign(s_long.c_str() + 30);
- assert(s_long == "nsectetur/");
- }
+ s_long.assign(s_long.c_str() + 30);
+ assert(s_long == "nsectetur/");
+ }
}
diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp
index 97a9990f5180..70b00619a913 100644
--- a/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp
@@ -70,20 +70,20 @@ int main()
S("12345678901234567890"));
}
#endif
- { // test assign to self
+ { // test assign to self
typedef std::string S;
- S s_short = "123/";
- S s_long = "Lorem ipsum dolor sit amet, consectetur/";
+ S s_short = "123/";
+ S s_long = "Lorem ipsum dolor sit amet, consectetur/";
- s_short.assign(s_short.data(), s_short.size());
- assert(s_short == "123/");
- s_short.assign(s_short.data() + 2, s_short.size() - 2);
- assert(s_short == "3/");
+ s_short.assign(s_short.data(), s_short.size());
+ assert(s_short == "123/");
+ s_short.assign(s_short.data() + 2, s_short.size() - 2);
+ assert(s_short == "3/");
- s_long.assign(s_long.data(), s_long.size());
- assert(s_long == "Lorem ipsum dolor sit amet, consectetur/");
+ s_long.assign(s_long.data(), s_long.size());
+ assert(s_long == "Lorem ipsum dolor sit amet, consectetur/");
- s_long.assign(s_long.data() + 2, 8 );
- assert(s_long == "rem ipsu");
- }
+ s_long.assign(s_long.data() + 2, 8 );
+ assert(s_long == "rem ipsu");
+ }
}