Commit 56ffd9b3 by Benjamin Kosnik Committed by Benjamin Kosnik

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
parent e358acde
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> 2005-01-05 Mark Mitchell <mark@codesourcery.com>
* testsuite/27_io/basic_filebuf/open/char/9507.cc: Remove child * testsuite/27_io/basic_filebuf/open/char/9507.cc: Remove child
......
// Bitmap Allocator. Out of line function definitions. -*- C++ -*- // 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 // 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
...@@ -96,7 +96,7 @@ namespace __gnu_cxx ...@@ -96,7 +96,7 @@ namespace __gnu_cxx
*__ret = __sz; *__ret = __sz;
return __ret + 1; return __ret + 1;
} }
__throw_exception_again std::bad_alloc(); std::__throw_bad_alloc();
} }
else else
{ {
......
// -*- C++ -*- // -*- 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 // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as // modify it under the terms of the GNU General Public License as
...@@ -263,7 +263,7 @@ get_symbol(const string& mangled, const symbols& s) ...@@ -263,7 +263,7 @@ get_symbol(const string& mangled, const symbols& s)
{ {
ostringstream os; ostringstream os;
os << "get_symbol failed for symbol " << mangled; 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) ...@@ -420,7 +420,7 @@ create_symbols(const char* file)
{ {
ostringstream os; ostringstream os;
os << "create_symbols failed for file " << file; os << "create_symbols failed for file " << file;
__throw_exception_again runtime_error(os.str()); __throw_runtime_error(os.str().c_str());
} }
return s; return s;
} }
......
// -*- C++ -*- // -*- 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 // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as // modify it under the terms of the GNU General Public License as
...@@ -69,12 +69,6 @@ struct symbol ...@@ -69,12 +69,6 @@ struct symbol
init(std::string& data); 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 __gnu_cxx::hash_map<std::string, symbol> symbol_objects;
typedef std::deque<std::string> symbol_names; typedef std::deque<std::string> symbol_names;
......
...@@ -151,32 +151,9 @@ namespace __gnu_test ...@@ -151,32 +151,9 @@ namespace __gnu_test
std::string w(wanted); std::string w(wanted);
if (w != s) 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 void
run_tests_wrapped_locale(const char* name, const func_callback& l) run_tests_wrapped_locale(const char* name, const func_callback& l)
{ {
...@@ -198,8 +175,11 @@ namespace __gnu_test ...@@ -198,8 +175,11 @@ namespace __gnu_test
VERIFY( preLC_ALL == postLC_ALL ); VERIFY( preLC_ALL == postLC_ALL );
} }
else 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 void
...@@ -224,8 +204,12 @@ namespace __gnu_test ...@@ -224,8 +204,12 @@ namespace __gnu_test
setenv(env, oldENV ? oldENV : "", 1); setenv(env, oldENV ? oldENV : "", 1);
} }
else 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 #endif
} }
...@@ -278,7 +262,8 @@ namespace __gnu_test ...@@ -278,7 +262,8 @@ 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.
...@@ -296,15 +281,13 @@ namespace __gnu_test ...@@ -296,15 +281,13 @@ namespace __gnu_test
// 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_exception_again std::__throw_runtime_error("could not obtain semaphore set");
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_exception_again std::__throw_runtime_error("could not initialize semaphore");
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
...@@ -313,7 +296,8 @@ namespace __gnu_test ...@@ -313,7 +296,8 @@ namespace __gnu_test
#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.
...@@ -323,26 +307,28 @@ namespace __gnu_test ...@@ -323,26 +307,28 @@ namespace __gnu_test
} }
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_exception_again std::__throw_runtime_error("could not signal semaphore");
std::runtime_error("could not signal semaphore");
#endif #endif
} }
void void
semaphore::wait() { semaphore::wait()
{
#ifdef _GLIBCXX_SYSV_SEM #ifdef _GLIBCXX_SYSV_SEM
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_exception_again std::__throw_runtime_error("could not wait for semaphore");
std::runtime_error("could not wait for semaphore");
#endif #endif
} }
}; // namespace __gnu_test }; // namespace __gnu_test
......
// -*- C++ -*- // -*- C++ -*-
// Utility subroutines for the C++ library testsuite. // 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 // 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
...@@ -224,7 +225,7 @@ namespace __gnu_test ...@@ -224,7 +225,7 @@ namespace __gnu_test
{ {
count_++; count_++;
if (count_ == throw_on_) if (count_ == throw_on_)
__throw_exception_again "copy constructor exception"; std::__throw_runtime_error("copy_constructor::mark_call");
} }
static void static void
...@@ -255,7 +256,7 @@ namespace __gnu_test ...@@ -255,7 +256,7 @@ namespace __gnu_test
{ {
count_++; count_++;
if (count_ == throw_on_) if (count_ == throw_on_)
__throw_exception_again "assignment operator exception"; std::__throw_runtime_error("assignment_operator::mark_call");
} }
static void static void
......
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