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
06fe7540
Commit
06fe7540
authored
7 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
prepared tests for array start and increment. Currently failing due to missing implementation
parent
ef7ea4eb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/include/serverBasedTestTools.h
+22
-0
22 additions, 0 deletions
tests/include/serverBasedTestTools.h
tests/src/serverTestSpectrumArray.cpp
+8
-0
8 additions, 0 deletions
tests/src/serverTestSpectrumArray.cpp
with
30 additions
and
0 deletions
tests/include/serverBasedTestTools.h
+
22
−
0
View file @
06fe7540
...
...
@@ -52,4 +52,26 @@ void checkDoocsProperty(std::string const & propertyAddress, bool expected_has_h
}
}
void
checkSpectrum
(
std
::
string
const
&
propertyAddress
,
bool
expected_has_history
=
true
,
bool
expected_is_writeable
=
true
,
float
expected_start
=
0.0
,
float
expected_increment
=
1.0
){
checkDoocsProperty
<
D_spectrum
>
(
propertyAddress
,
expected_has_history
,
expected_is_writeable
);
EqAdr
ad
;
EqData
ed
,
res
;
// obtain location pointer
ad
.
adr
(
propertyAddress
.
c_str
());
EqFct
*
eqFct
=
eq_get
(
&
ad
);
BOOST_REQUIRE_MESSAGE
(
eqFct
,
"Could not get location for property "
+
propertyAddress
);
auto
propertyName
=
ChimeraTK
::
basenameFromAddress
(
propertyAddress
);
D_spectrum
*
spectrum
=
dynamic_cast
<
D_spectrum
*>
(
eqFct
->
find_property
(
propertyName
));
BOOST_REQUIRE_MESSAGE
(
spectrum
,
"Could not find property "
+
propertyName
+
" (address "
<<
propertyAddress
<<
"), or property has unexpected type."
);
std
::
cout
<<
"The magic 4 "
<<
spectrum
->
spec_time
()
<<
", "
<<
spectrum
->
spec_start
()
<<
", "
<<
spectrum
->
spec_inc
()
<<
", "
<<
spectrum
->
spec_status
()
<<
std
::
endl
;
BOOST_CHECK
(
std
::
fabs
(
spectrum
->
spec_start
()
-
expected_start
)
<
0.001
);
BOOST_CHECK
(
std
::
fabs
(
spectrum
->
spec_inc
()
-
expected_increment
)
<
0.001
);
}
#endif // SERVER_BASED_TEST_TOOLS_H
This diff is collapsed.
Click to expand it.
tests/src/serverTestSpectrumArray.cpp
+
8
−
0
View file @
06fe7540
...
...
@@ -6,6 +6,7 @@
#include
<ChimeraTK/ControlSystemAdapter/Testing/ReferenceTestApplication.h>
#include
<doocs-server-test-helper/doocsServerTestHelper.h>
#include
<thread>
#include
"serverBasedTestTools.h"
ReferenceTestApplication
referenceTestApplication
(
"serverTestSpectrumArray"
);
...
...
@@ -35,6 +36,13 @@ void testReadWrite(){
DoocsServerTestHelper
::
runUpdate
();
std
::
cout
<<
"ran update once, let's test "
<<
std
::
endl
;
checkSpectrum
(
"//INT/TO_DEVICE_ARRAY"
);
checkSpectrum
(
"//DOUBLE/TO_DEVICE_ARRAY"
);
checkSpectrum
(
"//FLOAT/TO_DEVICE_ARRAY"
);
checkSpectrum
(
"//INT/MY_RENAMED_INTARRAY"
,
true
,
false
);
checkSpectrum
(
"//DOUBLE/FROM_DEVICE_ARRAY"
,
true
,
false
,
123.
,
0.56
);
checkSpectrum
(
"//FLOAT/FROM_DEVICE_ARRAY"
,
true
,
false
);
DoocsServerTestHelper
::
doocsSetSpectrum
(
"//INT/TO_DEVICE_ARRAY"
,
{
140
,
141
,
142
,
143
,
144
,
145
,
146
,
147
,
148
,
149
}
);
DoocsServerTestHelper
::
doocsSetSpectrum
(
"//DOUBLE/TO_DEVICE_ARRAY"
,
{
240.3
,
241.3
,
242.3
,
243.3
,
244.3
,
245.3
,
246.3
,
247.3
,
248.3
,
249.3
}
);
...
...
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