diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-10-26 18:36:28 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-10-26 19:50:41 +0100 |
commit | ec88915a05a39f2edce5ac01e51f2be971f12b13 (patch) | |
tree | 5aa38dd20d828e8856a1020f6b7e6d43be4b4014 /examples | |
parent | 2b347407b1157086b58ae9d897e14b77fbdce5b4 (diff) |
Add assert_throws function for testing expected exception throwing behaviour.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/ExampleTest.cc | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/examples/ExampleTest.cc b/examples/ExampleTest.cc index bc5e2f7..2a4997c 100644 --- a/examples/ExampleTest.cc +++ b/examples/ExampleTest.cc @@ -92,19 +92,7 @@ public: void exceptionTests() { - try - { - getBaud(-1); - uUNIT_ASSERT(false); // exception should be thrown for invalid value - } - catch(const bad_speed& e) - { - // Excpected outcome - } - catch(...) - { - uUNIT_ASSERT(false); // Unknown exception were thrown - } + uUNIT_ASSERT_THROWS(bad_speed, getBaud(-1)); } }; |