Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/msg/detail/indexed_handler_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ struct indexed_handler : handler_interface<MsgBase, ExtraCallbackArgs...> {
std::logical_or{}, false, callback_candidates);

if (not handled) {
CIB_ERROR("None of the registered callbacks claimed this message.");
CIB_ERROR(
"None of the registered callbacks ({}) claimed this message.",
sc::uint_<stdx::tuple_size_v<Callbacks>>);
}
return handled;
}
Expand Down
5 changes: 4 additions & 1 deletion include/msg/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <log/log.hpp>
#include <msg/handler_interface.hpp>
#include <sc/fwd.hpp>

#include <stdx/tuple_algorithms.hpp>

Expand All @@ -27,7 +28,9 @@ struct handler : handler_interface<MsgBase, ExtraCallbackArgs...> {
},
callbacks);
if (!found_valid_callback) {
CIB_ERROR("None of the registered callbacks claimed this message:");
CIB_ERROR(
"None of the registered callbacks ({}) claimed this message:",
sc::uint_<stdx::tuple_size_v<Callbacks>>);
stdx::for_each([&](auto &callback) { callback.log_mismatch(msg); },
callbacks);
}
Expand Down
2 changes: 1 addition & 1 deletion test/msg/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ TEST_CASE("log mismatch when no match", "[handler]") {
CHECK(not handler.handle(msg));
CAPTURE(log_buffer);
CHECK(log_buffer.find(
"None of the registered callbacks claimed this message") !=
"None of the registered callbacks (0) claimed this message") !=
std::string::npos);
}

Expand Down
2 changes: 1 addition & 1 deletion test/msg/handler_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ TEST_CASE("match output failure", "[handler_builder]") {

CAPTURE(log_buffer);
CHECK(log_buffer.find(
"None of the registered callbacks claimed this message") !=
"None of the registered callbacks (1) claimed this message") !=
std::string::npos);
CHECK(log_buffer.find("cb") != std::string::npos);
CHECK(log_buffer.find("id (0x81) == 0x80") != std::string::npos);
Expand Down
3 changes: 2 additions & 1 deletion test/msg/indexed_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ TEST_CASE("match output failure", "[indexed_builder]") {

CHECK(not cib::service<test_service>->handle(
test_msg_t{"test_id_field"_field = 0x81}));
CAPTURE(log_buffer);
CHECK(log_buffer.find(
"None of the registered callbacks claimed this message") !=
"None of the registered callbacks (1) claimed this message") !=
std::string::npos);
}

Expand Down
Loading