diff --git a/tests/executables_src/testDeviceAccessors.cc b/tests/executables_src/testDeviceAccessors.cc index d2410e70c2f7fa68a43b3c7e20f850278fe88c37..825d33f587755567dda19da956e2d5288c5870c3 100644 --- a/tests/executables_src/testDeviceAccessors.cc +++ b/tests/executables_src/testDeviceAccessors.cc @@ -352,7 +352,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testConstantToDevice, T, test_types) { ChimeraTK::Device dev; dev.open("Dummy0"); - CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 18, 3000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 18, 10000); } /*********************************************************************************************************************/ @@ -372,8 +372,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testConstantToDeviceFanOut, T, test_types) { ChimeraTK::Device dev; dev.open("Dummy0"); - CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 20, 3000); - CHECK_TIMEOUT(dev.read<T>("/MyModule/readBack") == 20, 3000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 20, 10000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/readBack") == 20, 10000); } /*********************************************************************************************************************/ diff --git a/tests/executables_src/testDeviceExceptionFlagPropagation.cc b/tests/executables_src/testDeviceExceptionFlagPropagation.cc index 7f2be900246c4faff52ccaf205d4b6b517771668..d06ef1674aa2b49ad0bf03f20c34528d771ea1e1 100644 --- a/tests/executables_src/testDeviceExceptionFlagPropagation.cc +++ b/tests/executables_src/testDeviceExceptionFlagPropagation.cc @@ -95,20 +95,19 @@ struct TestApplication : ctk::Application { }; BOOST_AUTO_TEST_CASE(testDirectConnectOpen) { - - for (int readMode = 0; readMode < 3; ++readMode) { + for(int readMode = 0; readMode < 3; ++readMode) { TestApplication app; boost::shared_ptr<ExceptionDummy> dummyBackend1 = boost::dynamic_pointer_cast<ExceptionDummy>( - ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); + ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1)); - app.dev("/MyModule/readBack", typeid (int), 1) >> app.module.vars.read; - app.module.vars.set >> app.dev("/MyModule/actuator", typeid (int), 1); + app.dev("/MyModule/readBack", typeid(int), 1) >> app.module.vars.read; + app.module.vars.set >> app.dev("/MyModule/actuator", typeid(int), 1); app.name.name.tick >> app.module.vars.tick; // Open and put device in an error state dummyBackend1->throwExceptionOpen = true; ctk::TestFacility test(false); - CHECK_TIMEOUT(app.module.vars.read.dataValidity() == ctk::DataValidity::ok, 1000); + CHECK_TIMEOUT(app.module.vars.read.dataValidity() == ctk::DataValidity::ok, 10000); // set the read mode app.module.readMode = readMode; @@ -116,14 +115,13 @@ BOOST_AUTO_TEST_CASE(testDirectConnectOpen) { app.run(); // Trigger and check - app.name.name.tick.write(); - CHECK_TIMEOUT(app.module.vars.read.dataValidity() == ctk::DataValidity::faulty, 1000); - + app.name.name.tick.write(); + CHECK_TIMEOUT(app.module.vars.read.dataValidity() == ctk::DataValidity::faulty, 10000); + // recover from error state dummyBackend1->throwExceptionOpen = false; - CHECK_TIMEOUT(app.module.vars.read.dataValidity() == ctk::DataValidity::ok, 1000); + CHECK_TIMEOUT(app.module.vars.read.dataValidity() == ctk::DataValidity::ok, 10000); } - } BOOST_AUTO_TEST_CASE(testDirectConnectRead) { diff --git a/tests/executables_src/testDeviceInitialisationHandler.cc b/tests/executables_src/testDeviceInitialisationHandler.cc index a09a50ffe038ce54e1a352943804e59e0fc462b4..b76e93e6c25162e8e989863efed3f77353258a1e 100644 --- a/tests/executables_src/testDeviceInitialisationHandler.cc +++ b/tests/executables_src/testDeviceInitialisationHandler.cc @@ -201,7 +201,7 @@ BOOST_AUTO_TEST_CASE(testInitialisationException) { CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 1, 30000); CHECK_EQUAL_TIMEOUT( - test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), exceptionMessage, 3000); + test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), exceptionMessage, 10000); // Check that the execution of init handlers was stopped after the exception: // initialiseReg2 and initialiseReg3 were not executed. As we already checked with timeout that the @@ -225,8 +225,8 @@ BOOST_AUTO_TEST_CASE(testInitialisationException) { // wait until the device is reported to be OK again (chech with timeout), // then check the initialisation (again, no extra timeout needed because of the logic: // success is only reported after successful init). - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 0, 3000); - CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), "", 3000); + CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 0, 10000); + CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), "", 10000); // initialisation should be correct now reg1.readLatest(); @@ -256,20 +256,20 @@ BOOST_AUTO_TEST_CASE(testInitialisationException) { reg4_cs = 20; reg4_cs.write(); - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 1, 3000); + CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 1, 10000); // First we see the message from the failing write CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), - "DummyException: write throws by request", 3000); + "DummyException: write throws by request", 10000); dummyBackend->throwExceptionWrite = false; // Afterwards we see a message from the failing initialisation (which we can now distinguish from the original write exception because write does not throw any more) CHECK_EQUAL_TIMEOUT( - test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), exceptionMessage, 3000); + test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), exceptionMessage, 10000); // Now fix the initialisation error and check that the device comes up. throwInInitialisation = false; // Wait until the device is OK again - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 0, 3000); - CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), "", 3000); + CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 0, 10000); + CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message"), "", 10000); // Finally check that the 20 arrives on the device - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/REG4"), 20, 3000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/REG4"), 20, 10000); } diff --git a/tests/executables_src/testDirectDeviceToCS.cc b/tests/executables_src/testDirectDeviceToCS.cc index 23ded394063ffc853b83920fd23b029940b03285..ab64124d4d8ba8feae818c695205d95d6e5bfa07 100644 --- a/tests/executables_src/testDirectDeviceToCS.cc +++ b/tests/executables_src/testDirectDeviceToCS.cc @@ -141,11 +141,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testDirectCStoDev, T, test_types) { myFeeder->accessData(0) = 18; myFeeder->write(); - CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 18, 3000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 18, 10000); myFeeder->accessData(0) = 20; myFeeder->write(); - CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 20, 3000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 20, 10000); } /*********************************************************************************************************************/ @@ -171,13 +171,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testDirectCStoDevFanOut, T, test_types) { myFeeder->accessData(0) = 18; myFeeder->write(); - CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 18, 3000); - CHECK_TIMEOUT(dev.read<T>("/MyModule/readBack") == 18, 3000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 18, 10000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/readBack") == 18, 10000); myFeeder->accessData(0) = 20; myFeeder->write(); - CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 20, 3000); - CHECK_TIMEOUT(dev.read<T>("/MyModule/readBack") == 20, 3000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/actuator") == 20, 10000); + CHECK_TIMEOUT(dev.read<T>("/MyModule/readBack") == 20, 10000); } /*********************************************************************************************************************/ diff --git a/tests/executables_src/testExceptionHandling.cc b/tests/executables_src/testExceptionHandling.cc index f591c74290f816f031621793b6a3501ca65c7bc2..590ea7fb8f8eeec67aa61b57ba7c9185199f3441 100644 --- a/tests/executables_src/testExceptionHandling.cc +++ b/tests/executables_src/testExceptionHandling.cc @@ -161,8 +161,8 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingRead) { trigger.write(); BOOST_CHECK(!message1.readLatest()); BOOST_CHECK(!status1.readLatest()); - CHECK_TIMEOUT(readback1.readLatest(), 1000); - CHECK_TIMEOUT(readback2.readLatest(), 1000); + CHECK_TIMEOUT(readback1.readLatest(), 10000); + CHECK_TIMEOUT(readback2.readLatest(), 10000); BOOST_CHECK(static_cast<std::string>(message1) == ""); BOOST_CHECK(status1 == 0); BOOST_CHECK_EQUAL(readback1, 42); @@ -175,8 +175,8 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingRead) { readbackDummy2 = 20 + i; dummyBackend1->throwExceptionRead = true; trigger.write(); - CHECK_TIMEOUT(message1.readLatest(), 1000); - CHECK_TIMEOUT(status1.readLatest(), 1000); + CHECK_TIMEOUT(message1.readLatest(), 10000); + CHECK_TIMEOUT(status1.readLatest(), 10000); BOOST_CHECK(static_cast<std::string>(message1) != ""); BOOST_CHECK_EQUAL(status1, 1); BOOST_CHECK(readback1.readNonBlocking()); // we have been signalized new data @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingRead) { // the second device must still be functional BOOST_CHECK(!message2.readNonBlocking()); BOOST_CHECK(!status2.readNonBlocking()); - CHECK_TIMEOUT(readback2.readNonBlocking(), 1000); // device 2 still works + CHECK_TIMEOUT(readback2.readNonBlocking(), 10000); // device 2 still works BOOST_CHECK_EQUAL(readback2, 20 + i); // even with device 1 failing the second one must process the data, so send a new trigger @@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingRead) { trigger.write(); BOOST_CHECK(!readback1.readNonBlocking()); // we should not have gotten any new data BOOST_CHECK(readback1.dataValidity() == ChimeraTK::DataValidity::faulty); // But the fault flag should still be set - CHECK_TIMEOUT(readback2.readNonBlocking(), 1000); // device 2 still works + CHECK_TIMEOUT(readback2.readNonBlocking(), 10000); // device 2 still works BOOST_CHECK_EQUAL(readback2, 120 + i); // Now "cure" the device problem @@ -201,24 +201,24 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingRead) { readbackDummy2 = 40 + i; dummyBackend1->throwExceptionRead = false; trigger.write(); - CHECK_TIMEOUT(message1.readLatest(), 1000); - CHECK_TIMEOUT(status1.readLatest(), 1000); - CHECK_TIMEOUT(readback1.readNonBlocking(), 1000); + CHECK_TIMEOUT(message1.readLatest(), 10000); + CHECK_TIMEOUT(status1.readLatest(), 10000); + CHECK_TIMEOUT(readback1.readNonBlocking(), 10000); BOOST_CHECK_EQUAL(static_cast<std::string>(message1), ""); BOOST_CHECK_EQUAL(status1, 0); BOOST_CHECK_EQUAL(readback1, 30 + i); BOOST_CHECK(readback1.dataValidity() == ChimeraTK::DataValidity::ok); // The fault flag should have been cleared // there are two more copies in the queue, since the two triggers received during the error state is still // processed after recovery - CHECK_TIMEOUT(readback1.readNonBlocking(), 1000); + CHECK_TIMEOUT(readback1.readNonBlocking(), 10000); BOOST_CHECK_EQUAL(readback1, 30 + i); - CHECK_TIMEOUT(readback1.readNonBlocking(), 1000); + CHECK_TIMEOUT(readback1.readNonBlocking(), 10000); BOOST_CHECK_EQUAL(readback1, 30 + i); BOOST_CHECK(!readback1.readNonBlocking()); // now the queue should be empty // device2 BOOST_CHECK(!message2.readNonBlocking()); BOOST_CHECK(!status2.readNonBlocking()); - CHECK_TIMEOUT(readback2.readNonBlocking(), 1000); // device 2 still works + CHECK_TIMEOUT(readback2.readNonBlocking(), 10000); // device 2 still works BOOST_CHECK_EQUAL(readback2, 40 + i); } } @@ -266,8 +266,8 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingWrite) { actuator2.write(); BOOST_CHECK(!message1.readLatest()); BOOST_CHECK(!status1.readLatest()); - CHECK_TIMEOUT(actuatorDummy1 == 29, 1000); - CHECK_TIMEOUT(actuatorDummy2 == 39, 1000); + CHECK_TIMEOUT(actuatorDummy1 == 29, 10000); + CHECK_TIMEOUT(actuatorDummy2 == 39, 10000); BOOST_CHECK(static_cast<std::string>(message1) == ""); BOOST_CHECK(status1 == 0); @@ -279,8 +279,8 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingWrite) { actuator1.write(); actuator2 = 40 + i; actuator2.write(); - CHECK_TIMEOUT(message1.readLatest(), 1000); - CHECK_TIMEOUT(status1.readLatest(), 1000); + CHECK_TIMEOUT(message1.readLatest(), 10000); + CHECK_TIMEOUT(status1.readLatest(), 10000); BOOST_CHECK(static_cast<std::string>(message1) != ""); BOOST_CHECK_EQUAL(status1, 1); usleep(10000); // 10ms wait time so potential wrong values could have propagated @@ -288,18 +288,18 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingWrite) { // the second device must still be functional BOOST_CHECK(!message2.readNonBlocking()); BOOST_CHECK(!status2.readNonBlocking()); - CHECK_TIMEOUT(actuatorDummy2 == int(40 + i), 1000); // device 2 still works + CHECK_TIMEOUT(actuatorDummy2 == int(40 + i), 10000); // device 2 still works // even with device 1 failing the second one must process the data, so send a new data before fixing dev1 actuator2 = 120 + i; actuator2.write(); - CHECK_TIMEOUT(actuatorDummy2 == int(120 + i), 1000); // device 2 still works + CHECK_TIMEOUT(actuatorDummy2 == int(120 + i), 10000); // device 2 still works // Now "cure" the device problem dummyBackend1->throwExceptionWrite = false; - CHECK_TIMEOUT(message1.readLatest(), 1000); - CHECK_TIMEOUT(status1.readLatest(), 1000); - CHECK_TIMEOUT(actuatorDummy1 == int(30 + i), 1000); // write is now complete + CHECK_TIMEOUT(message1.readLatest(), 10000); + CHECK_TIMEOUT(status1.readLatest(), 10000); + CHECK_TIMEOUT(actuatorDummy1 == int(30 + i), 10000); // write is now complete BOOST_CHECK_EQUAL(static_cast<std::string>(message1), ""); BOOST_CHECK_EQUAL(status1, 0); } @@ -345,30 +345,30 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingOpen) { readbackDummy2 = 110; trigger.write(); //device 1 is in Error state - CHECK_TIMEOUT(message1.readLatest(), 1000); - CHECK_TIMEOUT(status1.readLatest(), 1000); + CHECK_TIMEOUT(message1.readLatest(), 10000); + CHECK_TIMEOUT(status1.readLatest(), 10000); BOOST_CHECK_EQUAL(status1, 1); BOOST_CHECK(!readback1.readNonBlocking()); - CHECK_TIMEOUT(readback2.readNonBlocking(), 1000); + CHECK_TIMEOUT(readback2.readNonBlocking(), 10000); BOOST_CHECK_EQUAL(readback2, 110); // even with device 1 failing the second one must process the data, so send a new trigger // before fixing dev1 readbackDummy2 = 120; trigger.write(); - CHECK_TIMEOUT(readback2.readNonBlocking(), 1000); // device 2 still works + CHECK_TIMEOUT(readback2.readNonBlocking(), 10000); // device 2 still works BOOST_CHECK_EQUAL(readback2, 120); //Device is not in error state. - CHECK_TIMEOUT(!message2.readLatest(), 1000); - CHECK_TIMEOUT(!status2.readLatest(), 1000); + CHECK_TIMEOUT(!message2.readLatest(), 10000); + CHECK_TIMEOUT(!status2.readLatest(), 10000); //fix device 1 dummyBackend1->throwExceptionOpen = false; //device 1 is fixed - CHECK_TIMEOUT(message1.readLatest(), 1000); - CHECK_TIMEOUT(status1.readLatest(), 1000); + CHECK_TIMEOUT(message1.readLatest(), 10000); + CHECK_TIMEOUT(status1.readLatest(), 10000); BOOST_CHECK_EQUAL(status1, 0); - CHECK_TIMEOUT(readback1.readNonBlocking(), 1000); + CHECK_TIMEOUT(readback1.readNonBlocking(), 10000); BOOST_CHECK_EQUAL(readback1, 100); } @@ -387,7 +387,7 @@ BOOST_AUTO_TEST_CASE(testConstants) { dev.open(ExceptionDummyCDD1); // after opening a device the runApplication() might return, but the initialisation might not have happened in the other thread yet. So check with timeout. - CHECK_TIMEOUT(dev.read<int32_t>("/MyModule/actuator") == 18, 3000); + CHECK_TIMEOUT(dev.read<int32_t>("/MyModule/actuator") == 18, 10000); // So far this is also tested by testDeviceAccessors. Now cause errors. // Take back the value of the constant which was written to the device before making the device fail for further writes. @@ -414,7 +414,7 @@ BOOST_AUTO_TEST_CASE(testConstants) { pleaseWriteToMe.write(); test.stepApplication(); - CHECK_TIMEOUT(dev.read<int32_t>("/MyModule/actuator") == 18, 3000); + CHECK_TIMEOUT(dev.read<int32_t>("/MyModule/actuator") == 18, 10000); } /// @todo FIXME: Write test that errors during constant writing are handled correctly, incl. correct error messages to the control system @@ -432,9 +432,12 @@ BOOST_AUTO_TEST_CASE(testShutdown) { //app.dumpConnections(); //Wait for the devices to come up. - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD1 / "status"), 0, 3000); - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD2 / "status"), 0, 3000); - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD3 / "status"), 0, 3000); + CHECK_EQUAL_TIMEOUT( + test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD1 / "status"), 0, 10000); + CHECK_EQUAL_TIMEOUT( + test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD2 / "status"), 0, 10000); + CHECK_EQUAL_TIMEOUT( + test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD3 / "status"), 0, 10000); // make all devices fail, and wait until they report the error state, one after another auto dummyBackend2 = @@ -447,15 +450,16 @@ BOOST_AUTO_TEST_CASE(testShutdown) { trigger2.write(); // triggers the read of readBack // wait for the error to be reported in the control system - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD2 / "status"), 1, 3000); + CHECK_EQUAL_TIMEOUT( + test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD2 / "status"), 1, 10000); CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD2 / "message"), - "DummyException: read throws by request", 3000); + "DummyException: read throws by request", 10000); auto theInt = test.getScalar<int32_t>("/Device2/Integers/signed32"); theInt.write(); // the read is the first error we see. The second one is not reported any more for this device. CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD2 / "message"), - "DummyException: read throws by request", 3000); + "DummyException: read throws by request", 10000); // device 2 successfully broken! @@ -469,9 +473,10 @@ BOOST_AUTO_TEST_CASE(testShutdown) { triggerActuator.write(); // wait for the error to be reported in the control system - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD1 / "status"), 1, 3000); + CHECK_EQUAL_TIMEOUT( + test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD1 / "status"), 1, 10000); CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD1 / "message"), - "DummyException: write throws by request", 3000); + "DummyException: write throws by request", 10000); auto triggerReadback = test.getScalar<int32_t>("/triggerReadback"); triggerReadback.write(); @@ -486,9 +491,10 @@ BOOST_AUTO_TEST_CASE(testShutdown) { auto triggerRealistic = test.getScalar<int32_t>("/triggerRealistic"); triggerRealistic.write(); - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD3 / "status"), 1, 3000); + CHECK_EQUAL_TIMEOUT( + test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD3 / "status"), 1, 10000); CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD3 / "message"), - "DummyException: read throws by request", 3000); + "DummyException: read throws by request", 10000); auto reg4 = test.getScalar<int32_t>("/Device3/MODULE/REG4"); reg4.write(); diff --git a/tests/executables_src/testProcessVariableRecovery.cc b/tests/executables_src/testProcessVariableRecovery.cc index 4478e6a77d97646a9b74a57c869efd14c34e515c..b5a75dcb245218a470bdf01ef1ddf29768e16260 100644 --- a/tests/executables_src/testProcessVariableRecovery.cc +++ b/tests/executables_src/testProcessVariableRecovery.cc @@ -127,7 +127,6 @@ BOOST_AUTO_TEST_CASE(testProcessVariableRecovery) { std::cout << "testProcessVariableRecovery" << std::endl; TestApplication app; - app.findTag(".*").connectTo(app.cs); // creates /TEST/TO_DEV_SCALAR1 and /TEST/TO/DEV/ARRAY1 // devices are not automatically connected (yet) app.dev.connectTo(app.cs, @@ -135,7 +134,7 @@ BOOST_AUTO_TEST_CASE(testProcessVariableRecovery) { 1)); // In TEST it connects to TO_DEV_SCALAR1 and TO_DEV_ARRAY1, and creates TO_DEV_SCALAR2, FROM_DEV1, FROM_DEV2, TO_DEV_AREA2, FROM_DEV_AREA1 and FROM_DEV_AREA2 // make a constant and connect to the device - auto constante = ctk::VariableNetworkNode::makeConstant(1,44252,1); + auto constante = ctk::VariableNetworkNode::makeConstant(1, 44252, 1); constante >> app.dev["CONSTANT"]("VAR32"); ctk::TestFacility test(false); @@ -151,24 +150,24 @@ BOOST_AUTO_TEST_CASE(testProcessVariableRecovery) { dummy.open(deviceCDD); //Check that the initial values are there. //auto reg2 = dummy.getScalarRegisterAccessor<int32_t>("/TEST/TO_DEV_SCALAR2"); - //CHECK_EQUAL_TIMEOUT([=]()mutable{reg2.readLatest(); return int32_t(reg2);},0,3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/CONSTANT/VAR32"), 44252, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_SCALAR2"), 42, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY2", 1, 0)[0], 99, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY2", 1, 1)[0], 99, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY2", 1, 2)[0], 99, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY2", 1, 3)[0], 99, 3000); + //CHECK_EQUAL_TIMEOUT([=]()mutable{reg2.readLatest(); return int32_t(reg2);},0,10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/CONSTANT/VAR32"), 44252, 10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_SCALAR2"), 42, 10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY2", 1, 0)[0], 99, 10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY2", 1, 1)[0], 99, 10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY2", 1, 2)[0], 99, 10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY2", 1, 3)[0], 99, 10000); //Update device register via application module. auto trigger = test.getScalar<int32_t>("/TEST/trigger"); trigger = 100; trigger.write(); //Check if the values are updated. - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_SCALAR1"), 100, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 1, 0)[0], 100, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 1, 1)[0], 100, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 1, 2)[0], 100, 3000); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 1, 3)[0], 100, 3000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_SCALAR1"), 100, 10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 1, 0)[0], 100, 10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 1, 1)[0], 100, 10000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 1, 2)[0], 100, 10000); + 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)); @@ -184,7 +183,7 @@ BOOST_AUTO_TEST_CASE(testProcessVariableRecovery) { dummy.write("/TEST/TO_DEV_ARRAY1", array); dummy.write("/TEST/TO_DEV_ARRAY2", array); - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/CONSTANT/VAR32"), 0, 3000); + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/CONSTANT/VAR32"), 0, 10000); dummyBackend->throwExceptionWrite = true; dummyBackend->throwExceptionRead = true; @@ -193,14 +192,14 @@ BOOST_AUTO_TEST_CASE(testProcessVariableRecovery) { trigger2.write(); //Verify that the device is in error state. - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 1, 5000); + CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 1, 10000); //Set device back to normal. dummyBackend->throwExceptionWrite = false; dummyBackend->throwExceptionRead = false; dummyBackend->throwExceptionOpen = false; //Verify if the device is ready. - CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 0, 3000); + CHECK_EQUAL_TIMEOUT(test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / deviceCDD / "status"), 0, 10000); //Device should have the correct values now. Notice that we did not trigger the writer module! BOOST_CHECK_EQUAL(dummy.read<int32_t>("/TEST/TO_DEV_SCALAR2"), 42); @@ -210,6 +209,5 @@ BOOST_AUTO_TEST_CASE(testProcessVariableRecovery) { BOOST_CHECK((dummy.read<int32_t>("/TEST/TO_DEV_ARRAY1", 0) == std::vector<int32_t>{100, 100, 100, 100})); // check if the constant is written back after recovery - CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/CONSTANT/VAR32"), 44252, 3000); - + CHECK_EQUAL_TIMEOUT(dummy.read<int32_t>("/CONSTANT/VAR32"), 44252, 10000); } diff --git a/tests/executables_src/testTestFacilities.cc b/tests/executables_src/testTestFacilities.cc index 91418af818ee893eca89bb3718976882ca30d786..b99a44edc642a4fc6685650cbc992d9f9ba41f0c 100644 --- a/tests/executables_src/testTestFacilities.cc +++ b/tests/executables_src/testTestFacilities.cc @@ -285,7 +285,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testBlockingRead, T, test_types) { usleep(10000); BOOST_CHECK(pvOutput.readNonBlocking() == false); test.stepApplication(); - CHECK_TIMEOUT(pvOutput.readNonBlocking() == true, 200); + CHECK_TIMEOUT(pvOutput.readNonBlocking() == true, 10000); int val = pvOutput; BOOST_CHECK(val == 120 + i); } @@ -914,7 +914,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testConvenienceRead, T, test_types) { for(int i = 0; i < 5; ++i) { test.writeScalar<T>("input", 120 + i); test.stepApplication(); - CHECK_TIMEOUT(test.readScalar<T>("output") == T(120 + i), 200); + CHECK_TIMEOUT(test.readScalar<T>("output") == T(120 + i), 10000); } // same with array function (still a scalar variable behind, but this does not @@ -923,7 +923,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testConvenienceRead, T, test_types) { std::vector<T> myValue{T(120 + i)}; test.writeArray<T>("input", myValue); test.stepApplication(); - CHECK_TIMEOUT(test.readArray<T>("output") == std::vector<T>{T(120 + i)}, 200); + CHECK_TIMEOUT(test.readArray<T>("output") == std::vector<T>{T(120 + i)}, 10000); } } diff --git a/tests/executables_src/testTrigger.cc b/tests/executables_src/testTrigger.cc index 329ece86e36b3aee0b99f667037092d721d05736..704d4a02d75d2417b0278e38b25684c5067b9192 100644 --- a/tests/executables_src/testTrigger.cc +++ b/tests/executables_src/testTrigger.cc @@ -308,7 +308,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testTriggerTransferGroup, T, test_types) { // trigger the transfer app.testModule.theTrigger.write(); - CHECK_TIMEOUT(backend->numberOfTransfers == 1, 200); + CHECK_TIMEOUT(backend->numberOfTransfers == 1, 10000); BOOST_CHECK(backend->last_bar == 0); BOOST_CHECK(backend->last_address == 0); BOOST_CHECK(backend->last_sizeInBytes == 12); @@ -328,7 +328,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(testTriggerTransferGroup, T, test_types) { // trigger the transfer app.testModule.theTrigger.write(); - CHECK_TIMEOUT(backend->numberOfTransfers == 2, 200); + CHECK_TIMEOUT(backend->numberOfTransfers == 2, 10000); BOOST_CHECK(backend->last_bar == 0); BOOST_CHECK(backend->last_address == 0); BOOST_CHECK(backend->last_sizeInBytes == 12);