Skip to content
Snippets Groups Projects
Commit c439ebc9 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

catch polymorphic exceptions always by reference

parent b64db665
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE( testApplicationExceptions ) {
TestApp app("");
BOOST_FAIL("Exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>) {
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>&) {
}
// names with spaces and special characters are forbidden
......@@ -67,13 +67,13 @@ BOOST_AUTO_TEST_CASE( testApplicationExceptions ) {
TestApp app("With space");
BOOST_FAIL("Exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>) {
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>&) {
}
try {
TestApp app("WithExclamationMark!");
BOOST_FAIL("Exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>) {
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>&) {
}
// all allowed characters in the name
......@@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE( testApplicationExceptions ) {
TestApp app2("SecondInstance");
BOOST_FAIL("Exception expected.");
}
catch(std::runtime_error) {
catch(std::runtime_error&) {
}
}
......
......@@ -440,7 +440,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testReadAny, T, test_types ) {
test.stepApplication();
BOOST_ERROR("IllegalParameter exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>) {
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>&) {
}
// check that we still don't receive anything anymore
......@@ -549,7 +549,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testChainedModules, T, test_types ) {
test.stepApplication();
BOOST_ERROR("IllegalParameter exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>) {
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>&) {
}
// check that we still don't receive anything anymore
......@@ -653,7 +653,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testWithFanOut, T, test_types ) {
test.stepApplication();
BOOST_ERROR("IllegalParameter exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>) {
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>&) {
}
// check that we still don't receive anything anymore
......@@ -744,7 +744,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testWithTrigger, T, test_types ) {
test.stepApplication();
BOOST_ERROR("IllegalParameter exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>) {
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>&) {
}
// check that we still don't receive anything anymore
......@@ -862,7 +862,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testWithTriggerFanOut, T, test_types ) {
test.stepApplication();
BOOST_ERROR("IllegalParameter exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>) {
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalParameter>&) {
}
// check that we still don't receive anything anymore
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment