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
71e27363
Commit
71e27363
authored
8 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
extended the readAny test
parent
c7bc5a38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/executables_src/testTestFacilities.cc
+80
-1
80 additions, 1 deletion
tests/executables_src/testTestFacilities.cc
with
80 additions
and
1 deletion
tests/executables_src/testTestFacilities.cc
+
80
−
1
View file @
71e27363
...
...
@@ -372,6 +372,85 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testReadAny, T, test_types ) {
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
==
66
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
==
4
);
// send something to v1
app
.
noLoopTestModule
.
outputs
.
v1
=
33
;
app
.
noLoopTestModule
.
outputs
.
v1
.
write
();
// check that we still don't receive anything yet
usleep
(
10000
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
false
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
false
);
// run the application and check that we got the expected result
app
.
stepApplication
();
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
==
33
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
==
1
);
// send something to v1 again
app
.
noLoopTestModule
.
outputs
.
v1
=
34
;
app
.
noLoopTestModule
.
outputs
.
v1
.
write
();
// check that we still don't receive anything yet
usleep
(
10000
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
false
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
false
);
// run the application and check that we got the expected result
app
.
stepApplication
();
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
==
34
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
==
1
);
// send something to v3
app
.
noLoopTestModule
.
outputs
.
v3
=
40
;
app
.
noLoopTestModule
.
outputs
.
v3
.
write
();
// check that we still don't receive anything yet
usleep
(
10000
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
false
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
false
);
// run the application and check that we got the expected result
app
.
stepApplication
();
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
==
40
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
==
3
);
// send something to v2
app
.
noLoopTestModule
.
outputs
.
v2
=
50
;
app
.
noLoopTestModule
.
outputs
.
v2
.
write
();
// check that we still don't receive anything yet
usleep
(
10000
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
false
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
false
);
// run the application and check that we got the expected result
app
.
stepApplication
();
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
==
50
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
==
2
);
// send something to v1 a 3rd time
app
.
noLoopTestModule
.
outputs
.
v1
=
35
;
app
.
noLoopTestModule
.
outputs
.
v1
.
write
();
// check that we still don't receive anything yet
usleep
(
10000
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
false
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
false
);
// run the application and check that we got the expected result
app
.
stepApplication
();
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
.
readNonBlocking
()
==
true
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someInput
==
35
);
BOOST_CHECK
(
app
.
noLoopTestModule
.
someUIntInput
==
1
);
}
// TODO: testReadAny and test with multiple application threads!
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