From c6253c2c0cb183c33779a228ad016b3db83fe260 Mon Sep 17 00:00:00 2001 From: Thomas Moulard <thomas.moulard@gmail.com> Date: Fri, 24 Dec 2010 01:20:36 +0100 Subject: [PATCH] Make tests more robust. --- tests/custom-entity.cpp | 4 ++-- tests/entity.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/custom-entity.cpp b/tests/custom-entity.cpp index 1c4b5c88..c19b1631 100644 --- a/tests/custom-entity.cpp +++ b/tests/custom-entity.cpp @@ -143,10 +143,10 @@ BOOST_AUTO_TEST_CASE (commandLine_unknown) try { entity.commandLine("unknown", args, output); + BOOST_ERROR ("Should never happen."); } - catch (dynamicgraph::ExceptionFactory& exception) + catch (const dynamicgraph::ExceptionFactory& exception) { - //FIXME: getCode should be const. BOOST_CHECK_EQUAL (exception.getCode (), dynamicgraph::ExceptionFactory::UNREFERED_FUNCTION); } diff --git a/tests/entity.cpp b/tests/entity.cpp index fb54111c..c6ea7dd9 100644 --- a/tests/entity.cpp +++ b/tests/entity.cpp @@ -43,10 +43,10 @@ BOOST_AUTO_TEST_CASE (signal) try { entity.getSignal ("I do not exist"); + BOOST_ERROR ("Should never happen."); } - catch (dynamicgraph::ExceptionFactory& exception) + catch (const dynamicgraph::ExceptionFactory& exception) { - //FIXME: getCode should be const. BOOST_CHECK_EQUAL (exception.getCode (), dynamicgraph::ExceptionFactory::UNREFERED_SIGNAL); } @@ -56,10 +56,10 @@ BOOST_AUTO_TEST_CASE (signal) { const dynamicgraph::Entity& entityConst = entity; entityConst.getSignal ("I do not exist"); + BOOST_ERROR ("Should never happen."); } - catch (dynamicgraph::ExceptionFactory& exception) + catch (const dynamicgraph::ExceptionFactory& exception) { - //FIXME: getCode should be const. BOOST_CHECK_EQUAL (exception.getCode (), dynamicgraph::ExceptionFactory::UNREFERED_SIGNAL); } @@ -146,10 +146,10 @@ BOOST_AUTO_TEST_CASE (commandLine_signalDep) try { entity.commandLine("signalDep", args, output); + BOOST_ERROR ("Should never happen."); } - catch (dynamicgraph::ExceptionFactory& exception) + catch (const dynamicgraph::ExceptionFactory& exception) { - //FIXME: getCode should be const. BOOST_CHECK_EQUAL (exception.getCode (), dynamicgraph::ExceptionFactory::UNREFERED_SIGNAL); } @@ -168,10 +168,10 @@ BOOST_AUTO_TEST_CASE (commandLine_unknown) try { entity.commandLine("unknown", args, output); + BOOST_ERROR ("Should never happen."); } - catch (dynamicgraph::ExceptionFactory& exception) + catch (const dynamicgraph::ExceptionFactory& exception) { - //FIXME: getCode should be const. BOOST_CHECK_EQUAL (exception.getCode (), dynamicgraph::ExceptionFactory::UNREFERED_FUNCTION); } -- GitLab