From caee2b093fc892335f666f1a074e8d2de40df467 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 1 Jun 2012 20:02:59 +0000 Subject: [PATCH] Fix a few testsuite bugs involving trailing null (or lack thereof) in strstream. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@157832 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../depr.ostrstream.cons/cp_size_mode.pass.cpp | 4 ++-- .../depr.ostrstream/depr.ostrstream.cons/default.pass.cpp | 2 +- .../depr.ostrstream/depr.ostrstream.members/str.pass.cpp | 2 +- .../depr.strstream/depr.strstream.cons/default.pass.cpp | 4 ++-- .../depr.strstream/depr.strstream.oper/str.pass.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp b/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp index 39b4f79f..1ad0bfa8 100644 --- a/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp +++ b/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/cp_size_mode.pass.cpp @@ -25,7 +25,7 @@ int main() int i = 321; double d = 5.5; std::string s("cat"); - out << i << ' ' << d << ' ' << s; + out << i << ' ' << d << ' ' << s << std::ends; assert(out.str() == std::string("321 5.5 cat")); } { @@ -35,7 +35,7 @@ int main() int i = 321; double d = 5.5; std::string s("cat"); - out << i << ' ' << d << ' ' << s; + out << i << ' ' << d << ' ' << s << std::ends; assert(out.str() == std::string("123 4.5 dog321 5.5 cat")); } } diff --git a/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp b/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp index 2847396b..78343f83 100644 --- a/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp +++ b/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.cons/default.pass.cpp @@ -22,6 +22,6 @@ int main() int i = 123; double d = 4.5; std::string s("dog"); - out << i << ' ' << d << ' ' << s; + out << i << ' ' << d << ' ' << s << std::ends; assert(out.str() == std::string("123 4.5 dog")); } diff --git a/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/str.pass.cpp b/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/str.pass.cpp index e0f8d378..9a5542a6 100644 --- a/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/str.pass.cpp +++ b/test/depr/depr.str.strstreams/depr.ostrstream/depr.ostrstream.members/str.pass.cpp @@ -20,7 +20,7 @@ int main() { { std::ostrstream out; - out << 123 << ' ' << 4.5 << ' ' << "dog"; + out << 123 << ' ' << 4.5 << ' ' << "dog" << std::ends; assert(out.str() == std::string("123 4.5 dog")); } } diff --git a/test/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp b/test/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp index 7133c328..374f430f 100644 --- a/test/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp +++ b/test/depr/depr.str.strstreams/depr.strstream/depr.strstream.cons/default.pass.cpp @@ -22,7 +22,7 @@ int main() int i = 123; double d = 4.5; std::string s("dog"); - inout << i << ' ' << d << ' ' << s; + inout << i << ' ' << d << ' ' << s << std::ends; assert(inout.str() == std::string("123 4.5 dog")); i = 0; d = 0; @@ -30,5 +30,5 @@ int main() inout >> i >> d >> s; assert(i == 123); assert(d == 4.5); - assert(s == "dog"); + assert(strcmp(s.c_str(), "dog") == 0); } diff --git a/test/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp b/test/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp index db90e96c..4ac1c44e 100644 --- a/test/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp +++ b/test/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp @@ -20,7 +20,7 @@ int main() { { std::strstream out; - out << 123 << ' ' << 4.5 << ' ' << "dog"; + out << 123 << ' ' << 4.5 << ' ' << "dog" << std::ends; assert(out.str() == std::string("123 4.5 dog")); } }