GCC Code Coverage Report


Directory: lib/fprime-samd/fprime-samd/Svc/ProcTime/
File: ProcTime.cpp
Date: 2026-10-20 16:44:33
Exec Total Coverage
Lines: 12 12 100.0%
Functions: 3 3 100.0%
Branches: 10 10 100.0%

Line Branch Exec Source
1 // ======================================================================
2 // \title ProcTime.cpp
3 // \author tumbar
4 // \brief cpp file for ProcTime component implementation class
5 // ======================================================================
6
7 #include "fprime-samd/Svc/ProcTime/ProcTime.hpp"
8 #include "Fw/Time/Time.hpp"
9 #include "Fw/Time/TimeInterval.hpp"
10 #include "Fw/Types/Assert.hpp"
11 #include "Os/RawTime.hpp"
12 #include "config/OsSelection.hpp"
13
14 namespace Samd21 {
15
16 // ----------------------------------------------------------------------
17 // Component construction and destruction
18 // ----------------------------------------------------------------------
19
20 3 ProcTime::ProcTime(const char* const compName) : ProcTimeComponentBase(compName) {}
21
22 6 ProcTime::~ProcTime() {}
23
24 // ----------------------------------------------------------------------
25 // Handler implementations for typed input ports
26 // ----------------------------------------------------------------------
27
28 103 void ProcTime::getTime_handler(FwIndexType portNum, Fw::Time& time) {
29
1/1
✓ Branch 2 taken 103 times.
103 Os::RawTime now;
30
1/1
✓ Branch 2 taken 103 times.
103 auto status = now.now();
31 103 FW_ASSERT(status == Os::RawTimeInterface::Status::OP_OK, status);
32
33
1/1
✓ Branch 2 taken 103 times.
103 const Os::RawTime ref_time;
34
35
1/1
✓ Branch 2 taken 103 times.
103 Fw::TimeInterval proc_time;
36
1/1
✓ Branch 2 taken 103 times.
103 status = now.getTimeInterval(ref_time, proc_time);
37 103 FW_ASSERT(status == Os::RawTimeInterface::Status::OP_OK, status);
38
39
5/5
✓ Branch 3 taken 103 times.
✓ Branch 7 taken 103 times.
✓ Branch 11 taken 103 times.
✓ Branch 14 taken 103 times.
✓ Branch 21 taken 103 times.
103 time = Fw::Time(TimeBase::TB_PROC_TIME, proc_time.getSeconds(), proc_time.getUSeconds());
40 206 }
41
42 } // namespace Samd21
43