Skip to content
Snippets Groups Projects
Commit 0f5759b8 authored by vargheseg's avatar vargheseg
Browse files

DOOCS property names: no space at the end

Extra space at the end of a property name has been removed in the latest
version of doocs. These tests were modified to work with this change:
- testCSAdapterEqFct
- testDoocsPVFactory
parent 0613e406
No related branches found
No related tags found
No related merge requests found
...@@ -76,15 +76,15 @@ BOOST_AUTO_TEST_CASE(testCSAdapterEqFct) { ...@@ -76,15 +76,15 @@ BOOST_AUTO_TEST_CASE(testCSAdapterEqFct) {
} }
// note: doocs property names always have a space (and a comment which can // note: doocs property names always have a space (and a comment which can
// be empty, but the space is always there)" // be empty, but the space is always there)"
BOOST_REQUIRE(doocsProperties.find("TO_DEVICE.INT ") != doocsProperties.end()); BOOST_REQUIRE(doocsProperties.find("TO_DEVICE.INT") != doocsProperties.end());
BOOST_REQUIRE(doocsProperties.find("FROM_DEVICE.INT ") != doocsProperties.end()); BOOST_REQUIRE(doocsProperties.find("FROM_DEVICE.INT") != doocsProperties.end());
// write once and check // write once and check
set_doocs_value(*(doocsProperties["TO_DEVICE.INT "]), 13); set_doocs_value(*(doocsProperties["TO_DEVICE.INT"]), 13);
businessLogic.toDeviceInt->readNonBlocking(); businessLogic.toDeviceInt->readNonBlocking();
BOOST_CHECK_EQUAL(businessLogic.toDeviceInt->accessData(0), 13); BOOST_CHECK_EQUAL(businessLogic.toDeviceInt->accessData(0), 13);
// change and observe the change in the device // change and observe the change in the device
set_doocs_value(*(doocsProperties["TO_DEVICE.INT "]), 14); set_doocs_value(*(doocsProperties["TO_DEVICE.INT"]), 14);
businessLogic.toDeviceInt->readNonBlocking(); businessLogic.toDeviceInt->readNonBlocking();
BOOST_CHECK_EQUAL(businessLogic.toDeviceInt->accessData(0), 14); BOOST_CHECK_EQUAL(businessLogic.toDeviceInt->accessData(0), 14);
...@@ -92,12 +92,12 @@ BOOST_AUTO_TEST_CASE(testCSAdapterEqFct) { ...@@ -92,12 +92,12 @@ BOOST_AUTO_TEST_CASE(testCSAdapterEqFct) {
businessLogic.fromDeviceInt->accessData(0) = 12; businessLogic.fromDeviceInt->accessData(0) = 12;
businessLogic.fromDeviceInt->write(); businessLogic.fromDeviceInt->write();
updater->update(); updater->update();
BOOST_CHECK_EQUAL(doocsProperties["FROM_DEVICE.INT "]->value(), 12); BOOST_CHECK_EQUAL(doocsProperties["FROM_DEVICE.INT"]->value(), 12);
businessLogic.fromDeviceInt->accessData(0) = 15; businessLogic.fromDeviceInt->accessData(0) = 15;
businessLogic.fromDeviceInt->write(); businessLogic.fromDeviceInt->write();
updater->update(); updater->update();
BOOST_CHECK_EQUAL(doocsProperties["FROM_DEVICE.INT "]->value(), 15); BOOST_CHECK_EQUAL(doocsProperties["FROM_DEVICE.INT"]->value(), 15);
} }
BOOST_AUTO_TEST_CASE(testWithMapping) { BOOST_AUTO_TEST_CASE(testWithMapping) {
...@@ -128,9 +128,9 @@ BOOST_AUTO_TEST_CASE(testWithMapping) { ...@@ -128,9 +128,9 @@ BOOST_AUTO_TEST_CASE(testWithMapping) {
// both properties are called int, but are in different locations // both properties are called int, but are in different locations
D_int* doocsInt = dynamic_cast<D_int*>(toDeviceEqFct.getDoocsProperties()[0].get()); D_int* doocsInt = dynamic_cast<D_int*>(toDeviceEqFct.getDoocsProperties()[0].get());
BOOST_REQUIRE(std::string(doocsInt->property_name()) == "INT "); BOOST_REQUIRE(std::string(doocsInt->property_name()) == "INT");
doocsInt = dynamic_cast<D_int*>(fromDeviceEqFct.getDoocsProperties()[0].get()); doocsInt = dynamic_cast<D_int*>(fromDeviceEqFct.getDoocsProperties()[0].get());
BOOST_REQUIRE(std::string(doocsInt->property_name()) == "INT "); BOOST_REQUIRE(std::string(doocsInt->property_name()) == "INT");
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
...@@ -69,35 +69,35 @@ BOOST_AUTO_TEST_CASE(testAutoCreateScalars) { ...@@ -69,35 +69,35 @@ BOOST_AUTO_TEST_CASE(testAutoCreateScalars) {
// We insert check points with integers so we know where the algorithm kicks // We insert check points with integers so we know where the algorithm kicks
// out in case of an error. These checkpoints are always true. // out in case of an error. These checkpoints are always true.
testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("I/int32", "I", "int32"), factory, testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("I/int32", "I", "int32"), factory,
"int32 "); // DOOCS property names always have a space (and "int32");
// potentially some description)"
BOOST_CHECK(-32); BOOST_CHECK(-32);
testCreateProcessScalar<int32_t, D_int>( testCreateProcessScalar<int32_t, D_int>(
std::make_shared<AutoPropertyDescription>("U/uint32", "I", "uint32"), factory, "uint32 "); std::make_shared<AutoPropertyDescription>("U/uint32", "I", "uint32"), factory, "uint32");
BOOST_CHECK(32); BOOST_CHECK(32);
testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("I/int16", "I", "int16"), factory, testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("I/int16", "I", "int16"), factory,
"int16 "); // DOOCS property names always have a space (and "int16");
// potentially some description)"
BOOST_CHECK(-16); BOOST_CHECK(-16);
testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("U/uint16", "I", "uint16"), factory, testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("U/uint16", "I", "uint16"), factory,
"uint16 "); // DOOCS property names always have a space (and "uint16");
// potentially some description)"
BOOST_CHECK(16); BOOST_CHECK(16);
testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("I/int8", "I", "int8"), factory, testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("I/int8", "I", "int8"), factory,
"int8 "); // DOOCS property names always have a space (and potentially "int8");
// some description)"
BOOST_CHECK(-8); BOOST_CHECK(-8);
testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("U/uint8", "I", "uint8"), factory, testCreateProcessScalar<int32_t, D_int>(std::make_shared<AutoPropertyDescription>("U/uint8", "I", "uint8"), factory,
"uint8 "); // DOOCS property names always have a space (and "uint8");
// potentially some description)"
BOOST_CHECK(8); BOOST_CHECK(8);
testCreateProcessScalar<float, D_float>(std::make_shared<AutoPropertyDescription>("FP/float", "FP", "float"), factory, testCreateProcessScalar<float, D_float>(std::make_shared<AutoPropertyDescription>("FP/float", "FP", "float"), factory,
"float "); // DOOCS property names always have a space (and "float");
// potentially some description)"
BOOST_CHECK(0.5); BOOST_CHECK(0.5);
testCreateProcessScalar<double, D_double>(std::make_shared<AutoPropertyDescription>("FP/double", "FP", "double"), testCreateProcessScalar<double, D_double>(std::make_shared<AutoPropertyDescription>("FP/double", "FP", "double"),
factory, "double "); // DOOCS property names always have a space (and factory, "double");
// potentially some description)"
BOOST_CHECK(32); BOOST_CHECK(32);
} }
......
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