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
TimeTests.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title TimeTests.cpp
3// \author T. Chieu
4// \brief cpp file for time tests
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#include "Fw/Time/Time.hpp"
14#include "STest/Pick/Pick.hpp"
15#include "test/ut/Tester.hpp"
16
17// ----------------------------------------------------------------------
18// Time test
19// ----------------------------------------------------------------------
20
21void Tester ::testTime() {
22 Fw::Time time(STest::Pick::any(), STest::Pick::any());
23 Fw::Time zero_time(TB_NONE, 0, 0);
24 Fw::Time result;
25
26 this->setTestTime(time);
27
28 result = component.getTime();
29 ASSERT_EQ(result, zero_time);
30
31 this->connectTimeGetOut();
32 ASSERT_TRUE(component.isConnected_timeGetOut_OutputPort(0));
33
34 result = component.getTime();
35 ASSERT_EQ(result, time);
36
37 this->connectSpecialPortsSerial();
38 ASSERT_TRUE(component.isConnected_timeGetOut_OutputPort(0));
39
40 result = component.getTime();
41 ASSERT_EQ(result, time);
42}
@ TB_NONE
No time base has been established.
Definition FpConfig.h:39