Commit a16ad779 by Benjamin Kosnik Committed by Benjamin Kosnik

inserters_extractors.cc (test09): New test.


2001-05-24  Benjamin Kosnik  <bkoz@redhat.com>

	libstdc++/2830
	* testsuite/21_strings/inserters_extractors.cc (test09): New test.
	* include/bits/ostream.tcc: Format to match istream.tcc.
	(operator<<(basic_ostream __out, const basic_string __s)): Fix.

From-SVN: r42557
parent 1044b043
2001-05-24 Benjamin Kosnik <bkoz@redhat.com>
libstdc++/2830
* testsuite/21_strings/inserters_extractors.cc (test09): New test.
* include/bits/ostream.tcc: Format to match istream.tcc.
(operator<<(basic_ostream __out, const basic_string __s)): Fix.
2001-05-24 Phil Edwards <pme@sources.redhat.com>
* libsupc++/eh_alloc.cc (__cxa_allocate_exception): Qualify
......
......@@ -304,6 +304,26 @@ void test08()
VERIFY( year == 2001 );
}
// libstdc++/2830
void test09()
{
bool test = true;
std::string blanks( 3, '\0');
std::string foo = "peace";
foo += blanks;
foo += "& love";
std::ostringstream oss1;
oss1 << foo;
VERIFY( oss1.str() == foo );
std::ostringstream oss2;
oss2.width(20);
oss2 << foo;
VERIFY( oss2.str() != foo );
VERIFY( oss2.str().size() == 20 );
}
int main()
{
test01();
......@@ -320,5 +340,7 @@ int main()
test07();
test08();
test09();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment