Skip to content
Snippets Groups Projects
Commit 7a5f7810 authored by Jens Georg's avatar Jens Georg Committed by Martin Christoph Hierholzer
Browse files

Fix missing bits of testDeviceAccessors

parent d3e9374d
No related branches found
No related tags found
No related merge requests found
......@@ -159,15 +159,17 @@ BOOST_AUTO_TEST_CASE(testConsumeFromDevice) {
app.testModule.consumingPoll = {&app.testModule, "/MyModule/readBack", "MV/m", ""};
ctk::TestFacility test{app};
// Set the default value through the CS. The actuator and readBack map to the same register in the map file
// Not setting a default will overwrite whatever is put into the device before the TestFacility::runApplication()
// So we feed the default for the register through the IV mechanism of TestFacility.
test.setScalarDefault<int>("/MyModule/actuator", 1);
test.runApplication();
ChimeraTK::Device dev;
dev.open("Dummy0");
auto regacc = dev.getScalarRegisterAccessor<int>("/MyModule/readBack.DUMMY_WRITEABLE");
regacc = 1; // write initial value which should be present in accessor after app start
regacc.write();
test.runApplication();
BOOST_REQUIRE(app.testModule.hasReachedTestableMode());
BOOST_CHECK(app.testModule.consumingPoll == 1);
......@@ -207,15 +209,17 @@ BOOST_AUTO_TEST_CASE(testConsumingFanOut) {
app.testModule.consumingPush2 = {&app.testModule, "/MyModule/readBack", "MV/m", ""};
ctk::TestFacility test{app};
// Set the default value through the CS. The actuator and readBack map to the same register in the map file
// Not setting a default will overwrite whatever is put into the device before the TestFacility::runApplication()
// So we feed the default for the register through the IV mechanism of TestFacility.
test.setScalarDefault<int>("/MyModule/actuator", 1);
ChimeraTK::Device dev;
dev.open("Dummy0");
auto regacc = dev.getScalarRegisterAccessor<int>("/MyModule/readBack.DUMMY_WRITEABLE");
regacc = 1; // write initial value which should be present in accessor after app start
regacc.write();
test.runApplication();
// single threaded test only, since read() does not block in this case
BOOST_CHECK(app.testModule.consumingPoll == 1);
BOOST_CHECK(app.testModule.consumingPush2 == 1);
......
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