Commit 58f60b5c by Phil Edwards

ios_base_members_static.cc: Swap order of tests.

2001-02-05  Phil Edwards  <pme@sources.redhat.com>

	* testsuite/27_io/ios_base_members_static.cc:  Swap order of tests.

From-SVN: r39466
parent 9b30b506
2001-02-05 Phil Edwards <pme@sources.redhat.com>
* testsuite/27_io/ios_base_members_static.cc: Swap order of tests.
2001-02-05 Mark Mitchell <mark@codesourcery.com>
* src/string-inst.cc (string::_M_replace): Explicitly instantiate.
......
......@@ -30,33 +30,10 @@
#include <debug_assert.h>
bool test01()
{
bool test = true;
std::stringbuf strbuf01;
std::ios ios01(&strbuf01);
// 1: basic invocation
VERIFY( ios01.sync_with_stdio() );
VERIFY( ios01.sync_with_stdio(false) ); //returns previous state
// 2: need to test interleaving of C and C++ io on a file object.
VERIFY( std::cout.good() );
VERIFY( !std::cout.sync_with_stdio(0) );
VERIFY( std::cout.good() );
VERIFY( !std::cout.sync_with_stdio(0) );
VERIFY( std::cout.good() );
#ifdef DEBUG_ASSERT
assert(test);
#endif
return test;
}
// N.B. Once we have called sync_with_stdio(false), we can never go back.
void
test02()
test01()
{
std::ios_base::sync_with_stdio();
......@@ -79,6 +56,31 @@ test02()
}
}
bool test02()
{
bool test = true;
std::stringbuf strbuf01;
std::ios ios01(&strbuf01);
// 1: basic invocation
VERIFY( ios01.sync_with_stdio() );
VERIFY( ios01.sync_with_stdio(false) ); //returns previous state
// 2: need to test interleaving of C and C++ io on a file object.
VERIFY( std::cout.good() );
VERIFY( !std::cout.sync_with_stdio(0) );
VERIFY( std::cout.good() );
VERIFY( !std::cout.sync_with_stdio(0) );
VERIFY( std::cout.good() );
#ifdef DEBUG_ASSERT
assert(test);
#endif
return test;
}
int main(void)
{
test01();
......@@ -87,5 +89,3 @@ int main(void)
}
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