diff --git a/tests/executables_src/testDeviceExceptionFlagPropagation.cc b/tests/executables_src/testDeviceExceptionFlagPropagation.cc index 56dabcf6bf4515f71dda7cecae4fc7764fd555c8..fd4d941d277d6b4e29dbc098bd2a22cf035d46c6 100644 --- a/tests/executables_src/testDeviceExceptionFlagPropagation.cc +++ b/tests/executables_src/testDeviceExceptionFlagPropagation.cc @@ -4,7 +4,7 @@ using namespace boost::unit_test_framework; #include <ChimeraTK/DummyRegisterAccessor.h> -#include <ChimeraTK/ExceptionDevice.h> +#include <ChimeraTK/ExceptionDummyBackend.h> #include "Application.h" #include "ApplicationModule.h" @@ -88,7 +88,7 @@ struct TestApplication : ctk::Application { BOOST_AUTO_TEST_CASE(testDirectConnectOpen) { for(int readMode = 0; readMode < 3; ++readMode) { TestApplication app; - boost::shared_ptr<ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); app.dev("/MyModule/readBack", typeid(int), 1) >> app.module.vars.read; @@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(testDirectConnectOpen) { BOOST_AUTO_TEST_CASE(testDirectConnectRead) { TestApplication app; - boost::shared_ptr<ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); app.dev("/MyModule/readBack", typeid(int), 1) >> app.module.vars.read; @@ -153,7 +153,7 @@ BOOST_AUTO_TEST_CASE(testDirectConnectRead) { BOOST_AUTO_TEST_CASE(testDirectConnectWrite) { TestApplication app; - boost::shared_ptr<ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); app.dev("/MyModule/readBack", typeid(int), 1) >> app.module.vars.read; diff --git a/tests/executables_src/testDeviceInitialisationHandler.cc b/tests/executables_src/testDeviceInitialisationHandler.cc index fbd4336c3e14a3c5c4a4951ebbb5d6a71a1c10e9..4460cf3839a07f9cec6ac467b257d7ded1864818 100644 --- a/tests/executables_src/testDeviceInitialisationHandler.cc +++ b/tests/executables_src/testDeviceInitialisationHandler.cc @@ -12,7 +12,7 @@ #include "TestFacility.h" #include <ChimeraTK/Device.h> -#include <ChimeraTK/ExceptionDevice.h> +#include <ChimeraTK/ExceptionDummyBackend.h> #include <stdlib.h> #include "check_timeout.h" @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(testBasicInitialisation) { // check that accessing an exception triggers a reconnection with re-initialisation auto dummyBackend = - boost::dynamic_pointer_cast<ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(deviceCDD)); + boost::dynamic_pointer_cast<ctk::ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(deviceCDD)); dummyBackend->throwExceptionWrite = true; auto reg2_cs = test.getScalar<int32_t>("/REG2"); @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(testMultipleInitialisationHandlers) { // cause an exception auto dummyBackend = - boost::dynamic_pointer_cast<ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(deviceCDD)); + boost::dynamic_pointer_cast<ctk::ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(deviceCDD)); dummyBackend->throwExceptionWrite = true; auto reg4_cs = test.getScalar<int32_t>("/REG4"); @@ -214,7 +214,7 @@ BOOST_AUTO_TEST_CASE(testInitialisationException) { // Make initialisation fail when executed, and then cause an error condition throwInInitialisation = true; auto dummyBackend = - boost::dynamic_pointer_cast<ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(deviceCDD)); + boost::dynamic_pointer_cast<ctk::ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(deviceCDD)); dummyBackend->throwExceptionWrite = true; auto reg4_cs = test.getScalar<int32_t>("/REG4"); diff --git a/tests/executables_src/testExceptionHandling.cc b/tests/executables_src/testExceptionHandling.cc index 78157d16bf5b46b841fdae357da36c74fb6c2715..cac0e665f8bc46592cd471629429e40f6aafb204 100644 --- a/tests/executables_src/testExceptionHandling.cc +++ b/tests/executables_src/testExceptionHandling.cc @@ -9,7 +9,7 @@ #include <ChimeraTK/Device.h> #include <ChimeraTK/NDRegisterAccessor.h> #include <ChimeraTK/DummyRegisterAccessor.h> -#include <ChimeraTK/ExceptionDevice.h> +#include <ChimeraTK/ExceptionDummyBackend.h> #include "Application.h" #include "ApplicationModule.h" @@ -156,9 +156,9 @@ struct TestApplication2 : public ctk::Application { BOOST_AUTO_TEST_CASE(testExceptionHandlingRead) { std::cout << "testExceptionHandlingRead" << std::endl; TestApplication app; - boost::shared_ptr<ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); - boost::shared_ptr<ExceptionDummy> dummyBackend2 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend2 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD2)); ChimeraTK::DummyRegisterAccessor<int> readbackDummy1(dummyBackend1.get(), "MyModule", "readBack"); @@ -265,9 +265,9 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingRead) { BOOST_AUTO_TEST_CASE(testExceptionHandlingWrite) { std::cout << "testExceptionHandlingWrite" << std::endl; TestApplication app; - boost::shared_ptr<ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); - boost::shared_ptr<ExceptionDummy> dummyBackend2 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend2 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD2)); ChimeraTK::DummyRegisterAccessor<int> actuatorDummy1(dummyBackend1.get(), "MyModule", "actuator"); @@ -346,9 +346,9 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingWrite) { BOOST_AUTO_TEST_CASE(testExceptionHandlingOpen) { std::cout << "testExceptionHandlingOpen" << std::endl; TestApplication app; - boost::shared_ptr<ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); - boost::shared_ptr<ExceptionDummy> dummyBackend2 = boost::dynamic_pointer_cast<ExceptionDummy>( + boost::shared_ptr<ctk::ExceptionDummy> dummyBackend2 = boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD2)); ChimeraTK::DummyRegisterAccessor<int> readbackDummy1(dummyBackend1.get(), "MyModule", "readBack"); @@ -434,7 +434,7 @@ BOOST_AUTO_TEST_CASE(testConstants) { // Take back the value of the constant which was written to the device before making the device fail for further writes. dev.write<int32_t>("/MyModule/actuator", 0); auto dummyBackend = - boost::dynamic_pointer_cast<ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); + boost::dynamic_pointer_cast<ctk::ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); dummyBackend->throwExceptionWrite = true; auto pleaseWriteToMe = test.getScalar<int32_t>("/PleaseWriteToMe"); @@ -466,11 +466,11 @@ BOOST_AUTO_TEST_CASE(testShutdown) { static const uint32_t DEFAULT = 55; auto dummyBackend1 = - boost::dynamic_pointer_cast<ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); + boost::dynamic_pointer_cast<ctk::ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); auto dummyBackend2 = - boost::dynamic_pointer_cast<ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(ExceptionDummyCDD2)); + boost::dynamic_pointer_cast<ctk::ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(ExceptionDummyCDD2)); auto dummyBackend3 = - boost::dynamic_pointer_cast<ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(ExceptionDummyCDD3)); + boost::dynamic_pointer_cast<ctk::ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(ExceptionDummyCDD3)); // Test that the application does shut down with a broken device and blocking accessors TestApplication2 app; diff --git a/tests/executables_src/testProcessVariableRecovery.cc b/tests/executables_src/testProcessVariableRecovery.cc index 42b91d7071eef08b2107d08ad6a89726c94fb03d..5ed0b329da9d980dbceabf64fbd072fd7daa7775 100644 --- a/tests/executables_src/testProcessVariableRecovery.cc +++ b/tests/executables_src/testProcessVariableRecovery.cc @@ -10,7 +10,7 @@ #include "ArrayAccessor.h" #include "ConfigReader.h" -#include <ChimeraTK/ExceptionDevice.h> +#include <ChimeraTK/ExceptionDummyBackend.h> #include <ChimeraTK/Device.h> #include <stdlib.h> #include <regex> @@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE(testProcessVariableRecovery) { CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 1, 3)[0], 100, 10000); auto dummyBackend = - boost::dynamic_pointer_cast<ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(deviceCDD)); + boost::dynamic_pointer_cast<ctk::ExceptionDummy>(ctk::BackendFactory::getInstance().createBackend(deviceCDD)); //Set the device to throw. dummyBackend->throwExceptionOpen = true; diff --git a/tests/executables_src/testPropagateDataFaultFlag.cc b/tests/executables_src/testPropagateDataFaultFlag.cc index 3a25a444baf91d898403c099a2452233fda3adc3..578cbc0643635fd55920567d9978f4d11dc26a0d 100644 --- a/tests/executables_src/testPropagateDataFaultFlag.cc +++ b/tests/executables_src/testPropagateDataFaultFlag.cc @@ -19,7 +19,7 @@ #include "ModuleGroup.h" #include "check_timeout.h" -#include <ChimeraTK/ExceptionDevice.h> +#include <ChimeraTK/ExceptionDummyBackend.h> using namespace boost::unit_test_framework; namespace ctk = ChimeraTK; @@ -428,9 +428,9 @@ struct TestApplication3 : ctk::Application { struct Fixture_testFacility { Fixture_testFacility() - : device1DummyBackend(boost::dynamic_pointer_cast<ExceptionDummy>( + : device1DummyBackend(boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(TestApplication3::ExceptionDummyCDD1))), - device2DummyBackend(boost::dynamic_pointer_cast<ExceptionDummy>( + device2DummyBackend(boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(TestApplication3::ExceptionDummyCDD2))) { device1DummyBackend->open(); device2DummyBackend->open(); @@ -442,8 +442,8 @@ struct Fixture_testFacility { device2DummyBackend->throwExceptionWrite = false; } - boost::shared_ptr<ExceptionDummy> device1DummyBackend; - boost::shared_ptr<ExceptionDummy> device2DummyBackend; + boost::shared_ptr<ctk::ExceptionDummy> device1DummyBackend; + boost::shared_ptr<ctk::ExceptionDummy> device2DummyBackend; TestApplication3 app; ctk::TestFacility test; }; @@ -553,9 +553,9 @@ BOOST_AUTO_TEST_SUITE_END() struct Fixture_noTestableMode { Fixture_noTestableMode() - : device1DummyBackend(boost::dynamic_pointer_cast<ExceptionDummy>( + : device1DummyBackend(boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(TestApplication3::ExceptionDummyCDD1))), - device2DummyBackend(boost::dynamic_pointer_cast<ExceptionDummy>( + device2DummyBackend(boost::dynamic_pointer_cast<ctk::ExceptionDummy>( ChimeraTK::BackendFactory::getInstance().createBackend(TestApplication3::ExceptionDummyCDD2))) { device1DummyBackend->open(); device2DummyBackend->open(); @@ -577,8 +577,8 @@ struct Fixture_noTestableMode { device2DummyBackend->throwExceptionWrite = false; } - boost::shared_ptr<ExceptionDummy> device1DummyBackend; - boost::shared_ptr<ExceptionDummy> device2DummyBackend; + boost::shared_ptr<ctk::ExceptionDummy> device1DummyBackend; + boost::shared_ptr<ctk::ExceptionDummy> device2DummyBackend; TestApplication3 app; ctk::TestFacility test{false}; };