F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
PortTest.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title PortTest.hpp
3// \author T. Chieu
4// \brief hpp file for PortTest class
5//
6// \copyright
7// Copyright (C) 2009-2023 California Institute of Technology.
8// ALL RIGHTS RESERVED. United States Government Sponsorship
9// acknowledged.
10//
11// ======================================================================
12
13#ifndef FPP_TEST_PORT_TEST_HPP
14#define FPP_TEST_PORT_TEST_HPP
15
16#include "test/ut/Tester.hpp"
17#include "FppTest/port/TypedPortIndexEnumAc.hpp"
18
19#include "gtest/gtest.h"
20
21// Typed port tests
22template <typename PortType>
23class TypedPortTest : public ::testing::Test {
24protected:
25 Tester tester;
26 PortType port;
27};
28
30
32 this->tester.invoke(TypedPortIndex::TYPED, this->port);
33 this->tester.check_history(this->port);
34}
35
37 TypedPort
38);
39
40// Serial port tests
41template <typename PortType>
42class SerialPortTest : public ::testing::Test {
43protected:
44 Tester tester;
45 PortType port;
46};
47
49
51 this->tester.invoke(TypedPortIndex::SERIAL, this->port);
52 this->tester.check_serial(this->port);
53}
54
55TYPED_TEST_P(SerialPortTest, FromSerialTest) {
56 this->tester.invoke_serial(TypedPortIndex::SERIAL, this->port);
57 this->tester.check_history(this->port);
58}
59
61 ToSerialTest,
62 FromSerialTest
63);
64
65#endif
REGISTER_TYPED_TEST_SUITE_P(TypedPortTest, TypedPort)
TYPED_TEST_P(TypedPortTest, TypedPort)
Definition PortTest.hpp:31
TYPED_TEST_SUITE_P(TypedPortTest)
PortType port
Definition PortTest.hpp:45
Tester tester
Definition PortTest.hpp:25
PortType port
Definition PortTest.hpp:26