Adding test of NOCLEAR property
This commit is contained in:
1 parent
08b4bc9052
commit
b7214ad11d
1 file changed
+13
@@ -356,6 +356,19 @@ static void test2(void)
|
||||
// Nothing to do
|
||||
assert(0);
|
||||
}
|
||||
|
||||
// Test of NOCLEAR property:
|
||||
// Destructor is not called on exception.
|
||||
#define FAIL(a) ((void)a, assert(0))
|
||||
#define OPL (INIT(M_INIT_BASIC), TYPE(int), CLEAR(FAIL), PROPERTIES((NOCLEAR(1))))
|
||||
M_TRY(test1) {
|
||||
M_LET( obj, OPL) {
|
||||
M_THROW(1);
|
||||
assert(0);
|
||||
}
|
||||
} M_CATCH(test1, 1) {
|
||||
// Nothing to do
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
|
||||
Reference in new issue
Block a user