+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
// 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
*__ret = __sz;
return __ret + 1;
}
- __throw_exception_again std::bad_alloc();
+ std::__throw_bad_alloc();
}
else
{
// -*- 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
{
ostringstream os;
os << "get_symbol failed for symbol " << mangled;
- __throw_exception_again symbol_error(os.str());
+ __throw_logic_error(os.str().c_str());
}
}
{
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;
}
// -*- 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
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;
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)
{
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
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
}
};
#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.
// 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
#endif
}
- semaphore::~semaphore() {
+ semaphore::~semaphore()
+ {
#ifdef _GLIBCXX_SYSV_SEM
union semun val;
// Destroy the semaphore set only in the process that created it.
}
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
// -*- 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
{
count_++;
if (count_ == throw_on_)
- __throw_exception_again "copy constructor exception";
+ std::__throw_runtime_error("copy_constructor::mark_call");
}
static void
{
count_++;
if (count_ == throw_on_)
- __throw_exception_again "assignment operator exception";
+ std::__throw_runtime_error("assignment_operator::mark_call");
}
static void