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,7 +30,33 @@ #include -bool test01() +// N.B. Once we have called sync_with_stdio(false), we can never go back. + +void +test01() +{ + std::ios_base::sync_with_stdio(); + + std::freopen("ios_base_members_static-1.txt", "w", stdout); + + for (int i = 0; i < 2; i++) + { + std::printf("1"); + std::cout << "2"; + std::putc('3', stdout); // std::stdout doesn't work here + std::cout << '4'; + std::fputs("5", stdout); + std::cout << 6; + std::putchar('7'); + std::cout << 8 << '9'; + if (i) + std::printf ("0\n"); + else + std::cout << "0" << std::endl; + } +} + +bool test02() { bool test = true; @@ -55,30 +81,6 @@ bool test01() return test; } -void -test02() -{ - std::ios_base::sync_with_stdio(); - - std::freopen("ios_base_members_static-1.txt", "w", stdout); - - for (int i = 0; i < 2; i++) - { - std::printf("1"); - std::cout << "2"; - std::putc('3', stdout); // std::stdout doesn't work here - std::cout << '4'; - std::fputs("5", stdout); - std::cout << 6; - std::putchar('7'); - std::cout << 8 << '9'; - if (i) - std::printf ("0\n"); - else - std::cout << "0" << std::endl; - } -} - int main(void) { test01(); @@ -87,5 +89,3 @@ int main(void) } - -