This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Tweak a recently added test (13171-2.cc)


Hi,

dunno if this will fix the time outs reported by some people, but
definitely the test had many small problems and this is what I
should have committed in the first place, sorry about that.

Tested x86-linux, committed.

Paolo.

///////////
2003-11-28  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..)
diff -urN libstdc++-v3-orig/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc
--- libstdc++-v3-orig/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc	2003-11-26 01:08:10.000000000 +0100
+++ libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc	2003-11-29 18:38:09.000000000 +0100
@@ -20,7 +20,6 @@
 
 #include <fstream>
 #include <locale>
-#include <cassert>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -33,6 +32,9 @@
   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 @@
       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;
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]