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
This commit is contained in:
Howard Hinnant 2012-06-01 20:02:59 +00:00
parent dbd9eacde0
commit caee2b093f
5 changed files with 7 additions and 7 deletions

View File

@ -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"));
}
}

View File

@ -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"));
}

View File

@ -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"));
}
}

View File

@ -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);
}

View File

@ -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"));
}
}