Skip to content

Commit

Permalink
Fix build on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Neverlord committed Jun 16, 2024
1 parent 3ddf595 commit 85336bf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
5 changes: 3 additions & 2 deletions libbroker/broker/convert.hh
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ template <class T>
std::enable_if_t<
detail::has_convert_v<T, std::string> // must have a convert function
&& !std::is_arithmetic_v<T> // avoid ambiguitiy with default overloads
&& !std::is_convertible_v<T, std::string>, // avoid ambiguity with
// conversion-to-string
&& !std::is_convertible_v<T, std::string> // avoid ambiguity with
// conversion-to-string
&& !std::is_same_v<T, std::string_view>,
std::ostream&>
operator<<(std::ostream& os, const T& x) {
std::string str;
Expand Down
2 changes: 1 addition & 1 deletion libbroker/broker/detail/sqlite_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ struct sqlite_backend::impl {
if (!detail::is_directory(dir) && !detail::mkdirs(dir)) {
log::store::error("sqlite-create-dir-failed",
"failed to create directory for database: {}",
dir.c_str());
dir.string());
return false;
}
}
Expand Down
21 changes: 11 additions & 10 deletions libbroker/broker/master.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ bool operator==(const string_list& xs, const pattern_list& ys) {
}

struct fixture : base_fixture {
string_list log;
string_list log_lines;
worker logger;

caf::timespan tick_interval = defaults::store::tick_interval;
Expand All @@ -100,11 +100,11 @@ struct fixture : base_fixture {
[this](data_message msg) {
auto content = get_data(msg).to_data();
if (auto insert = store_event::insert::make(content))
log.emplace_back(to_string(insert));
log_lines.emplace_back(to_string(insert));
else if (auto update = store_event::update::make(content))
log.emplace_back(to_string(update));
log_lines.emplace_back(to_string(update));
else if (auto erase = store_event::erase::make(content))
log.emplace_back(to_string(erase));
log_lines.emplace_back(to_string(erase));
else
FAIL("unknown event: " << to_string(content));
},
Expand Down Expand Up @@ -162,12 +162,13 @@ TEST(local_master) {
CHECK_EQUAL(unbox(ds.put_unique("bar", "unicorn")), data{false});
// check log
run(tick_interval);
CHECK_EQUAL(log, pattern_list({
"insert\\(foo, hello, world, (null|none), .+\\)",
"update\\(foo, hello, world, universe, (null|none), .+\\)",
"erase\\(foo, hello, .+\\)",
"insert\\(foo, bar, baz, .+\\)",
}));
CHECK_EQUAL(log_lines,
pattern_list({
"insert\\(foo, hello, world, (null|none), .+\\)",
"update\\(foo, hello, world, universe, (null|none), .+\\)",
"erase\\(foo, hello, .+\\)",
"insert\\(foo, bar, baz, .+\\)",
}));
// done
caf::anon_send_exit(core, caf::exit_reason::user_shutdown);
}
Expand Down

0 comments on commit 85336bf

Please sign in to comment.