]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / basic_filebuf / close / char / 9964.cc
index cbafd477d2c5f296968fccddd65f8f7422935e46..0a84520377b6bf2755fc2ac2b3c7d7ed2cded9f2 100644 (file)
@@ -1,7 +1,7 @@
 // { dg-require-fork "" }
 // { dg-require-mkfifo "" }
 
-// Copyright (C) 2001-2015 Free Software Foundation, Inc.
+// Copyright (C) 2001-2020 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -33,9 +33,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-// No asserts, avoid leaking the semaphores if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
 #include <testsuite_hooks.h>
 
 // libstdc++/9964
@@ -43,7 +40,7 @@ bool test_07()
 {
   using namespace std;
   using namespace __gnu_test;
-  bool test __attribute__((unused)) = true;
+  bool test = true;
   semaphore s1, s2;
 
   const char* name = "tmp_fifo3";
@@ -54,7 +51,7 @@ bool test_07()
   mkfifo(name, S_IRWXU);
   
   int child = fork();
-  VERIFY( child != -1 );
+  test &= bool( child != -1 );
 
   if (child == 0)
     {
@@ -68,15 +65,15 @@ bool test_07()
   
   filebuf fb;
   filebuf* ret = fb.open(name, ios_base::in | ios_base::out);
-  VERIFY( ret != 0 );
-  VERIFY( fb.is_open() );
+  test &= bool( ret != 0 );
+  test &= bool( fb.is_open() );
   s1.signal();
   s2.wait();
   fb.sputc('a');
 
   ret = fb.close();
-  VERIFY( ret != 0 );
-  VERIFY( !fb.is_open() );
+  test &= bool( ret != 0 );
+  test &= bool( !fb.is_open() );
 
   return test;
 }