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:
parent
dbd9eacde0
commit
caee2b093f
@ -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"));
|
||||
}
|
||||
}
|
||||
|
@ -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"));
|
||||
}
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user