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
81be3ebf
You need to sign in or sign up before continuing.
Commit
81be3ebf
authored
4 years ago
by
Christoph Kampmeyer
Browse files
Options
Downloads
Patches
Plain Diff
Test illegal use of HierarchyModifiers on top level
parent
2b0dfa8b
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/testVirtualModule.cc
+41
-10
41 additions, 10 deletions
tests/executables_src/testVirtualModule.cc
with
41 additions
and
10 deletions
tests/executables_src/testVirtualModule.cc
+
41
−
10
View file @
81be3ebf
...
...
@@ -44,24 +44,55 @@ struct OuterGroup : public ctk::ModuleGroup {
};
struct
TestApplication
:
public
ctk
::
Application
{
TestApplication
()
:
Application
(
"testApp"
)
{}
TestApplication
(
ctk
::
HierarchyModifier
outerModuleModifier
)
:
Application
(
"testApp"
),
outerModule
{
this
,
"outerModule"
,
""
,
outerModuleModifier
}
{}
~
TestApplication
()
{
shutdown
();
}
OuterGroup
outerModuleGroup1
{
this
,
"outerModuleGroup"
,
""
,
ctk
::
HierarchyModifier
::
on
eUpAndHid
e
};
OuterGroup
outerModuleGroup1
{
this
,
"outerModuleGroup"
,
""
,
ctk
::
HierarchyModifier
::
n
one
};
TestModule
outerModule
{
this
,
"outerModule"
,
""
,
ctk
::
HierarchyModifier
::
none
}
;
TestModule
outerModule
;
ctk
::
ControlSystemModule
cs
;
void
defineConnections
()
{
findTag
(
".*"
).
connectTo
(
cs
);
}
void
defineConnections
()
{
findTag
(
".*"
).
connectTo
(
cs
);
cs
.
dump
();
}
};
BOOST_AUTO_TEST_CASE
(
testStatusAggregator
)
{
std
::
cout
<<
"testStatusAggregator"
<<
std
::
endl
;
BOOST_AUTO_TEST_CASE
(
testIllegalModifiers
)
{
// Just test if the app comes up without without
std
::
cout
<<
"testIllegalModifiers"
<<
std
::
endl
;
TestApplication
app
;
{
std
::
cout
<<
"Creating TestApplication with outerModuleModifier = none "
<<
std
::
endl
;
// Should work
TestApplication
app
(
ctk
::
HierarchyModifier
::
none
);
ctk
::
TestFacility
test
;
std
::
cout
<<
std
::
endl
;
}
ctk
::
TestFacility
test
;
test
.
runApplication
();
app
.
cs
.
dump
();
{
std
::
cout
<<
"Creating TestApplication with outerModuleModifier = oneLevelUp "
<<
std
::
endl
;
TestApplication
app
(
ctk
::
HierarchyModifier
::
oneLevelUp
);
// Should detect usage of oneLevelUp and throw
BOOST_CHECK_THROW
(
ctk
::
TestFacility
test
,
ctk
::
logic_error
);
std
::
cout
<<
std
::
endl
;
}
// Currently leads to memory access violation, should also throw
// {
// std::cout << "Creating TestApplication with outerModuleModifier = oneUpAndHide " << std::endl;
// TestApplication app(ctk::HierarchyModifier::oneUpAndHide);
// ctk::TestFacility test;
// std::cout << std::endl;
// }
{
std
::
cout
<<
"Creating TestApplication with outerModuleModifier = moveToRoot "
<<
std
::
endl
;
// Should work
TestApplication
app
(
ctk
::
HierarchyModifier
::
moveToRoot
);
ctk
::
TestFacility
test
;
std
::
cout
<<
std
::
endl
;
}
}
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