summaryrefslogtreecommitdiff
path: root/test/std/input.output/string.streams
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/input.output/string.streams')
-rw-r--r--test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp23
-rw-r--r--test/std/input.output/string.streams/stringstream.cons/string.pass.cpp12
2 files changed, 29 insertions, 6 deletions
diff --git a/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp b/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
index 28007c8edf45..af2cccc96373 100644
--- a/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
+++ b/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
@@ -17,6 +17,21 @@
#include <sstream>
#include <cassert>
+template<typename CharT>
+struct testbuf
+ : std::basic_stringbuf<CharT>
+{
+ void check()
+ {
+ assert(this->eback() == NULL);
+ assert(this->gptr() == NULL);
+ assert(this->egptr() == NULL);
+ assert(this->pbase() == NULL);
+ assert(this->pptr() == NULL);
+ assert(this->epptr() == NULL);
+ }
+};
+
int main()
{
{
@@ -27,4 +42,12 @@ int main()
std::wstringbuf buf;
assert(buf.str() == L"");
}
+ {
+ testbuf<char> buf;
+ buf.check();
+ }
+ {
+ testbuf<wchar_t> buf;
+ buf.check();
+ }
}
diff --git a/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp
index f808bcd14dea..b87f7eb92e5a 100644
--- a/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp
+++ b/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp
@@ -57,12 +57,12 @@ int main()
assert(ss.str() == L"456 1236 ");
}
{ // This is https://bugs.llvm.org/show_bug.cgi?id=33727
- typedef std::basic_string <char, std::char_traits<char>, NoDefaultAllocator<char> > S;
- typedef std::basic_stringbuf<char, std::char_traits<char>, NoDefaultAllocator<char> > SB;
+ typedef std::basic_string <char, std::char_traits<char>, NoDefaultAllocator<char> > S;
+ typedef std::basic_stringbuf<char, std::char_traits<char>, NoDefaultAllocator<char> > SB;
- S s(NoDefaultAllocator<char>(1));
- SB sb(s);
- // This test is not required by the standard, but *where else* could it get the allocator?
- assert(sb.str().get_allocator() == s.get_allocator());
+ S s(NoDefaultAllocator<char>(1));
+ SB sb(s);
+ // This test is not required by the standard, but *where else* could it get the allocator?
+ assert(sb.str().get_allocator() == s.get_allocator());
}
}