Commit 8ca82e09 by Mark Mitchell Committed by Mark Mitchell

testsuite_hooks.cc: Update coypright and follow style guidelines.

	* testsuite/testsuite_hooks.cc: Update coypright and follow style
	guidelines.
	* testsuite/testsuite_hooks.h: Likewise.
	* testsuite/27_io/basic_filebuf/close/char/4879.cc: Use
	semaphores, not sleep.
	* testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise.
	* testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/imbue/char/13582-2.cc: Likewise.
	* testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc:
	Likewise.
	* testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise.
	* testsuite/27_io/basic_filebuf/underflow/char/10097.cc: Likewise.
	* testsuite/27_io/objects/char/7.cc: Likewise.
	* testsuite/27_io/objects/char/9661-1.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/7.cc: Likewise.
	* testsuite/27_io/objects/wchar_t/9661-1.cc: Likewise.

From-SVN: r92877
parent 85b7d889
2005-01-03 Mark Mitchell <mark@codesourcery.com> 2005-01-03 Mark Mitchell <mark@codesourcery.com>
* testsuite/testsuite_hooks.cc: Update coypright and follow style
guidelines.
* testsuite/testsuite_hooks.h: Likewise.
* testsuite/27_io/basic_filebuf/close/char/4879.cc: Use
semaphores, not sleep.
* testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise.
* testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise.
* testsuite/27_io/basic_filebuf/imbue/char/13582-2.cc: Likewise.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc:
Likewise.
* testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise.
* testsuite/27_io/basic_filebuf/underflow/char/10097.cc: Likewise.
* testsuite/27_io/objects/char/7.cc: Likewise.
* testsuite/27_io/objects/char/9661-1.cc: Likewise.
* testsuite/27_io/objects/wchar_t/7.cc: Likewise.
* testsuite/27_io/objects/wchar_t/9661-1.cc: Likewise.
* configure.ac: Check for sys/ipc.h and sys/sem.h. * configure.ac: Check for sys/ipc.h and sys/sem.h.
* config.h.in: Regenerated. * config.h.in: Regenerated.
* configure: Likewise. * configure: Likewise.
......
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// Copyright (C) 2003 Free Software Foundation, Inc. // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// 2004-01-11 Petur Runolfsson <peturr02@ru.is> // 2004-01-11 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2004 Free Software Foundation, Inc. // Copyright (C) 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// 2004-04-16 Petur Runolfsson <peturr02@ru.is> // 2004-04-16 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2004 Free Software Foundation, Inc. // Copyright (C) 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// 2003-04-26 Petur Runolfsson <peturr02@ru.is> // 2003-04-26 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003 Free Software Foundation, Inc. // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// 2003-04-30 Petur Runolfsson <peturr02@ru.is> // 2003-04-30 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003 Free Software Foundation, Inc. // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// 2003-05-01 Petur Runolfsson <peturr02@ru.is> // 2003-05-01 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003 Free Software Foundation, Inc. // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// 2003-04-30 Petur Runolfsson <peturr02@ru.is> // 2003-04-30 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003 Free Software Foundation, Inc. // Copyright (C) 2003, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
......
// -*- C++ -*- // -*- C++ -*-
// Utility subroutines for the C++ library testsuite. // Utility subroutines for the C++ library testsuite.
// //
// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. // Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -278,8 +278,7 @@ namespace __gnu_test ...@@ -278,8 +278,7 @@ namespace __gnu_test
}; };
#endif #endif
semaphore::semaphore () semaphore::semaphore() {
{
#ifdef _GLIBCXX_SYSV_SEM #ifdef _GLIBCXX_SYSV_SEM
// Remeber the PID for the process that created the semaphore set // Remeber the PID for the process that created the semaphore set
// so that only one process will destroy the set. // so that only one process will destroy the set.
...@@ -295,42 +294,40 @@ namespace __gnu_test ...@@ -295,42 +294,40 @@ namespace __gnu_test
#endif #endif
// Get a semaphore set with one semaphore. // Get a semaphore set with one semaphore.
sem_set_ = semget (IPC_PRIVATE, 1, SEM_R | SEM_A); sem_set_ = semget(IPC_PRIVATE, 1, SEM_R | SEM_A);
if (sem_set_ == -1) if (sem_set_ == -1)
throw std::runtime_error ("could not obtain semaphore set"); throw std::runtime_error ("could not obtain semaphore set");
// Initialize the semaphore. // Initialize the semaphore.
union semun val; union semun val;
val.val = 0; val.val = 0;
if (semctl (sem_set_, 0, SETVAL, val) == -1) if (semctl(sem_set_, 0, SETVAL, val) == -1)
throw std::runtime_error ("could not initialize semaphore"); throw std::runtime_error("could not initialize semaphore");
#else #else
// There are no semaphores on this system. We have no way to mark // There are no semaphores on this system. We have no way to mark
// a test as "unsupported" at runtime, so we just exit, pretending // a test as "unsupported" at runtime, so we just exit, pretending
// that the test passed. // that the test passed.
exit (0); exit(0);
#endif #endif
} }
semaphore::~semaphore () semaphore::~semaphore() {
{
#ifdef _GLIBCXX_SYSV_SEM #ifdef _GLIBCXX_SYSV_SEM
union semun val; union semun val;
// Destroy the semaphore set only in the process that created it. // Destroy the semaphore set only in the process that created it.
if (pid_ == getpid ()) if (pid_ == getpid())
semctl (sem_set_, 0, IPC_RMID, val); semctl(sem_set_, 0, IPC_RMID, val);
#endif #endif
} }
void void
semaphore::signal () semaphore::signal() {
{
#ifdef _GLIBCXX_SYSV_SEM #ifdef _GLIBCXX_SYSV_SEM
struct sembuf op[1] = { struct sembuf op[1] = {
{ 0, 1, 0 } { 0, 1, 0 }
}; };
if (semop (sem_set_, op, 1) == -1) if (semop(sem_set_, op, 1) == -1)
throw std::runtime_error ("could not signal semaphore"); throw std::runtime_error("could not signal semaphore");
#endif #endif
} }
...@@ -340,8 +337,8 @@ namespace __gnu_test ...@@ -340,8 +337,8 @@ namespace __gnu_test
struct sembuf op[1] = { struct sembuf op[1] = {
{ 0, -1, SEM_UNDO } { 0, -1, SEM_UNDO }
}; };
if (semop (sem_set_, op, 1) == -1) if (semop(sem_set_, op, 1) == -1)
throw std::runtime_error ("could not wait for semaphore"); throw std::runtime_error("could not wait for semaphore");
#endif #endif
} }
}; // namespace __gnu_test }; // namespace __gnu_test
......
...@@ -387,17 +387,17 @@ namespace __gnu_test ...@@ -387,17 +387,17 @@ namespace __gnu_test
public: public:
// Creates a binary semaphore. The semaphore is initially in the // Creates a binary semaphore. The semaphore is initially in the
// unsignaled state. // unsignaled state.
semaphore (); semaphore();
// Destroy the semaphore. // Destroy the semaphore.
~semaphore(); ~semaphore();
// Signal the semaphore. If there are processes blocked in // Signal the semaphore. If there are processes blocked in
// "wait", exactly one will be permitted to proceed. // "wait", exactly one will be permitted to proceed.
void signal (); void signal();
// Wait until the semaphore is signaled. // Wait until the semaphore is signaled.
void wait (); void wait();
private: private:
int sem_set_; int sem_set_;
......
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