test: Add a way to mock peers for SignalProxy-related test cases
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 4 Oct 2018 17:03:02 +0000 (19:03 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
commit7dee6df30bc997b3045ec0e20cdefdf8a70ba93e
treef209eaff8098ee62f8fb1b954ed3584d014e6b31
parent98ffecc6e97b208712c6f5c5da1b4ba10aa09333
test: Add a way to mock peers for SignalProxy-related test cases

Introduce a new mock class MockedPeer that allows for setting
expectations for dispatched Quassel protocol messages. Also provide
matchers to express such expectations in a straightforward way.

MockedPeer for now only supports SignalProxy messages; support for
authentication messages can be added later if needed. Note that
expectations can be set on the level of protocol messages, but things
like a testing a particular serialization, the use of network sockets,
or other lower-level implementation details are not supported, nor is
MockedPeer intended for such use cases (we'd expect specific tests for
specific peer types).
src/test/util/CMakeLists.txt
src/test/util/mockedpeer.cpp [new file with mode: 0644]
src/test/util/mockedpeer.h [new file with mode: 0644]