Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph
Commits
75fe2b44
Commit
75fe2b44
authored
May 01, 2020
by
Olivier Stasse
Committed by
olivier stasse
May 04, 2020
Browse files
[tests] Add command test for return value.
parent
31aa778b
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/command-test.cpp
View file @
75fe2b44
...
...
@@ -63,6 +63,16 @@ public:
*
this
,
&
CustomEntity
::
four_args
,
docCommandVoid4
(
"four args"
,
"int"
,
"int"
,
"int"
,
"int"
)));
addCommand
(
"1_arg_r"
,
makeCommandReturnType1
(
*
this
,
&
CustomEntity
::
one_arg_ret
,
docCommandVoid1
(
"one arg"
,
"int"
)));
addCommand
(
"2_args_r"
,
makeCommandReturnType2
(
*
this
,
&
CustomEntity
::
two_args_ret
,
docCommandVoid2
(
"two args"
,
"int"
,
"int"
)));
/// Generating an exception by adding a command which already exist
bool
res
=
false
;
std
::
string
e_1_arg
(
"1_arg"
);
...
...
@@ -89,6 +99,12 @@ public:
void
four_args
(
const
int
&
,
const
int
&
,
const
int
&
,
const
int
&
)
{
test_four_args_
=
true
;
}
int
one_arg_ret
(
const
int
&
)
{
test_one_arg_
=
true
;
return
2
;}
std
::
string
two_args_ret
(
const
int
&
,
const
int
&
)
{
test_two_args_
=
true
;
return
std
::
string
(
"return"
);}
};
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
(
CustomEntity
,
"CustomEntity"
);
}
// namespace dynamicgraph
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment