2005-01-05 Benjamin Kosnik <bkoz@redhat.com>

* testsuite/testsuite_hooks.h:
	(copy_constructor::mark_call):  Use __throw_runtime_error.
	(assignment_operator::mark_call): Same.
	* testsuite/testsuite_hooks.cc (verify_demangle): Same.
	(locale_data): Remove, just use runtime_error directly.
	(environment_variable): Same.
	(not_found): Same.
	(run_tests_wrapped_locale): Use __throw_runtime_error.
	(run_tests_wrapped_env): Same.
	(semaphore::semaphore): Same.
	(semaphore::signal): Same.
	(semaphore::wait): Same.
	* testsuite/testsuite_abi.h (symbol_error): Remove, use logic_error.
	* testsuite/testsuite_abi.cc (get_symbol): Use __throw_logic_error.
	(create_symbols): Use __throw_runtime_error.
	* src/bitmap_allocator.cc: Use __throw_bad_alloc.

From-SVN: r92989
This commit is contained in:
Benjamin Kosnik 2005-01-06 07:08:48 +00:00 committed by Benjamin Kosnik
parent e358acde2c
commit 56ffd9b3ba
6 changed files with 61 additions and 61 deletions

View File

@ -1,3 +1,22 @@
2005-01-05 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/testsuite_hooks.h:
(copy_constructor::mark_call): Use __throw_runtime_error.
(assignment_operator::mark_call): Same.
* testsuite/testsuite_hooks.cc (verify_demangle): Same.
(locale_data): Remove, just use runtime_error directly.
(environment_variable): Same.
(not_found): Same.
(run_tests_wrapped_locale): Use __throw_runtime_error.
(run_tests_wrapped_env): Same.
(semaphore::semaphore): Same.
(semaphore::signal): Same.
(semaphore::wait): Same.
* testsuite/testsuite_abi.h (symbol_error): Remove, use logic_error.
* testsuite/testsuite_abi.cc (get_symbol): Use __throw_logic_error.
(create_symbols): Use __throw_runtime_error.
* src/bitmap_allocator.cc: Use __throw_bad_alloc.
2005-01-05 Mark Mitchell <mark@codesourcery.com>
* testsuite/27_io/basic_filebuf/open/char/9507.cc: Remove child

View File

@ -1,6 +1,6 @@
// Bitmap Allocator. Out of line function definitions. -*- C++ -*-
// 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
// software; you can redistribute it and/or modify it under the
@ -96,7 +96,7 @@ namespace __gnu_cxx
*__ret = __sz;
return __ret + 1;
}
__throw_exception_again std::bad_alloc();
std::__throw_bad_alloc();
}
else
{

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
// Copyright (C) 2004 Free Software Foundation, Inc.
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@ -263,7 +263,7 @@ get_symbol(const string& mangled, const symbols& s)
{
ostringstream os;
os << "get_symbol failed for symbol " << mangled;
__throw_exception_again symbol_error(os.str());
__throw_logic_error(os.str().c_str());
}
}
@ -420,7 +420,7 @@ create_symbols(const char* file)
{
ostringstream os;
os << "create_symbols failed for file " << file;
__throw_exception_again runtime_error(os.str());
__throw_runtime_error(os.str().c_str());
}
return s;
}

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
// Copyright (C) 2004 Free Software Foundation, Inc.
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@ -69,12 +69,6 @@ struct symbol
init(std::string& data);
};
struct symbol_error : public std::logic_error
{
explicit symbol_error(const std::string& s) : std::logic_error(s) { }
};
typedef __gnu_cxx::hash_map<std::string, symbol> symbol_objects;
typedef std::deque<std::string> symbol_names;

View File

@ -151,32 +151,9 @@ namespace __gnu_test
std::string w(wanted);
if (w != s)
__throw_exception_again std::runtime_error(std::string(s));
std::__throw_runtime_error(s);
}
// Useful exceptions.
class locale_data : public std::runtime_error
{
public:
explicit
locale_data(const std::string& __arg) : runtime_error(__arg) { }
};
class environment_variable: public std::runtime_error
{
public:
explicit
environment_variable(const std::string& __arg) : runtime_error(__arg) { }
};
class not_found : public std::runtime_error
{
public:
explicit
not_found(const std::string& __arg) : runtime_error(__arg) { }
};
void
run_tests_wrapped_locale(const char* name, const func_callback& l)
{
@ -198,8 +175,11 @@ namespace __gnu_test
VERIFY( preLC_ALL == postLC_ALL );
}
else
__throw_exception_again
environment_variable(string("LC_ALL for ") + string(name));
{
string s("LC_ALL for ");
s += name;
__throw_runtime_error(s.c_str());
}
}
void
@ -224,8 +204,12 @@ namespace __gnu_test
setenv(env, oldENV ? oldENV : "", 1);
}
else
__throw_exception_again
environment_variable(string(env) + string(" to ") + string(name));
{
string s(env);
s += string(" to ");
s += string(name);
__throw_runtime_error(s.c_str());
}
#endif
}
@ -278,7 +262,8 @@ namespace __gnu_test
};
#endif
semaphore::semaphore() {
semaphore::semaphore()
{
#ifdef _GLIBCXX_SYSV_SEM
// Remeber the PID for the process that created the semaphore set
// so that only one process will destroy the set.
@ -296,15 +281,13 @@ namespace __gnu_test
// Get a semaphore set with one semaphore.
sem_set_ = semget(IPC_PRIVATE, 1, SEM_R | SEM_A);
if (sem_set_ == -1)
__throw_exception_again
std::runtime_error ("could not obtain semaphore set");
std::__throw_runtime_error("could not obtain semaphore set");
// Initialize the semaphore.
union semun val;
val.val = 0;
if (semctl(sem_set_, 0, SETVAL, val) == -1)
__throw_exception_again
std::runtime_error("could not initialize semaphore");
std::__throw_runtime_error("could not initialize semaphore");
#else
// There are no semaphores on this system. We have no way to mark
// a test as "unsupported" at runtime, so we just exit, pretending
@ -313,7 +296,8 @@ namespace __gnu_test
#endif
}
semaphore::~semaphore() {
semaphore::~semaphore()
{
#ifdef _GLIBCXX_SYSV_SEM
union semun val;
// Destroy the semaphore set only in the process that created it.
@ -323,26 +307,28 @@ namespace __gnu_test
}
void
semaphore::signal() {
semaphore::signal()
{
#ifdef _GLIBCXX_SYSV_SEM
struct sembuf op[1] = {
{ 0, 1, 0 }
};
struct sembuf op[1] =
{
{ 0, 1, 0 }
};
if (semop(sem_set_, op, 1) == -1)
__throw_exception_again
std::runtime_error("could not signal semaphore");
std::__throw_runtime_error("could not signal semaphore");
#endif
}
void
semaphore::wait() {
semaphore::wait()
{
#ifdef _GLIBCXX_SYSV_SEM
struct sembuf op[1] = {
{ 0, -1, SEM_UNDO }
};
struct sembuf op[1] =
{
{ 0, -1, SEM_UNDO }
};
if (semop(sem_set_, op, 1) == -1)
__throw_exception_again
std::runtime_error("could not wait for semaphore");
std::__throw_runtime_error("could not wait for semaphore");
#endif
}
}; // namespace __gnu_test

View File

@ -1,7 +1,8 @@
// -*- C++ -*-
// Utility subroutines for the C++ library testsuite.
//
// Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
// 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
@ -224,7 +225,7 @@ namespace __gnu_test
{
count_++;
if (count_ == throw_on_)
__throw_exception_again "copy constructor exception";
std::__throw_runtime_error("copy_constructor::mark_call");
}
static void
@ -255,7 +256,7 @@ namespace __gnu_test
{
count_++;
if (count_ == throw_on_)
__throw_exception_again "assignment operator exception";
std::__throw_runtime_error("assignment_operator::mark_call");
}
static void