A
Aryeh M. Friedman
I am writting a uit tsting framework and need to know is there any way to
detect if some expression throws a exception or not (I know how to handle
the case of it throwing but not the expected one). Here is my test macro so
far:
#define TEST_ASSERT_THROW(expr,x) \
try { expr; } catch(x) {test_pass(0);} catch(...) {test_fail(0);};
What I want is a test_fail(0) if no exception was thrown by expr.
--Aryeh
detect if some expression throws a exception or not (I know how to handle
the case of it throwing but not the expected one). Here is my test macro so
far:
#define TEST_ASSERT_THROW(expr,x) \
try { expr; } catch(x) {test_pass(0);} catch(...) {test_fail(0);};
What I want is a test_fail(0) if no exception was thrown by expr.
--Aryeh