diff options
author | anonymous <local@localhost> | 2010-09-21 15:44:27 +0000 |
---|---|---|
committer | anonymous <local@localhost> | 2010-09-21 15:44:27 +0000 |
commit | 9b38eee642531b627a0ab24980c9b2010c7af118 (patch) | |
tree | 88b1ccce1a1c5bcde341c10f28a154d8f6af819d /test | |
parent | 5415b1b2cf339d1238e7f15321182780d9fa5af2 (diff) | |
download | libcxxrt-9b38eee642531b627a0ab24980c9b2010c7af118.tar.gz libcxxrt-9b38eee642531b627a0ab24980c9b2010c7af118.tar.bz2 libcxxrt-9b38eee642531b627a0ab24980c9b2010c7af118.tar.xz |
Fixed testcase
Diffstat (limited to 'test')
-rw-r--r-- | test/test_exception.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/test_exception.cc b/test/test_exception.cc index 6a81b93..5042b64 100644 --- a/test/test_exception.cc +++ b/test/test_exception.cc @@ -54,7 +54,7 @@ int inner(int i) { case 0: throw (int)1.0; case 1: throw (float)1.0; - case 2: throw (int64_t)1; + case 2: fprintf(stderr, "Throwing int64_t\n");throw (int64_t)1; case 3: { foo f = {2} ; throw f; } case 4: { bar f; f.i = 2 ; f.bar=1 ; throw f; } } @@ -140,6 +140,7 @@ static int violations = 0; static void throw_zero() { violations++; +fprintf(stderr, "Throwing 0\n"); throw 0; } @@ -151,8 +152,13 @@ void test_exceptions(void) TEST_CLEANUP(test_catch(3)); TEST_CLEANUP(test_catch(4)); TEST_CLEANUP(test_nested()); - test_catch(2); - TEST(violations == 1, "Exactly one exception spec violation"); + try{ + test_catch(2); + TEST(violations == 1, "Exactly one exception spec violation"); + } + catch (int64_t i) { + TEST(0, "Caught int64_t, but that violates an exception spec"); + } //printf("Test: %s\n", } |