blob: c4a380ced8fce4e7645077c695aa8eabc68955e1 [file] [log] [blame]
Tomáš Pecka74b885f2020-06-06 20:02:41 +02001/*
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áš Pecka261c8862020-11-05 11:23:08 +01009#include "health/inputs/AbstractInput.h"
10#include "health/manager/AbstractManager.h"
Tomáš Pecka74b885f2020-06-06 20:02:41 +020011
Tomáš Pecka261c8862020-11-05 11:23:08 +010012class ManuallyInvokableInput : public velia::health::AbstractInput {
Tomáš Pecka74b885f2020-06-06 20:02:41 +020013public:
Tomáš Pecka261c8862020-11-05 11:23:08 +010014 using velia::health::AbstractInput::AbstractInput;
Tomáš Pecka74b885f2020-06-06 20:02:41 +020015
Tomáš Pecka261c8862020-11-05 11:23:08 +010016 void invokeChangeState(velia::health::State s)
Tomáš Pecka74b885f2020-06-06 20:02:41 +020017 {
18 updateState(s);
19 }
20};
21
22struct FakeOutput {
23public:
Tomáš Pecka261c8862020-11-05 11:23:08 +010024 MAKE_MOCK1(update, void(velia::health::State));
Tomáš Pecka74b885f2020-06-06 20:02:41 +020025};
26
Tomáš Pecka261c8862020-11-05 11:23:08 +010027#define REQUIRE_STATE_OUTPUT(STATE) REQUIRE_CALL(*o1, update(velia::health::State::STATE)).IN_SEQUENCE(seq1)
Tomáš Pecka0a2e8902020-06-09 21:11:20 +020028
Tomáš Pecka261c8862020-11-05 11:23:08 +010029class FakeManager : public velia::health::AbstractManager {
Tomáš Pecka0a2e8902020-06-09 21:11:20 +020030public:
Tomáš Pecka261c8862020-11-05 11:23:08 +010031 MAKE_MOCK2(updateState, void(void*, velia::health::State), override);
32 MAKE_MOCK2(registerInput, void(void*, velia::health::State), override);
Tomáš Pecka0a2e8902020-06-09 21:11:20 +020033 MAKE_MOCK1(unregisterInput, void(void*), override);
34};