OSDN Git Service

2003-11-29 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Nov 2003 17:42:16 +0000 (17:42 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Nov 2003 17:42:16 +0000 (17:42 +0000)
* testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc:
Tweak for a few small problems (fix timings, use VERIFY..)

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74034 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc

index 31a4765..5e7d21f 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-29  Paolo Carlini  <pcarlini@suse.de>
+
+       * testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc:
+       Tweak for a few small problems (fix timings, use VERIFY..)
+
 2003-11-28  Paolo Carlini  <pcarlini@suse.de>
 
        * testsuite/27_io/basic_filebuf/imbue/char/13171-3.cc: Remove.
index 65190ad..74aa1fc 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <fstream>
 #include <locale>
-#include <cassert>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -33,6 +32,9 @@ void test01()
   bool test __attribute__((unused)) = true;
   using namespace std;
 
+  locale loc_fr(__gnu_test::try_named_locale("fr_FR"));
+  locale loc_en(__gnu_test::try_named_locale("en_US"));
+
   const char* name = "tmp_fifo_13171-2";
   unlink(name);
   mkfifo(name, S_IRWXU);
@@ -43,21 +45,25 @@ void test01()
       filebuf fb;
       fb.open(name, ios_base::out);
       fb.sputc('S');
+      fb.pubsync();
+      sleep(2);
       fb.close();
-      return;
+      exit(0);
     }
 
   filebuf fb;
-  fb.pubimbue(__gnu_test::try_named_locale("fr_FR"));
+  fb.pubimbue(loc_fr);
   fb.open(name, ios_base::in);
-  assert(fb.is_open());
-  fb.pubimbue(__gnu_test::try_named_locale("en_US"));
+  sleep(1);
+  VERIFY( fb.is_open() );
+  fb.pubimbue(loc_en);
   filebuf::int_type c = fb.sgetc();
-  assert(c == 'S');
   fb.close();
+  VERIFY( c == 'S' );
 }
 
 int main()
 {
   test01();
+  return 0;
 }