From 7aac3649a100e6fc1660d99e9b4b6234e640a486 Mon Sep 17 00:00:00 2001 From: anonymous Date: Mon, 20 Sep 2010 00:26:10 +0000 Subject: Fixes the test case --- test/test_exception.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_exception.cc b/test/test_exception.cc index dde7492..6a81b93 100644 --- a/test/test_exception.cc +++ b/test/test_exception.cc @@ -136,20 +136,23 @@ void test_nested() } } +static int violations = 0; static void throw_zero() { + violations++; throw 0; } void test_exceptions(void) { + std::set_unexpected(throw_zero); TEST_CLEANUP(test_catch(0)); TEST_CLEANUP(test_catch(1)); TEST_CLEANUP(test_catch(3)); TEST_CLEANUP(test_catch(4)); TEST_CLEANUP(test_nested()); - std::set_unexpected(throw_zero); test_catch(2); + TEST(violations == 1, "Exactly one exception spec violation"); //printf("Test: %s\n", } -- cgit v1.2.3