+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.
#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();
}
}
+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();
}
-
-