Skip to content

Commit

Permalink
fixup! chore: fix some issues pointed by the sonarcloud linter
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurmco committed Jul 31, 2024
1 parent ff02428 commit d7557d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 5 additions & 2 deletions include/cloysterhpc/messagebus.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MessageReply {
}

explicit MessageReply(std::any&& reply)
: m_base_reply(std::move(reply))
: m_base_reply(reply)
{
}

Expand Down Expand Up @@ -81,7 +81,10 @@ class MessageBusMethod {
virtual MessageReply callMethod() = 0;

public:
void addParams() { }
void addParams()
{
// end case for the variadic template below
}

template <typename T, typename... Ts> void addParams(T param, Ts... params)
{
Expand Down
3 changes: 1 addition & 2 deletions include/testing/test_message_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ class TestMessageBus : public MessageBus {

void registerCall(FunctionStore s, FunctionParameters p)
{
auto count = this->callCount(s);
m_functions[makeStoreName(s)].push_back(p);
}

public:
std::unique_ptr<MessageBusMethod> method(
std::string interface, std::string method);

void dump() const;
[[maybe_unused]] void dump() const;

unsigned callCount(FunctionStore s) const;
FunctionParameters calledWith(FunctionStore s, unsigned index) const;
Expand Down
4 changes: 2 additions & 2 deletions test/test_message_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ std::unique_ptr<MessageBusMethod> TestMessageBus::method(
MessageReply TestMessageMethod::callMethod()
{
m_bus->registerCall(m_store, m_params);
return MessageReply(
std::make_any<sdbus::ObjectPath>(sdbus::ObjectPath("123")));
auto reply = std::make_any<sdbus::ObjectPath>(sdbus::ObjectPath("123"));
return MessageReply(std::move(reply));
}

0 comments on commit d7557d9

Please sign in to comment.