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

fix tests testing for content of exception what strings

It was agreed to never do this. What strings are for display only and should not be analysed, neither by tests nor by applications.
parent a80ebc2d
No related branches found
No related tags found
No related merge requests found
......@@ -223,8 +223,7 @@ BOOST_AUTO_TEST_CASE(testInitialisationException) {
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", 10000);
BOOST_CHECK(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / deviceCDD / "message") != "");
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(
......
......@@ -907,14 +907,12 @@ BOOST_AUTO_TEST_CASE(testShutdown) {
// wait for the error to be reported in the control system
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", 10000);
BOOST_CHECK(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD2 / "message") != "");
auto theInt = test.getScalar<int32_t>("/Device2/Integers/signed32");
theInt.write();
BOOST_CHECK(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD2 / "message") != "");
// 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", 10000);
// device 2 successfully broken!
......@@ -929,8 +927,7 @@ BOOST_AUTO_TEST_CASE(testShutdown) {
CHECK_EQUAL_TIMEOUT(
test.readScalar<int32_t>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD1 / "status"), 1, 10000);
// the write message does not have a \n, it is not going though a feeding fanout
CHECK_EQUAL_TIMEOUT(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD1 / "message"),
"DummyException: write throws by request", 10000);
BOOST_CHECK(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD1 / "message") != "");
auto triggerReadback = test.getScalar<int32_t>("/triggerReadback");
triggerReadback.write();
......@@ -946,8 +943,7 @@ BOOST_AUTO_TEST_CASE(testShutdown) {
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", 10000);
BOOST_CHECK(test.readScalar<std::string>(ctk::RegisterPath("/Devices") / ExceptionDummyCDD3 / "message") != "");
auto reg4 = test.getScalar<int32_t>("/Device3/MODULE/REG4");
reg4.write();
......
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