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
d48cd6e3
Commit
d48cd6e3
authored
8 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
added more tests for illegal network configurations
parent
a39a1c51
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/testIllegalNetworks.cc
+55
-0
55 additions, 0 deletions
tests/executables_src/testIllegalNetworks.cc
with
55 additions
and
0 deletions
tests/executables_src/testIllegalNetworks.cc
+
55
−
0
View file @
d48cd6e3
...
...
@@ -32,6 +32,7 @@ template<typename T>
class
TestModule
:
public
ctk
::
ApplicationModule
{
public:
SCALAR_ACCESSOR
(
T
,
feedingPush
,
ctk
::
VariableDirection
::
feeding
,
"MV/m"
,
ctk
::
UpdateMode
::
push
);
SCALAR_ACCESSOR
(
T
,
feedingPush2
,
ctk
::
VariableDirection
::
feeding
,
"MV/m"
,
ctk
::
UpdateMode
::
push
);
SCALAR_ACCESSOR
(
T
,
consumingPush
,
ctk
::
VariableDirection
::
consuming
,
"MV/m"
,
ctk
::
UpdateMode
::
push
);
SCALAR_ACCESSOR
(
T
,
consumingPush2
,
ctk
::
VariableDirection
::
consuming
,
"MV/m"
,
ctk
::
UpdateMode
::
push
);
SCALAR_ACCESSOR
(
T
,
consumingPush3
,
ctk
::
VariableDirection
::
consuming
,
"MV/m"
,
ctk
::
UpdateMode
::
push
);
...
...
@@ -71,3 +72,57 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testTwoScalarPollPushAccessors, T, test_types ) {
}
}
/*********************************************************************************************************************/
/* test case for no feeder */
BOOST_AUTO_TEST_CASE_TEMPLATE
(
testNoFeeder
,
T
,
test_types
)
{
TestApplication
app
(
"Test Suite"
);
TestModule
<
T
>
testModule
;
testModule
.
consumingPush2
.
connectTo
(
testModule
.
consumingPush
);
try
{
app
.
makeConnections
();
BOOST_ERROR
(
"Exception expected."
);
}
catch
(
ctk
::
ApplicationExceptionWithID
<
ctk
::
ApplicationExceptionID
::
illegalVariableNetwork
>
&
e
)
{
}
}
/*********************************************************************************************************************/
/* test case for no consumer */
BOOST_AUTO_TEST_CASE_TEMPLATE
(
testNoConsumer
,
T
,
test_types
)
{
TestApplication
app
(
"Test Suite"
);
TestModule
<
T
>
testModule
;
try
{
testModule
.
feedingPush
.
connectTo
(
testModule
.
feedingPush2
);
BOOST_ERROR
(
"Exception expected."
);
}
catch
(
ctk
::
ApplicationExceptionWithID
<
ctk
::
ApplicationExceptionID
::
illegalVariableNetwork
>
&
e
)
{
}
}
/*********************************************************************************************************************/
/* test case for too many polling consumers */
BOOST_AUTO_TEST_CASE_TEMPLATE
(
testTooManyPollingConsumers
,
T
,
test_types
)
{
TestApplication
app
(
"Test Suite"
);
TestModule
<
T
>
testModule
;
testModule
.
feedingPoll
.
connectTo
(
testModule
.
consumingPoll
);
testModule
.
feedingPoll
.
connectTo
(
testModule
.
consumingPoll2
);
try
{
app
.
makeConnections
();
BOOST_ERROR
(
"Exception expected."
);
}
catch
(
ctk
::
ApplicationExceptionWithID
<
ctk
::
ApplicationExceptionID
::
illegalVariableNetwork
>
&
e
)
{
}
}
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