From 9b38eee642531b627a0ab24980c9b2010c7af118 Mon Sep 17 00:00:00 2001 From: anonymous Date: Tue, 21 Sep 2010 15:44:27 +0000 Subject: Fixed testcase --- test/test_exception.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test') 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", } -- cgit v1.2.3