From 58f60b5c912f2d45fb969331221d80cb00c00138 Mon Sep 17 00:00:00 2001 From: Phil Edwards Date: Mon, 5 Feb 2001 22:08:47 +0000 Subject: [PATCH] ios_base_members_static.cc: Swap order of tests. 2001-02-05 Phil Edwards * testsuite/27_io/ios_base_members_static.cc: Swap order of tests. From-SVN: r39466 --- libstdc++-v3/ChangeLog | 4 ++ .../27_io/ios_base_members_static.cc | 54 +++++++++---------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 362c97e0057..02794f9458c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2001-02-05 Phil Edwards + + * testsuite/27_io/ios_base_members_static.cc: Swap order of tests. + 2001-02-05 Mark Mitchell * src/string-inst.cc (string::_M_replace): Explicitly instantiate. diff --git a/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc b/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc index 08043449bdc..8a0db0b395f 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc @@ -30,33 +30,10 @@ #include -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) } - - -- 2.30.2