Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ControlSystemAdapter-DoocsAdapter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChimeraTK Mirror
ControlSystemAdapter-DoocsAdapter
Commits
be33b21d
Commit
be33b21d
authored
7 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
successfully testing for history existence in server based test
parent
7dec4298
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/serverTestRenameImport-DoocsVariableConfig.xml
+1
-1
1 addition, 1 deletion
tests/serverTestRenameImport-DoocsVariableConfig.xml
tests/src/serverTestRenameImport.cpp
+38
-24
38 additions, 24 deletions
tests/src/serverTestRenameImport.cpp
with
39 additions
and
25 deletions
tests/serverTestRenameImport-DoocsVariableConfig.xml
+
1
−
1
View file @
be33b21d
...
...
@@ -41,7 +41,7 @@
<is_writeable>
true
</is_writeable>
</property>
<!-- all imported properties will have the history turned off -->
<import>
/U
SHORT
</import>
<import>
/U
CHAR
</import>
</location>
<location
name=
"DOUBLE"
>
...
...
This diff is collapsed.
Click to expand it.
tests/src/serverTestRenameImport.cpp
+
38
−
24
View file @
be33b21d
...
...
@@ -47,13 +47,10 @@ void checkDoocsProperty(std::string const & propertyAddress, bool expected_has_h
ad
.
adr
(
propertyAddress
.
c_str
());
EqFct
*
eqFct
=
eq_get
(
&
ad
);
BOOST_REQUIRE_MESSAGE
(
eqFct
,
"Could not get location for property "
+
propertyAddress
);
std
::
cout
<<
"propertyAddress "
<<
propertyAddress
<<
std
::
endl
;
auto
propertyName
=
basenameFromAddress
(
propertyAddress
);
std
::
cout
<<
"eqFct->find_property("
<<
propertyName
<<
") "
<<
eqFct
->
find_property
(
propertyName
)
<<
std
::
endl
;
// Note: try splitting the property name at the last slash
DOOCS_T
*
property
=
dynamic_cast
<
DOOCS_T
*>
(
eqFct
->
find_property
(
propertyName
));
BOOST_REQUIRE_MESSAGE
(
property
,
"Could not find property"
+
propertyName
);
BOOST_REQUIRE_MESSAGE
(
property
,
"Could not find property
"
+
propertyName
+
" (address "
<<
propertyAddress
<<
"), or property has unexpected type."
);
checkHistory
(
property
,
expected_has_history
);
}
...
...
@@ -65,7 +62,7 @@ void testVariableExistence(){
DoocsServerTestHelper
::
runUpdate
();
std
::
cout
<<
"ran update once, let's test "
<<
std
::
endl
;
for
(
auto
const
location
:
{
"CHAR"
,
"U
CHAR"
,
"UINT"
,
"USHOR
T"
}
){
for
(
auto
const
location
:
{
"CHAR"
,
"U
IN
T"
}
){
for
(
auto
const
property
:
{
"CONSTANT_ARRAY"
,
"FROM_DEVICE_ARRAY"
,
"TO_DEVICE_ARRAY "
}
){
// if this throws the property does not exist. we should always be able to read"
checkDoocsProperty
<
D_spectrum
>
(
std
::
string
(
"//"
)
+
location
+
"/"
+
property
);
...
...
@@ -77,37 +74,54 @@ void testVariableExistence(){
}
checkDoocsProperty
<
D_spectrum
>
(
"//MY_RENAMED_INTEGER_LOCATION/RENAMED.CONST_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//MY_RENAMED_INTEGER_LOCATION/FROM_DEVICE_ARRAY"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//MY_RENAMED_INTEGER_LOCATION/TO_DEVICE_ARRAY"
,
true
);
checkDoocsProperty
<
D_
spectrum
>
(
"//MY_RENAMED_INTEGER_LOCATION/DATA_TYPE_CONSTANT"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//MY_RENAMED_INTEGER_LOCATION/FROM_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//MY_RENAMED_INTEGER_LOCATION/TO_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_
int
>
(
"//MY_RENAMED_INTEGER_LOCATION/DATA_TYPE_CONSTANT"
);
BOOST_CHECK
(
DoocsServerTestHelper
::
doocsGet
<
int
>
(
"//MY_RENAMED_INTEGER_LOCATION/DATA_TYPE_CONSTANT"
)
==
-
4
);
checkDoocsProperty
<
D_int
>
(
"//MY_RENAMED_INTEGER_LOCATION/FROM_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_int
>
(
"//MY_RENAMED_INTEGER_LOCATION/TO_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_spectrum
>
(
"//SHORT/myStuff.CONSTANT_ARRAY"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//SHORT/myStuff.FROM_DEVICE_ARRAY"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//SHORT/myStuff.TO_DEVICE_ARRAY"
,
true
);
checkDoocsProperty
<
D_int
>
(
"//SHORT/myStuff.DATA_TY
E
P_CONSTANT"
);
checkDoocsProperty
<
D_spectrum
>
(
"//SHORT/myStuff.CONSTANT_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//SHORT/myStuff.FROM_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//SHORT/myStuff.TO_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_int
>
(
"//SHORT/myStuff.DATA_TYP
E
_CONSTANT"
);
BOOST_CHECK
(
DoocsServerTestHelper
::
doocsGet
<
int
>
(
"//SHORT/myStuff.DATA_TYPE_CONSTANT"
)
==
-
2
);
checkDoocsProperty
<
D_int
>
(
"//SHORT/myStuff.FROM_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_int
>
(
"//CHERRY_PICKED/TO_DEVICE_SHORT"
);
checkDoocsProperty
<
D_spectrum
>
(
"//DOUBLE/CONSTANT_ARRAY"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//DOUBLE/FROM_DEVICE_ARRAY"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//DOUBLE/TO_DEVICE_ARRAY"
,
true
);
checkDoocsProperty
<
D_
int
>
(
"//DOUBLE/RENAMED_CONSTANT"
);
checkDoocsProperty
<
D_spectrum
>
(
"//DOUBLE/CONSTANT_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//DOUBLE/FROM_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//DOUBLE/TO_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_
double
>
(
"//DOUBLE/RENAMED_CONSTANT"
,
false
);
BOOST_CHECK
(
DoocsServerTestHelper
::
doocsGet
<
double
>
(
"//DOUBLE/RENAMED_CONSTANT"
)
==
1.
/
8.
);
checkDoocsProperty
<
D_int
>
(
"//DOUBLE/FROM_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_int
>
(
"//DOUBLE/DOUBLE.TO_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_int
>
(
"//DOUBLE/I_AM_A_FLOAT_SCALAR"
);
checkDoocsProperty
<
D_double
>
(
"//DOUBLE/FROM_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_double
>
(
"//DOUBLE/DOUBLE.TO_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_float
>
(
"//DOUBLE/I_AM_A_FLOAT_SCALAR"
);
// we moved one float scalar to the double location, so we cannot check for it in the loop above
checkDoocsProperty
<
D_spectrum
>
(
"//FLOAT/CONSTANT_ARRAY"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//FLOAT/FROM_DEVICE_ARRAY"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//FLOAT/TO_DEVICE_ARRAY"
,
true
);
checkDoocsProperty
<
D_
spectrum
>
(
"//FLOAT/DATA_TYPE_CONSTANT"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//FLOAT/CONSTANT_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//FLOAT/FROM_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//FLOAT/TO_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_
float
>
(
"//FLOAT/DATA_TYPE_CONSTANT"
);
BOOST_CHECK
(
DoocsServerTestHelper
::
doocsGet
<
float
>
(
"//FLOAT/DATA_TYPE_CONSTANT"
)
==
1.
/
4.
);
checkDoocsProperty
<
D_int
>
(
"//FLOAT/FROM_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_float
>
(
"//FLOAT/FROM_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_spectrum
>
(
"//USHORT/CONSTANT_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//USHORT/FROM_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//USHORT/TO_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_int
>
(
"//USHORT/DATA_TYPE_CONSTANT"
,
false
);
BOOST_CHECK
(
DoocsServerTestHelper
::
doocsGet
<
int
>
(
"//USHORT/DATA_TYPE_CONSTANT"
)
==
2
);
checkDoocsProperty
<
D_int
>
(
"//USHORT/FROM_DEVICE_SCALAR"
,
false
);
checkDoocsProperty
<
D_int
>
(
"//USHORT/TO_DEVICE_SCALAR"
,
true
);
checkDoocsProperty
<
D_spectrum
>
(
"//UCHAR/CONSTANT_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//UCHAR/FROM_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_spectrum
>
(
"//UCHAR/TO_DEVICE_ARRAY"
);
checkDoocsProperty
<
D_int
>
(
"//UCHAR/DATA_TYPE_CONSTANT"
);
BOOST_CHECK
(
DoocsServerTestHelper
::
doocsGet
<
int
>
(
"//UCHAR/DATA_TYPE_CONSTANT"
)
==
1
);
checkDoocsProperty
<
D_int
>
(
"//UCHAR/FROM_DEVICE_SCALAR"
);
checkDoocsProperty
<
D_int
>
(
"//UCHAR/TO_DEVICE_SCALAR"
);
}
// due to the doocs server thread you can only have one test suite
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment