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
a12892f7
Commit
a12892f7
authored
Mar 16, 2015
by
Dominik Charousset
Committed by
Marian Triebe
Apr 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CAF_MESSAGE for Boost.Text compatibility
parent
6eff7c2b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
libcaf_core/test/atom.cpp
libcaf_core/test/atom.cpp
+6
-6
libcaf_test/caf/test/unit_test.hpp
libcaf_test/caf/test/unit_test.hpp
+1
-0
No files found.
libcaf_core/test/atom.cpp
View file @
a12892f7
...
@@ -59,19 +59,19 @@ CAF_TEST(receive_atoms) {
...
@@ -59,19 +59,19 @@ CAF_TEST(receive_atoms) {
scoped_actor
self
;
scoped_actor
self
;
send_to_self
f
{
self
.
get
()};
send_to_self
f
{
self
.
get
()};
f
(
atom
(
"foo"
),
static_cast
<
uint32_t
>
(
42
));
f
(
atom
(
"foo"
),
static_cast
<
uint32_t
>
(
42
));
f
(
atom
(
"
:Attach"
),
atom
(
":Baz
"
),
"cstring"
);
f
(
atom
(
"
abc"
),
atom
(
"def
"
),
"cstring"
);
f
(
1.
f
);
f
(
1.
f
);
f
(
atom
(
"a"
),
atom
(
"b"
),
atom
(
"c"
),
23.
f
);
f
(
atom
(
"a"
),
atom
(
"b"
),
atom
(
"c"
),
23.
f
);
bool
matched_pattern
[
3
]
=
{
false
,
false
,
false
};
bool
matched_pattern
[
3
]
=
{
false
,
false
,
false
};
int
i
=
0
;
int
i
=
0
;
CAF_
TEST_VERBOS
E
(
"start receive loop"
);
CAF_
MESSAG
E
(
"start receive loop"
);
for
(
i
=
0
;
i
<
3
;
++
i
)
{
for
(
i
=
0
;
i
<
3
;
++
i
)
{
self
->
receive
(
self
->
receive
(
on
(
atom
(
"foo"
),
arg_match
)
>>
[
&
](
uint32_t
value
)
{
on
(
atom
(
"foo"
),
arg_match
)
>>
[
&
](
uint32_t
value
)
{
matched_pattern
[
0
]
=
true
;
matched_pattern
[
0
]
=
true
;
CAF_CHECK_EQUAL
(
value
,
42
);
CAF_CHECK_EQUAL
(
value
,
42
);
},
},
on
(
atom
(
"
:Attach"
),
atom
(
":Baz
"
),
arg_match
)
>>
[
&
](
const
std
::
string
&
str
)
{
on
(
atom
(
"
abc"
),
atom
(
"def
"
),
arg_match
)
>>
[
&
](
const
std
::
string
&
str
)
{
matched_pattern
[
1
]
=
true
;
matched_pattern
[
1
]
=
true
;
CAF_CHECK_EQUAL
(
str
,
"cstring"
);
CAF_CHECK_EQUAL
(
str
,
"cstring"
);
},
},
...
@@ -84,7 +84,7 @@ CAF_TEST(receive_atoms) {
...
@@ -84,7 +84,7 @@ CAF_TEST(receive_atoms) {
self
->
receive
(
self
->
receive
(
// "erase" message { atom("b"), atom("a"), atom("c"), 23.f }
// "erase" message { atom("b"), atom("a"), atom("c"), 23.f }
others
>>
[]
{
others
>>
[]
{
CAF_
TEST_VERBOS
E
(
"drain mailbox"
);
CAF_
MESSAG
E
(
"drain mailbox"
);
},
},
after
(
std
::
chrono
::
seconds
(
0
))
>>
[]
{
after
(
std
::
chrono
::
seconds
(
0
))
>>
[]
{
CAF_TEST_ERROR
(
"mailbox empty"
);
CAF_TEST_ERROR
(
"mailbox empty"
);
...
@@ -97,7 +97,7 @@ CAF_TEST(receive_atoms) {
...
@@ -97,7 +97,7 @@ CAF_TEST(receive_atoms) {
self
->
send
(
self
,
msg
);
self
->
send
(
self
,
msg
);
self
->
receive
(
self
->
receive
(
on
(
atom
(
"abc"
))
>>
[]
{
on
(
atom
(
"abc"
))
>>
[]
{
CAF_
TEST_VERBOS
E
(
"received 'abc'"
);
CAF_
MESSAG
E
(
"received 'abc'"
);
},
},
others
>>
[]
{
others
>>
[]
{
CAF_TEST_ERROR
(
"unexpected message"
);
CAF_TEST_ERROR
(
"unexpected message"
);
...
@@ -110,7 +110,7 @@ using testee = typed_actor<replies_to<abc_atom>::with<int>>;
...
@@ -110,7 +110,7 @@ using testee = typed_actor<replies_to<abc_atom>::with<int>>;
testee
::
behavior_type
testee_impl
(
testee
::
pointer
self
)
{
testee
::
behavior_type
testee_impl
(
testee
::
pointer
self
)
{
return
{
return
{
[
=
](
abc_atom
)
{
[
=
](
abc_atom
)
{
CAF_
TEST_VERBOS
E
(
"received abc_atom"
);
CAF_
MESSAG
E
(
"received abc_atom"
);
self
->
quit
();
self
->
quit
();
return
42
;
return
42
;
}
}
...
...
libcaf_test/caf/test/unit_test.hpp
View file @
a12892f7
...
@@ -567,5 +567,6 @@ private:
...
@@ -567,5 +567,6 @@ private:
// Boost Test compatibility macro
// Boost Test compatibility macro
#define CAF_CHECK_EQUAL(x, y) CAF_CHECK(x == y)
#define CAF_CHECK_EQUAL(x, y) CAF_CHECK(x == y)
#define CAF_MESSAGE(msg) CAF_TEST_VERBOSE(msg)
#endif // CAF_TEST_UNIT_TEST_HPP
#endif // CAF_TEST_UNIT_TEST_HPP
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