Commit 9b40c088 authored by Dominik Charousset's avatar Dominik Charousset

Fix build and unit test failures

parent 0f92232c
......@@ -49,17 +49,20 @@ public:
static constexpr bool writes_state = false;
template <class... Ts>
auto operator()(Ts&&... xs) {
using result_type = typename Subtype::result_type;
if constexpr (std::is_same<result_type, void>::value) {
auto dummy = unit;
static_cast<void>((try_apply(dummy, xs) && ...));
} else {
typename Subtype::result_type result;
static_cast<void>((try_apply(result, xs) && ...));
return result;
}
template <class Sub = Subtype, class... Ts>
std::enable_if_t<std::is_same<typename Sub::result_type, void>::value>
operator()(Ts&&... xs) {
auto dummy = unit;
static_cast<void>((try_apply(dummy, xs) && ...));
}
template <class Sub = Subtype, class... Ts>
std::enable_if_t<!std::is_same<typename Sub::result_type, void>::value,
typename Sub::result_type>
operator()(Ts&&... xs) {
auto result = typename Sub::result_type{};
static_cast<void>((try_apply(result, xs) && ...));
return result;
}
private:
......
......@@ -112,7 +112,7 @@ struct fixture {
# define NAMED_ACTOR_STATE(type) \
struct type##_state { \
const char* name = #type; \
static inline const char* name = #type; \
}
NAMED_ACTOR_STATE(bar);
......
......@@ -99,14 +99,14 @@ public:
// nop
}
void
before_sending(const local_actor& self, mailbox_element& element) override {
void before_sending(const local_actor& self,
mailbox_element& element) override {
element.tracing_id.reset(new dummy_tracing_data(self.name()));
}
void
before_sending_scheduled(const local_actor& self, actor_clock::time_point,
mailbox_element& element) override {
void before_sending_scheduled(const local_actor& self,
actor_clock::time_point,
mailbox_element& element) override {
element.tracing_id.reset(new dummy_tracing_data(self.name()));
}
};
......@@ -154,7 +154,7 @@ const std::string& tracing_id(local_actor* self) {
# define NAMED_ACTOR_STATE(type) \
struct type##_state { \
const char* name = #type; \
static inline const char* name = #type; \
}
NAMED_ACTOR_STATE(alice);
......
......@@ -79,7 +79,7 @@ CAF_TEST(the prometheus broker responds to HTTP get requests) {
"Content-Type: text/plain\r\n"
"Connection: Closed\r\n\r\n";
CAF_CHECK(starts_with(response, ok_header));
CAF_CHECK(contains(response, "\ncaf_running_actors 2 "));
CAF_CHECK(contains(response, "\ncaf_system_running_actors 2 "));
if (detail::prometheus_broker::has_process_metrics()) {
CAF_CHECK(contains(response, "\nprocess_cpu_seconds_total "));
CAF_CHECK(contains(response, "\nprocess_resident_memory_bytes "));
......
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