Skip to content

Commit

Permalink
Fix unit tests after arcus change
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Sep 30, 2024
1 parent f717195 commit 5303bfc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tests/arcus/MockSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ void MockSocket::reset()
{ /* Do nothing. */
}

void MockSocket::sendMessage(Arcus::MessagePtr message)
bool MockSocket::sendMessage(Arcus::MessagePtr message)
{
sent_messages.push_back(message);
return true;
}

Arcus::MessagePtr MockSocket::takeNextMessage()
Expand All @@ -45,4 +46,4 @@ Arcus::MessagePtr MockSocket::popMessageFromSendQueue()
return result;
}

} // namespace cura
} // namespace cura
7 changes: 4 additions & 3 deletions tests/arcus/MockSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
#ifndef MOCKSOCKET_H
#define MOCKSOCKET_H

#include <Arcus/Socket.h> //Inheriting from this to be able to swap this socket in the tested class.
#include <deque> //History of sent and received messages.

#include <Arcus/Socket.h> //Inheriting from this to be able to swap this socket in the tested class.

namespace cura
{

Expand All @@ -27,7 +28,7 @@ class MockSocket : public Arcus::Socket
void reset() override;

// Catch these functions so that we can see whether they are called.
void sendMessage(Arcus::MessagePtr message) override;
bool sendMessage(Arcus::MessagePtr message) override;
Arcus::MessagePtr takeNextMessage() override;

// Helpers to store send and received messages.
Expand All @@ -39,4 +40,4 @@ class MockSocket : public Arcus::Socket
// NOLINTEND(misc-non-private-member-variables-in-classes)
} // namespace cura

#endif // MOCKSOCKET_H
#endif // MOCKSOCKET_H

0 comments on commit 5303bfc

Please sign in to comment.