Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
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
ApplicationCore
Commits
b0bbd75a
Commit
b0bbd75a
authored
5 years ago
by
vargheseg
Browse files
Options
Downloads
Patches
Plain Diff
implemented testThreadedFanout
parent
629abd24
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/executables_src/testPropagateDataFaultFlag.cc
+71
-18
71 additions, 18 deletions
tests/executables_src/testPropagateDataFaultFlag.cc
with
71 additions
and
18 deletions
tests/executables_src/testPropagateDataFaultFlag.cc
+
71
−
18
View file @
b0bbd75a
...
@@ -439,29 +439,82 @@ struct TestApplication3 : ctk::Application {
...
@@ -439,29 +439,82 @@ struct TestApplication3 : ctk::Application {
}
}
};
};
struct
Fixture_testFacility
{
Fixture_testFacility
()
:
device1
(
boost
::
dynamic_pointer_cast
<
ExceptionDummy
>
(
ChimeraTK
::
BackendFactory
::
getInstance
().
createBackend
(
TestApplication3
::
ExceptionDummyCDD1
))),
device2
(
boost
::
dynamic_pointer_cast
<
ExceptionDummy
>
(
ChimeraTK
::
BackendFactory
::
getInstance
().
createBackend
(
TestApplication3
::
ExceptionDummyCDD2
)))
{
device1
->
open
();
device2
->
open
();
test
.
runApplication
();
}
boost
::
shared_ptr
<
ExceptionDummy
>
device1
;
boost
::
shared_ptr
<
ExceptionDummy
>
device2
;
TestApplication3
app
;
ctk
::
TestFacility
test
;
};
BOOST_FIXTURE_TEST_SUITE
(
data_validity_propagation
,
Fixture_testFacility
)
BOOST_AUTO_TEST_CASE
(
testThreadedFanout
)
{
BOOST_AUTO_TEST_CASE
(
testThreadedFanout
)
{
auto
threadedFanoutInput
=
test
.
getScalar
<
int
>
(
"m1/o1"
);
auto
m1_result
=
test
.
getScalar
<
int
>
(
"m1/Module1_result"
);
auto
m2_result
=
test
.
getScalar
<
int
>
(
"m2/Module2_result"
);
// - good value threaded, device
threadedFanoutInput
=
20
;
// - loop, check expected result.
threadedFanoutInput
.
write
();
//
// write to register: m1.i1 linked with the consumingFanout.
// - bad value.
auto
consumingFanoutSource
=
device1
->
getRawAccessor
(
"m1"
,
"i1"
);
// - Result expected + invalid flag
consumingFanoutSource
=
10
;
//
// Q where do i chek for the invalid flag
// can be local to the test.
//
// boost::shared_ptr<ExceptionDummy> dummyBackend1 =
// boost::dynamic_pointer_cast<ExceptionDummy>(
// ChimeraTK::BackendFactory::getInstance().createBackend(ExceptionDummyCDD1));
// dummyBackend1->throwExceptionRead = true;
// dummyBackend1->throwExceptionWrite = true;
TestApplication3
app
;
auto
pollRegister
=
device2
->
getRawAccessor
(
"m1"
,
"i2"
);
ctk
::
TestFacility
test
{
false
};
pollRegister
=
5
;
test
.
stepApplication
();
m1_result
.
read
();
m2_result
.
read
();
BOOST_CHECK_EQUAL
(
m1_result
,
35
);
BOOST_CHECK
(
m1_result
.
dataValidity
()
==
ctk
::
DataValidity
::
ok
);
BOOST_CHECK_EQUAL
(
m2_result
,
35
);
BOOST_CHECK
(
m2_result
.
dataValidity
()
==
ctk
::
DataValidity
::
ok
);
threadedFanoutInput
=
10
;
threadedFanoutInput
.
setDataValidity
(
ctk
::
DataValidity
::
faulty
);
threadedFanoutInput
.
write
();
test
.
stepApplication
();
m1_result
.
read
();
m2_result
.
read
();
BOOST_CHECK_EQUAL
(
m1_result
,
25
);
BOOST_CHECK
(
m1_result
.
dataValidity
()
==
ctk
::
DataValidity
::
faulty
);
BOOST_CHECK_EQUAL
(
m2_result
,
25
);
BOOST_CHECK
(
m2_result
.
dataValidity
()
==
ctk
::
DataValidity
::
faulty
);
threadedFanoutInput
=
40
;
threadedFanoutInput
.
setDataValidity
(
ctk
::
DataValidity
::
ok
);
threadedFanoutInput
.
write
();
test
.
stepApplication
();
m1_result
.
read
();
m2_result
.
read
();
BOOST_CHECK_EQUAL
(
m1_result
,
55
);
BOOST_CHECK
(
m1_result
.
dataValidity
()
==
ctk
::
DataValidity
::
ok
);
BOOST_CHECK_EQUAL
(
m2_result
,
55
);
BOOST_CHECK
(
m2_result
.
dataValidity
()
==
ctk
::
DataValidity
::
ok
);
}
}
BOOST_AUTO_TEST_CASE
(
testDeviceReadFailure
){
}
BOOST_AUTO_TEST_CASE
(
testConsumingFanout
){
}
BOOST_AUTO_TEST_CASE
(
testConsumingFanout
){}
BOOST_AUTO_TEST_CASE
(
testTrigger
){}
BOOST_AUTO_TEST_CASE
(
testTrigger
){}
BOOST_AUTO_TEST_CASE
(
testDeviceReadFailure
){}
BOOST_AUTO_TEST_SUITE_END
()
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