Skip to content
Snippets Groups Projects
Commit 2881a9e9 authored by Jens Georg's avatar Jens Georg
Browse files

Revert "Fix AllParameters test after CSA API change"

This reverts commit 4fc4cf3b.
parent 6a01d8b0
No related branches found
No related tags found
No related merge requests found
......@@ -39,14 +39,13 @@ BOOST_FIXTURE_TEST_CASE(testControlSystemVariables, Fixture_t) {
auto pvManager = testFacility.getPvManager();
for(auto& params : descriptors) {
std::cout << "Testing parameter " << params.pvName << std::endl;
if(not params.readGroup.empty()) readGroups.insert(params.readGroup);
if(not params.writeGroup.empty()) writeGroups.insert(params.writeGroup);
if(not params.writeToFlashGroup.empty()) writeToFlashGroups.insert(params.writeToFlashGroup);
// This variable has to exist
BOOST_CHECK_NO_THROW(pvManager->getProcessVariable("/TecModule/" + params.pvName + "_rd"));
auto pv = pvManager->getProcessVariable("/TecModule/" + params.pvName + "_rd");
BOOST_CHECK(pv != nullptr);
BOOST_CHECK(pv->isReadOnly());
if(params.valueType == ValueType::Int)
BOOST_CHECK_MESSAGE(pv->getValueType() == typeid(int), "Check if _rd valueType is integer");
......@@ -57,18 +56,18 @@ BOOST_FIXTURE_TEST_CASE(testControlSystemVariables, Fixture_t) {
// if this variable exists, it has to be
pv = pvManager->getProcessVariable("/TecModule/" + params.pvName + "_enaPeriodicRead");
if (pv != nullptr) {
try {
pv = pvManager->getProcessVariable("/TecModule/" + params.pvName + "_enaPeriodicRead");
BOOST_CHECK(pv->isWriteable());
BOOST_CHECK_MESSAGE(pv->getValueType() == typeid(int32_t), "Check if _enaPeriodicRead valueType is int32_t");
BOOST_CHECK(params.direction == Direction::Read);
} else {
} catch(ChimeraTK::logic_error&) {
// If this variable does not exist, the parameter has to be read-only
BOOST_CHECK(params.direction == Direction::ReadWrite);
}
pv = pvManager->getProcessVariable("/TecModule/" + params.pvName + "_wr");
if (pv != nullptr){
try {
pv = pvManager->getProcessVariable("/TecModule/" + params.pvName + "_wr");
BOOST_CHECK(params.direction == Direction::ReadWrite);
BOOST_CHECK(pv->isWriteable());
if(params.valueType == ValueType::Int)
......@@ -78,7 +77,7 @@ BOOST_FIXTURE_TEST_CASE(testControlSystemVariables, Fixture_t) {
else
BOOST_ASSERT(false);
}
else {
catch(ChimeraTK::logic_error&) {
// If this variable does not exist, the parameter has to be read-only
BOOST_CHECK(params.direction == Direction::Read);
}
......@@ -87,8 +86,8 @@ BOOST_FIXTURE_TEST_CASE(testControlSystemVariables, Fixture_t) {
// Check if the group accessors exist
for(auto& group : {readGroups, writeGroups, writeToFlashGroups}) {
for(auto& entry : group) {
BOOST_REQUIRE_NO_THROW(pvManager->getProcessVariable("/TecModule/" + entry + "_wr"));
auto pv = pvManager->getProcessVariable("/TecModule/" + entry + "_wr");
BOOST_REQUIRE(pv != nullptr);
BOOST_CHECK(pv->isWriteable());
}
}
......
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