diff options
author | anonymous <local@localhost> | 2011-05-02 12:51:25 +0000 |
---|---|---|
committer | anonymous <local@localhost> | 2011-05-09 15:05:54 +0700 |
commit | 6f9032852fb6c55846c4b4a23f8b8976442cce51 (patch) | |
tree | 8b5222c3778ee59173bb753f5e7b446a20706b2f /test/test_exception.cc | |
parent | b12153bb8ad75cf2bf51d486895fce2769fe66d9 (diff) | |
download | libcxxrt-6f9032852fb6c55846c4b4a23f8b8976442cce51.tar.gz libcxxrt-6f9032852fb6c55846c4b4a23f8b8976442cce51.tar.bz2 libcxxrt-6f9032852fb6c55846c4b4a23f8b8976442cce51.tar.xz |
Tidy up of the libcxxrt sources. Added missing comments, fixed some inconsistent indenting.
Diffstat (limited to 'test/test_exception.cc')
-rw-r--r-- | test/test_exception.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/test_exception.cc b/test/test_exception.cc index 44fe5d0..6e16ca9 100644 --- a/test/test_exception.cc +++ b/test/test_exception.cc @@ -5,7 +5,7 @@ #include <exception> -//#define fprintf(...) +#define fprintf(...) void log(void* ignored) { @@ -162,6 +162,8 @@ fprintf(stderr, "Throwing 0\n"); throw 0; } +extern "C" void __cxa_bad_cast(); + void test_exceptions(void) { std::set_unexpected(throw_zero); @@ -193,6 +195,19 @@ void test_exceptions(void) { TEST(&a==b, "Caught int from thrown int"); } + try + { + __cxa_bad_cast(); + } + catch (std::exception b) + { + TEST(1, "Caught bad cast"); + } + catch (...) + { + TEST(0, "Bad cast was not caught correctly"); + } + //printf("Test: %s\n", } |