mirror of
https://github.com/nasa/fprime.git
synced 2026-04-12 05:19:03 -05:00
* Adding implementation in CMake and documentation * Spelling and engaging actions for refactor/osal branch * Adding CMake unit test for implementations and overrides * Review fixes * Fixing broken deployment UT sets * Corrections for cmake UTs * Removing long-running feature branch * sp * Correcting FppTest failures * Review feedback fixes
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
// ======================================================================
|
|
// \title TimeTests.cpp
|
|
// \author T. Chieu
|
|
// \brief cpp file for time tests
|
|
//
|
|
// \copyright
|
|
// Copyright (C) 2009-2023 California Institute of Technology.
|
|
// ALL RIGHTS RESERVED. United States Government Sponsorship
|
|
// acknowledged.
|
|
//
|
|
// ======================================================================
|
|
|
|
#include "Fw/Time/Time.hpp"
|
|
#include "STest/Pick/Pick.hpp"
|
|
#include "Tester.hpp"
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Time test
|
|
// ----------------------------------------------------------------------
|
|
|
|
void Tester ::testTime() {
|
|
Fw::Time time(STest::Pick::any(), STest::Pick::any());
|
|
Fw::Time zero_time(TB_NONE, 0, 0);
|
|
Fw::Time result;
|
|
|
|
this->setTestTime(time);
|
|
|
|
result = component.getTime();
|
|
ASSERT_EQ(result, zero_time);
|
|
|
|
this->connectTimeGetOut();
|
|
ASSERT_TRUE(component.isConnected_timeGetOut_OutputPort(0));
|
|
|
|
result = component.getTime();
|
|
ASSERT_EQ(result, time);
|
|
|
|
this->connectSpecialPortsSerial();
|
|
ASSERT_TRUE(component.isConnected_timeGetOut_OutputPort(0));
|
|
|
|
result = component.getTime();
|
|
ASSERT_EQ(result, time);
|
|
}
|