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

Fix build and unit test failures

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