Commit a12892f7 authored by Dominik Charousset's avatar Dominik Charousset Committed by Marian Triebe

Add CAF_MESSAGE for Boost.Text compatibility

parent 6eff7c2b
...@@ -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_VERBOSE("start receive loop"); CAF_MESSAGE("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_VERBOSE("drain mailbox"); CAF_MESSAGE("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_VERBOSE("received 'abc'"); CAF_MESSAGE("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_VERBOSE("received abc_atom"); CAF_MESSAGE("received abc_atom");
self->quit(); self->quit();
return 42; return 42;
} }
......
...@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment