Commit 2d25605a by Paolo Carlini Committed by Paolo Carlini

13171-2.cc: Tweak for a few small problems (fix timings, use VERIFY..)

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..)

From-SVN: r74034
parent 26b0ad13
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> 2003-11-28 Paolo Carlini <pcarlini@suse.de>
* testsuite/27_io/basic_filebuf/imbue/char/13171-3.cc: Remove. * testsuite/27_io/basic_filebuf/imbue/char/13171-3.cc: Remove.
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <fstream> #include <fstream>
#include <locale> #include <locale>
#include <cassert>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -33,6 +32,9 @@ void test01() ...@@ -33,6 +32,9 @@ void test01()
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
using namespace std; 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"; const char* name = "tmp_fifo_13171-2";
unlink(name); unlink(name);
mkfifo(name, S_IRWXU); mkfifo(name, S_IRWXU);
...@@ -43,21 +45,25 @@ void test01() ...@@ -43,21 +45,25 @@ void test01()
filebuf fb; filebuf fb;
fb.open(name, ios_base::out); fb.open(name, ios_base::out);
fb.sputc('S'); fb.sputc('S');
fb.pubsync();
sleep(2);
fb.close(); fb.close();
return; exit(0);
} }
filebuf fb; filebuf fb;
fb.pubimbue(__gnu_test::try_named_locale("fr_FR")); fb.pubimbue(loc_fr);
fb.open(name, ios_base::in); fb.open(name, ios_base::in);
assert(fb.is_open()); sleep(1);
fb.pubimbue(__gnu_test::try_named_locale("en_US")); VERIFY( fb.is_open() );
fb.pubimbue(loc_en);
filebuf::int_type c = fb.sgetc(); filebuf::int_type c = fb.sgetc();
assert(c == 'S');
fb.close(); fb.close();
VERIFY( c == 'S' );
} }
int main() int main()
{ {
test01(); test01();
return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment