| 1 |
project('testcase clause') |
| 2 |
|
| 3 |
# To make sure unreachable code is not executed. |
| 4 |
unreachable = true |
| 5 |
|
| 6 |
# Verify assertion exception gets catched and dropped. |
| 7 |
testcase expect_error('Assert failed: false') |
| 8 |
assert(false) |
| 9 |
unreachable = false |
| 10 |
endtestcase |
| 11 |
assert(unreachable) |
| 12 |
|
| 13 |
# The inner testcase raises an exception because it did not receive the expected |
| 14 |
# error message. The outer testcase catches the inner testcase exception and |
| 15 |
# drop it. |
| 16 |
testcase expect_error('Expecting error \'something\' but got \'Assert failed: false\'') |
| 17 |
testcase expect_error('something') |
| 18 |
assert(false) |
| 19 |
unreachable = false |
| 20 |
endtestcase |
| 21 |
unreachable = false |
| 22 |
endtestcase |
| 23 |
assert(unreachable) |
| 24 |
|
| 25 |
# The inner testcase raises an exception because it did not receive an |
| 26 |
# exception. The outer testcase catches the inner testcase exception and |
| 27 |
# drop it. |
| 28 |
testcase expect_error('Expecting an error but code block succeeded') |
| 29 |
testcase expect_error('something') |
| 30 |
reached = true |
| 31 |
endtestcase |
| 32 |
unreachable = false |
| 33 |
endtestcase |
| 34 |
assert(reached) |
| 35 |
assert(unreachable) |
| 36 |
|
| 37 |
message('all good') |