Commit a7468026 authored by Dominik Charousset's avatar Dominik Charousset

Fix shadowing and documentation warnings

parent 425f224b
...@@ -188,7 +188,7 @@ class binary_util { ...@@ -188,7 +188,7 @@ class binary_util {
}; };
struct is_message { struct is_message {
explicit is_message(message& msg) : msg(msg) { explicit is_message(message& msgref) : msg(msgref) {
// nop // nop
} }
......
...@@ -825,6 +825,8 @@ CAF_TEST(constructor_attach) { ...@@ -825,6 +825,8 @@ CAF_TEST(constructor_attach) {
anon_send(spawn<spawner>(), atom("die")); anon_send(spawn<spawner>(), atom("die"));
} }
namespace {
class exception_testee : public event_based_actor { class exception_testee : public event_based_actor {
public: public:
exception_testee() { exception_testee() {
...@@ -841,6 +843,8 @@ class exception_testee : public event_based_actor { ...@@ -841,6 +843,8 @@ class exception_testee : public event_based_actor {
} }
}; };
} // namespace <anonymous>
CAF_TEST(custom_exception_handler) { CAF_TEST(custom_exception_handler) {
auto handler = [](const std::exception_ptr& eptr) -> optional<uint32_t> { auto handler = [](const std::exception_ptr& eptr) -> optional<uint32_t> {
try { try {
......
...@@ -56,7 +56,7 @@ constexpr size_t num_pings = 10; ...@@ -56,7 +56,7 @@ constexpr size_t num_pings = 10;
size_t s_pongs = 0; size_t s_pongs = 0;
behavior ping_behavior(local_actor* self, size_t num_pings) { behavior ping_behavior(local_actor* self, size_t ping_msgs) {
return { return {
on(atom("pong"), arg_match) >> [=](int value)->message { on(atom("pong"), arg_match) >> [=](int value)->message {
if (!self->current_sender()) { if (!self->current_sender()) {
...@@ -64,7 +64,7 @@ behavior ping_behavior(local_actor* self, size_t num_pings) { ...@@ -64,7 +64,7 @@ behavior ping_behavior(local_actor* self, size_t num_pings) {
} }
CAF_TEST_INFO("received {'pong', " << value << "}"); CAF_TEST_INFO("received {'pong', " << value << "}");
// cout << to_string(self->current_message()) << endl; // cout << to_string(self->current_message()) << endl;
if (++s_pongs >= num_pings) { if (++s_pongs >= ping_msgs) {
CAF_TEST_INFO("reached maximum, send {'EXIT', user_defined} " CAF_TEST_INFO("reached maximum, send {'EXIT', user_defined} "
<< "to last sender and quit with normal reason"); << "to last sender and quit with normal reason");
self->send_exit(self->current_sender(), self->send_exit(self->current_sender(),
...@@ -94,9 +94,9 @@ size_t pongs() { ...@@ -94,9 +94,9 @@ size_t pongs() {
return s_pongs; return s_pongs;
} }
void event_based_ping(event_based_actor* self, size_t num_pings) { void event_based_ping(event_based_actor* self, size_t ping_msgs) {
s_pongs = 0; s_pongs = 0;
self->become(ping_behavior(self, num_pings)); self->become(ping_behavior(self, ping_msgs));
} }
void pong(blocking_actor* self, actor ping_actor) { void pong(blocking_actor* self, actor ping_actor) {
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#define CAF_TEST_UNIT_TEST_HPP #define CAF_TEST_UNIT_TEST_HPP
#include <map> #include <map>
#include <regex>
#include <cmath> #include <cmath>
#include <mutex> #include <mutex>
#include <thread> #include <thread>
...@@ -235,7 +234,7 @@ class engine { ...@@ -235,7 +234,7 @@ class engine {
/** /**
* Adds a test to the engine. * Adds a test to the engine.
* @param name The name of the suite. * @param name The name of the suite.
* @param t The test to register. * @param ptr The test to register.
*/ */
static void add(const char* name, std::unique_ptr<test> ptr); static void add(const char* name, std::unique_ptr<test> ptr);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#ifndef CAF_TEST_UNIT_TEST_IMPL_HPP #ifndef CAF_TEST_UNIT_TEST_IMPL_HPP
#define CAF_TEST_UNIT_TEST_IMPL_HPP #define CAF_TEST_UNIT_TEST_IMPL_HPP
#include <regex>
#include <thread> #include <thread>
#include <cassert> #include <cassert>
#include <cstdlib> #include <cstdlib>
......
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