GCC Code Coverage Report


Directory: ./
File: channeloutput/stringtesters/PortNumberStringTester.cpp
Date: 2026-12-01 12:27:28
Exec Total Coverage
Lines: 40 43 93.0%
Functions: 1 1 100.0%
Branches: 27 39 69.2%

Line Branch Exec Source
1 /*
2 * This file is part of the Falcon Player (FPP) and is Copyright (C)
3 * 2013-2022 by the Falcon Player Developers.
4 *
5 * The Falcon Player (FPP) is free software, and is covered under
6 * multiple Open Source licenses. Please see the included 'LICENSES'
7 * file for descriptions of what files are covered by each license.
8 *
9 * This source file is covered under the GPL v2 as described in the
10 * included LICENSE.GPL file.
11 */
12
13 #include "fpp-pch.h"
14
15 #include "PortNumberStringTester.h"
16 #include "../PixelString.h"
17
18 62 uint8_t* OutputPortNumberPixelStringTester::createTestData(PixelString* ps, int cycleCount, float percentOfCycle, uint8_t* inChannelData, uint32_t& newLen) {
19 62 newLen = ps->m_outputBytes;
20 62 uint8_t* data = ps->m_outputBuffer;
21 62 uint8_t* out = ps->pixelDataStart();
22 62 uint32_t inCh = 0;
23 unsigned char clr[3];
24
3/3
✓ Branch 0 taken 22 times.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 20 times.
62 switch (cycleCount % 3) {
25 22 case 0:
26 22 clr[2] = clr[1] = 0;
27 22 clr[0] = 255;
28 22 break;
29 20 case 1:
30 20 clr[0] = clr[2] = 0;
31 20 clr[1] = 255;
32 20 break;
33 20 default:
34 20 clr[0] = clr[1] = 0;
35 20 clr[2] = 255;
36 20 break;
37 }
38 62 int curPixel = 0;
39
2/2
✓ Branch 0 taken 62 times.
✓ Branch 1 taken 62 times.
124 for (auto& vs : ps->m_virtualStrings) {
40
1/2
✓ Branch 0 taken 62 times.
✗ Branch 1 not taken.
62 if (vs.receiverNum == -1) {
41
3/4
✓ Branch 0 taken 68 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✓ Branch 3 taken 62 times.
68 for (int x = 0; x < vs.startNulls * vs.channelsPerNode(); ++x) {
42 6 *out++ = 0;
43 }
44
2/2
✓ Branch 0 taken 254 times.
✓ Branch 1 taken 62 times.
316 for (int x = 0; x < vs.pixelCount; ++x) {
45
2/2
✓ Branch 0 taken 62 times.
✓ Branch 1 taken 192 times.
254 if (curPixel <= ps->m_portNumber) {
46 62 uint8_t brightness = vs.brightnessMap[255];
47
3/4
✓ Branch 0 taken 248 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 186 times.
✓ Branch 3 taken 62 times.
248 for (int y = 0; y < vs.channelsPerNode(); ++y) {
48 186 *out = brightness;
49 186 ++out;
50 186 ++inCh;
51 }
52 } else {
53
2/4
✓ Branch 0 taken 192 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 192 times.
192 if (vs.colorOrder.whiteOffset() == 0) {
54 ✗ ++out;
55 }
56
3/4
✓ Branch 0 taken 768 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 576 times.
✓ Branch 3 taken 192 times.
768 for (int y = 0; y < std::min(vs.channelsPerNode(), 3); ++y) {
57 576 *out = vs.brightnessMap[clr[y]];
58 576 out++;
59 }
60
2/4
✓ Branch 0 taken 192 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 192 times.
192 if (vs.colorOrder.whiteOffset() == 3) {
61 ✗ ++out;
62 }
63
1/2
✓ Branch 0 taken 192 times.
✗ Branch 1 not taken.
192 inCh += vs.channelsPerNode();
64 }
65 254 ++curPixel;
66 }
67
3/4
✓ Branch 0 taken 65 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 62 times.
65 for (int x = 0; x < vs.endNulls * vs.channelsPerNode(); ++x) {
68 3 *out++ = 0;
69 }
70 } else {
71 ✗ fillInSmartReceiver(ps, vs, inChannelData, inCh, out);
72 }
73 }
74 62 return data;
75 }
76
77 OutputPortNumberPixelStringTester OutputPortNumberPixelStringTester::INSTANCE;
78