Tomáš Pecka | 74b885f | 2020-06-06 20:02:41 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 CESNET, https://photonics.cesnet.cz/ |
| 3 | * |
| 4 | * Written by Tomáš Pecka <tomas.pecka@fit.cvut.cz> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include "trompeloeil_doctest.h" |
Tomáš Pecka | 261c886 | 2020-11-05 11:23:08 +0100 | [diff] [blame] | 9 | #include "health/inputs/AbstractInput.h" |
| 10 | #include "health/manager/AbstractManager.h" |
Tomáš Pecka | 74b885f | 2020-06-06 20:02:41 +0200 | [diff] [blame] | 11 | |
Tomáš Pecka | 261c886 | 2020-11-05 11:23:08 +0100 | [diff] [blame] | 12 | class ManuallyInvokableInput : public velia::health::AbstractInput { |
Tomáš Pecka | 74b885f | 2020-06-06 20:02:41 +0200 | [diff] [blame] | 13 | public: |
Tomáš Pecka | 261c886 | 2020-11-05 11:23:08 +0100 | [diff] [blame] | 14 | using velia::health::AbstractInput::AbstractInput; |
Tomáš Pecka | 74b885f | 2020-06-06 20:02:41 +0200 | [diff] [blame] | 15 | |
Tomáš Pecka | 261c886 | 2020-11-05 11:23:08 +0100 | [diff] [blame] | 16 | void invokeChangeState(velia::health::State s) |
Tomáš Pecka | 74b885f | 2020-06-06 20:02:41 +0200 | [diff] [blame] | 17 | { |
| 18 | updateState(s); |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | struct FakeOutput { |
| 23 | public: |
Tomáš Pecka | 261c886 | 2020-11-05 11:23:08 +0100 | [diff] [blame] | 24 | MAKE_MOCK1(update, void(velia::health::State)); |
Tomáš Pecka | 74b885f | 2020-06-06 20:02:41 +0200 | [diff] [blame] | 25 | }; |
| 26 | |
Tomáš Pecka | 261c886 | 2020-11-05 11:23:08 +0100 | [diff] [blame] | 27 | #define REQUIRE_STATE_OUTPUT(STATE) REQUIRE_CALL(*o1, update(velia::health::State::STATE)).IN_SEQUENCE(seq1) |
Tomáš Pecka | 0a2e890 | 2020-06-09 21:11:20 +0200 | [diff] [blame] | 28 | |
Tomáš Pecka | 261c886 | 2020-11-05 11:23:08 +0100 | [diff] [blame] | 29 | class FakeManager : public velia::health::AbstractManager { |
Tomáš Pecka | 0a2e890 | 2020-06-09 21:11:20 +0200 | [diff] [blame] | 30 | public: |
Tomáš Pecka | 261c886 | 2020-11-05 11:23:08 +0100 | [diff] [blame] | 31 | MAKE_MOCK2(updateState, void(void*, velia::health::State), override); |
| 32 | MAKE_MOCK2(registerInput, void(void*, velia::health::State), override); |
Tomáš Pecka | 0a2e890 | 2020-06-09 21:11:20 +0200 | [diff] [blame] | 33 | MAKE_MOCK1(unregisterInput, void(void*), override); |
| 34 | }; |