GCC Code Coverage Report


Directory: ./
File: Fw/Test/String.hpp
Date: 2026-09-23 21:11:01
Exec Total Coverage
Lines: 11 11 100.0%
Functions: 7 7 100.0%
Branches: 3 3 100.0%

Line Branch Exec Source
1 // ======================================================================
2 // @file Test/String.hpp
3 // @author F Prime
4 // @brief A longer string for testing
5 // ======================================================================
6
7 #ifndef FW_TEST_STRING_HPP
8 #define FW_TEST_STRING_HPP
9
10 #include <Fw/FPrimeBasicTypes.hpp>
11
12 #include "Fw/Types/StringBase.hpp"
13
14 namespace Test {
15
16 class String : public Fw::StringBase {
17 public:
18 enum {
19 STRING_SIZE = 256,
20 SERIALIZED_SIZE = STATIC_SERIALIZED_SIZE(STRING_SIZE),
21 };
22
23
1/1
✓ Branch 11 taken 1 times.
1 String() : StringBase() { *this = ""; }
24
25
1/1
✓ Branch 11 taken 1 times.
1 String(const String& src) : StringBase() { *this = src; }
26
27 String(const ConstStringBase& src) : StringBase() { *this = src; }
28
29
1/1
✓ Branch 11 taken 1 times.
1 String(const char* src) : StringBase() { *this = src; }
30
31 2 String& operator=(const String& src) {
32 2 (void)StringBase::operator=(src);
33 2 return *this;
34 }
35
36 String& operator=(const ConstStringBase& src) {
37 (void)StringBase::operator=(src);
38 return *this;
39 }
40
41 3 String& operator=(const char* src) {
42 3 (void)StringBase::operator=(src);
43 3 return *this;
44 }
45
46 9 const char* toChar() const { return this->m_buf; }
47
48 5 StringBase::SizeType getCapacity() const { return sizeof this->m_buf; }
49
50 private:
51 char m_buf[BUFFER_SIZE(STRING_SIZE)];
52 };
53 } // namespace Test
54
55 #endif
56