aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Edwards <pme@gcc.gnu.org>2001-02-05 22:08:47 +0000
committerPhil Edwards <pme@gcc.gnu.org>2001-02-05 22:08:47 +0000
commit58f60b5c912f2d45fb969331221d80cb00c00138 (patch)
treeef3ff7876beb7b2ae3c665ded678e32f3c5a4ac4
parent9b30b506d6ff0d18140c29e309ab3699d26606d4 (diff)
downloadgcc-58f60b5c912f2d45fb969331221d80cb00c00138.zip
gcc-58f60b5c912f2d45fb969331221d80cb00c00138.tar.gz
gcc-58f60b5c912f2d45fb969331221d80cb00c00138.tar.bz2
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
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base_members_static.cc54
2 files changed, 31 insertions, 27 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 362c97e..02794f9 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,7 @@
+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.
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 0804344..8a0db0b 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 <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)
}
-
-