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

wip #129: fix test after slight behavior change

Initially, devices are closed and hence there is an error message. It goes away shortly when the device got opened. The new behavior is according to specification.
parent 1db8fb22
No related branches found
No related tags found
No related merge requests found
......@@ -193,14 +193,25 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingRead) {
dev1.write<int>("MyModule/readBack.DUMMY_WRITEABLE", 42);
dev2.write<int>("MyModule/readBack.DUMMY_WRITEABLE", 52);
// initially there should be no error set
// initially, devices are not opened but errors should be cleared once they are opened
trigger.write();
do {
message1.readLatest();
status1.readLatest();
} while(status1 != 0 || std::string(message1) != "");
BOOST_CHECK(!message1.readLatest());
BOOST_CHECK(!status1.readLatest());
do {
message2.readLatest();
status2.readLatest();
} while(status2 != 0 || std::string(message2) != "");
BOOST_CHECK(!message2.readLatest());
BOOST_CHECK(!status2.readLatest());
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);
BOOST_CHECK_EQUAL(readback2, 52);
......@@ -295,7 +306,21 @@ BOOST_AUTO_TEST_CASE(testExceptionHandlingWrite) {
auto trigger = test.getScalar<int>("trigger");
// initially there should be no error set
// initially, devices are not opened but errors should be cleared once they are opened
do {
message1.readLatest();
status1.readLatest();
} while(status1 != 0 || std::string(message1) != "");
BOOST_CHECK(!message1.readLatest());
BOOST_CHECK(!status1.readLatest());
do {
message2.readLatest();
status2.readLatest();
} while(status2 != 0 || std::string(message2) != "");
BOOST_CHECK(!message2.readLatest());
BOOST_CHECK(!status2.readLatest());
actuator1 = 29;
actuator1.write();
actuator2 = 39;
......
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