Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
f45494de
Commit
f45494de
authored
Jan 13, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix uniform type unit test
parent
4c8a78f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
28 deletions
+35
-28
unit_testing/test_uniform_type.cpp
unit_testing/test_uniform_type.cpp
+35
-28
No files found.
unit_testing/test_uniform_type.cpp
View file @
f45494de
...
...
@@ -25,8 +25,9 @@ namespace {
struct
foo
{
int
value
;
explicit
foo
(
int
val
=
0
)
:
value
(
val
)
{}
explicit
foo
(
int
val
=
0
)
:
value
(
val
)
{
// nop
}
};
inline
bool
operator
==
(
const
foo
&
lhs
,
const
foo
&
rhs
)
{
...
...
@@ -124,12 +125,11 @@ int main() {
// the uniform_type_info implementation is correct
std
::
set
<
std
::
string
>
expected
=
{
// local types
"foo"
,
// <anonymous namespace>::foo
"foo"
,
// primitive types
"bool"
,
"@i8"
,
"@i16"
,
"@i32"
,
"@i64"
,
// signed integer names
"@u8"
,
"@u16"
,
"@u32"
,
"@u64"
,
// unsigned integer names
"bool"
,
"@i8"
,
"@i16"
,
"@i32"
,
"@i64"
,
// signed integer names
"@u8"
,
"@u16"
,
"@u32"
,
"@u64"
,
// unsigned integer names
"@str"
,
"@u16str"
,
"@u32str"
,
// strings
"float"
,
"double"
,
"@ldouble"
,
// floating points
// default announced types
...
...
@@ -151,11 +151,15 @@ int main() {
"@timeout"
,
// timeout_msg
"@sync_exited"
,
// sync_exited_msg
"@sync_timeout"
,
// sync_timeout_msg
"@strvec"
// vector<string>
"@strvec"
,
// vector<string>
"@strset"
// set<string>
};
CAF_CHECKPOINT
();
if
(
check_types
(
expected
))
{
CAF_CHECKPOINT
();
// causes the middleman to create its singleton
io
::
middleman
::
instance
();
CAF_CHECKPOINT
();
// ok, check whether middleman announces its types correctly
check_types
(
append
(
expected
,
"caf::io::accept_handle"
,
...
...
@@ -164,9 +168,12 @@ int main() {
"caf::io::connection_closed_msg"
,
"caf::io::new_connection_msg"
,
"caf::io::new_data_msg"
));
CAF_CHECKPOINT
();
}
// check whether enums can be announced as members
announce
<
test_enum
>
(
"test_enum"
);
announce
<
test_struct
>
(
"test_struct"
,
&
test_struct
::
test_value
);
CAF_CHECKPOINT
();
shutdown
();
return
CAF_TEST_RESULT
();
}
Write
Preview
Markdown
is supported
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