Skip to content
Snippets Groups Projects
Commit 17b1a5ef authored by vargheseg's avatar vargheseg
Browse files

testcase stubs: testExceptionHandling

parent 1e69e6a9
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ namespace ChimeraTK { ...@@ -40,7 +40,7 @@ namespace ChimeraTK {
\subsection spec_exceptionHandling_behaviour_runtime_errors Runtime error handling \subsection spec_exceptionHandling_behaviour_runtime_errors Runtime error handling
- \anchor b_2 2. When a ChimeraTK::runtime_error has been received by the framework (thrown by a device register accessor): - \anchor b_2 2. When a ChimeraTK::runtime_error has been received by the framework (thrown by a device register accessor):
- 2.1 The exception status is published as a process variable together with an error message. - \anchor exceptionHandling_b_2_1 2.1 The exception status is published as a process variable together with an error message. [\ref testExceptionHandling_b_2_1 "T"]
- 2.1.1 The variable \c Devices/\<alias\>/status contains a boolean flag whether the device is in an error state. - 2.1.1 The variable \c Devices/\<alias\>/status contains a boolean flag whether the device is in an error state.
- 2.1.2 The variable \c Devices/\<alias\>/message contains an error message, if the device is in an error state, or an empty string otherwise. - 2.1.2 The variable \c Devices/\<alias\>/message contains an error message, if the device is in an error state, or an empty string otherwise.
- \anchor b_2_2 2.2 Read operations will propagate the DataValidity::faulty flag to the owning module / fan out (without changing the actual data value of the process variable): - \anchor b_2_2 2.2 Read operations will propagate the DataValidity::faulty flag to the owning module / fan out (without changing the actual data value of the process variable):
......
...@@ -21,6 +21,43 @@ ...@@ -21,6 +21,43 @@
using namespace boost::unit_test_framework; using namespace boost::unit_test_framework;
namespace ctk = ChimeraTK; namespace ctk = ChimeraTK;
/*
* This test suite checks behavior on a device related runtime error.
*/
BOOST_AUTO_TEST_SUITE(checkRuntimeErrorHandling)
/*
* Verify the framework creates fault indicator process variables for a device.
*
* These are mapped on the control system as:
* - /Devices/<device_alias or cdd>/status
* - /Devices/<device_alias or cdd>/message
*
* A runtime errror on <device_alias> changes status to 1, with a non empty message
* string.
*
* \anchor testExceptionHandling_b_2_1 \ref exceptionHandling_b_2_1 "B.2.1"
*/
BOOST_FIXTURE_TEST_CASE(testFaultReporting) {}
BOOST_AUTO_TEST_CASE(testBlockingRead) { // wait_for_new_data
// how does the api of the accessor look like
//device1DummyBackend["m1"]("i3")[cs("trigger", typeid(int), 1)] >> cs("i3", typeid(int), 1);
// make one with wait_for_new_data
// The framework decides the accessmode flags based on how the wiring looks like:
//
// we will have to make up wiring to get what we desire.
}
BOOST_AUTO_TEST_CASE(testReadLatest) {}
BOOST_AUTO_TEST_CASE(testReadNonBlocking) {}
BOOST_AUTO_TEST_CASE(testWrite) {}
BOOST_AUTO_TEST_SUITE_END()
constexpr char ExceptionDummyCDD1[] = "(ExceptionDummy:1?map=test3.map)"; constexpr char ExceptionDummyCDD1[] = "(ExceptionDummy:1?map=test3.map)";
constexpr char ExceptionDummyCDD2[] = "(ExceptionDummy:2?map=test3.map)"; constexpr char ExceptionDummyCDD2[] = "(ExceptionDummy:2?map=test3.map)";
constexpr char ExceptionDummyCDD3[] = "(ExceptionDummy:3?map=test4.map)"; constexpr char ExceptionDummyCDD3[] = "(ExceptionDummy:3?map=test4.map)";
......
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