Commit 813fed9b authored by Dominik Charousset's avatar Dominik Charousset

Fix several warnings

parent 1031dae6
......@@ -321,6 +321,7 @@ logger::logger(actor_system& sys) : system_(sys) {
}
void logger::init(actor_system_config& cfg) {
CAF_IGNORE_UNUSED(cfg);
#if defined(CAF_LOG_LEVEL)
auto lvl_atom = cfg.logger_verbosity;
switch (static_cast<uint64_t>(lvl_atom)) {
......
......@@ -193,7 +193,7 @@ CAF_TEST(type_float) {
std::tie(result, error_str) = run_config_option(init_value, boundary_check);
float float_inf = std::numeric_limits<float>::infinity();
// Unit test does not compare inf values correct until now
bool tmp = float_inf == result;
bool tmp = float_inf == result;
CAF_CHECK_NOT_EQUAL(tmp, true);
CAF_CHECK_EQUAL(result, init_value);
CAF_CHECK_EQUAL(error_str.empty(), false);
......
......@@ -241,7 +241,7 @@ struct binary_serialization_policy {
T y;
g(y);
CAF_CHECK_EQUAL(x, y);
return x == y;
return detail::safe_equal(x, y);
}
};
} // namespace <anonymous>
......
......@@ -302,16 +302,16 @@ CAF_TEST(single_timeout) {
CAF_MESSAGE("test implemenation " << f.second);
auto testee = system.spawn(f.first, &had_timeout,
system.spawn<lazy_init>(pong));
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"});
sched.run_once();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"});
sched.dispatch();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2u);
// now, the timeout message is already dispatched, while pong did
// not respond to the message yet, i.e., timeout arrives before response
CAF_CHECK_EQUAL(sched.run(), 2);
CAF_CHECK_EQUAL(sched.run(), 2u);
CAF_CHECK(had_timeout);
}
}
......@@ -325,13 +325,13 @@ CAF_TEST(nested_timeout) {
CAF_MESSAGE("test implemenation " << f.second);
auto testee = system.spawn(f.first, &had_timeout,
system.spawn<lazy_init>(pong));
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"});
sched.run_once();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"});
sched.dispatch();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2u);
// now, the timeout message is already dispatched, while pong did
// not respond to the message yet, i.e., timeout arrives before response
sched.run();
......@@ -355,13 +355,13 @@ CAF_TEST(multiplexed_timeout) {
CAF_MESSAGE("test implemenation " << f.second);
auto testee = system.spawn(f.first, &had_timeout,
system.spawn<lazy_init>(pong));
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"ping"});
sched.run_once();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 1u);
CAF_REQUIRE_EQUAL(sched.next_job<local_actor>().name(), string{"pong"});
sched.dispatch();
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2);
CAF_REQUIRE_EQUAL(sched.jobs.size(), 2u);
// now, the timeout message is already dispatched, while pong did
// not respond to the message yet, i.e., timeout arrives before response
sched.run();
......
......@@ -104,7 +104,7 @@ CAF_TEST(duration_conversion) {
duration d1{time_unit::milliseconds, 100};
std::chrono::milliseconds d2{100};
duration d3{d2};
CAF_CHECK_EQUAL(d1.count, d2.count());
CAF_CHECK_EQUAL(d1.count, static_cast<uint64_t>(d2.count()));
CAF_CHECK_EQUAL(d1, d3);
}
......
......@@ -26,9 +26,6 @@
#include "caf/all.hpp"
#define ERROR_HANDLER \
[&](error& err) { CAF_FAIL(system.render(err)); }
using namespace caf;
namespace {
......
......@@ -49,7 +49,7 @@ bool equal_to(const T& t, const U& u) {
auto y = static_cast<long double>(u);
auto max = std::max(std::abs(x), std::abs(y));
auto dif = std::abs(x - y);
return dif <= max * 1e-5;
return dif <= max * 1e-5l;
}
template <class T, class U,
......
......@@ -47,7 +47,7 @@ std::istream& skip_to_next_line(std::istream& in) {
std::istream& skip_word(std::istream& in) {
skip_whitespaces(in);
auto nonspace = [](char x) { return isprint(x) && !isspace(x); };
while (nonspace(in.peek()))
while (nonspace(static_cast<char>(in.peek())))
in.get();
return in;
}
......
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