From d0b6f391192e0d3fe9b02e2e96cf01325e866da9 Mon Sep 17 00:00:00 2001 From: Martin Killenberg <martin.killenberg@desy.de> Date: Mon, 4 Sep 2017 16:31:02 +0200 Subject: [PATCH] server based test for global writeable flag. all 'positive' tests moved from testVariableMapper to server based now. Errorhandling stays extra for the moment. --- ...TurnOnOffWriteable-DoocsVariableConfig.xml | 21 +++++++ tests/serverTestGlobalTurnOnOffWriteable.conf | 57 +++++++++++++++++++ tests/src/testVariableMapper.cpp | 10 ---- 3 files changed, 78 insertions(+), 10 deletions(-) create mode 100644 tests/serverTestGlobalTurnOnOffWriteable-DoocsVariableConfig.xml create mode 100644 tests/serverTestGlobalTurnOnOffWriteable.conf diff --git a/tests/serverTestGlobalTurnOnOffWriteable-DoocsVariableConfig.xml b/tests/serverTestGlobalTurnOnOffWriteable-DoocsVariableConfig.xml new file mode 100644 index 0000000..9cae78a --- /dev/null +++ b/tests/serverTestGlobalTurnOnOffWriteable-DoocsVariableConfig.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<device_server xmlns="https://github.com/ChimeraTK/ControlSystemAdapter-DoocsAdapter"> + <is_writeable>false</is_writeable> + <location name="DOUBLE"> + <is_writeable>true</is_writeable> + <property source="TO_DEVICE_SCALAR"> + <is_writeable>false</is_writeable> + </property> + <!-- to test that it picks up the default when explicitly mentioned as property--> + <property source="/DOUBLE/TO_DEVICE_ARRAY" name="TO_DEVICE_ARRAY"/> + <!-- to test that it picks up the default when being imported--> + <import>/DOUBLE</import> + </location> + <location name="FLOAT"> + <property source="TO_DEVICE_ARRAY"> + <is_writeable>true</is_writeable> + </property> + <import>/FLOAT</import> + </location> + <import>/</import> +</device_server> diff --git a/tests/serverTestGlobalTurnOnOffWriteable.conf b/tests/serverTestGlobalTurnOnOffWriteable.conf new file mode 100644 index 0000000..199b41e --- /dev/null +++ b/tests/serverTestGlobalTurnOnOffWriteable.conf @@ -0,0 +1,57 @@ +eq_conf: + +oper_uid: -1 +oper_gid: 405 +xpert_uid: 1000 +xpert_gid: 1000 +ring_buffer: 10000 +memory_buffer: 500 + +eq_fct_name: "GLOBAL_ON_OFF_WRITEABLE_TEST._SVR" +eq_fct_type: 1 +{ +SVR.RPC_NUMBER: 610498009 +SVR.NAME: "GLOBAL_ON_OFF_WRITEABLE_TEST._SVR" +SVR.RATE: 57005 48879 0 0 +SVR.BPN: 6000 +} +eq_fct_name: "INT" +eq_fct_type: 10 +{ +NAME: "INT" +} +eq_fct_name: "SHORT" +eq_fct_type: 10 +{ +NAME: "SHORT" +} +eq_fct_name: "FLOAT" +eq_fct_type: 10 +{ +NAME: "FLOAT" +} +eq_fct_name: "DOUBLE" +eq_fct_type: 10 +{ +NAME: "DOUBLE" +} +eq_fct_name: "UINT" +eq_fct_type: 10 +{ +NAME: "UINT" +} +eq_fct_name: "USHORT" +eq_fct_type: 10 +{ +NAME: "USHORT" +} +eq_fct_name: "CHAR" +eq_fct_type: 10 +{ +NAME: "CHAR" +} +eq_fct_name: "UCHAR" +eq_fct_type: 10 +{ +NAME: "UCHAR" +} diff --git a/tests/src/testVariableMapper.cpp b/tests/src/testVariableMapper.cpp index 2faf89f..b39920f 100644 --- a/tests/src/testVariableMapper.cpp +++ b/tests/src/testVariableMapper.cpp @@ -177,16 +177,6 @@ BOOST_AUTO_TEST_CASE( testUnkownLocationNode ){ } } -BOOST_AUTO_TEST_CASE( testLocationTurnOffOn ){ - testXmlParsing("variableTreeXml/locationTurnOffOn.xml", { {"/A/a/di", {"/A/a/di","DUMMY_LOCATION","a.di",false}}, - {"/A/a/do", {"/A/a/do","DUMMY_LOCATION","A.a.do",true}}, - {"/A/b", {"/A/b","DUMMY_LOCATION","b",false}}, - {"/B/a/dr", {"/B/a/dr","ANOTHER_LOCATION","a.dr",true, false}}, - {"/B/c/de", {"/B/c/de","ANOTHER_LOCATION","c.de",true, false}}, - {"/B/c/gne", {"/B/c/gne","ANOTHER_LOCATION","WRITE_ME"}}, - }); -} - BOOST_AUTO_TEST_CASE( testGlobalTurnOffOnHistory ){ testXmlParsing("variableTreeXml/globalTurnOnOffHistory.xml", { {"/A/a/di", {"/A/a/di","DUMMY_LOCATION","a.di",true}}, -- GitLab