GCC Code Coverage Report


Directory: ./
File: channeloutput/stringtesters/PixelStringTester.cpp
Date: 2026-10-29 08:11:58
Exec Total Coverage
Lines: 7 14 50.0%
Functions: 1 2 50.0%
Branches: 8 14 57.1%

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 <vector>
16
17 #include "PixelStringTester.h"
18
19 #include "PixelCountStringTester.h"
20 #include "PixelFadeStringTester.h"
21 #include "PortNumberStringTester.h"
22 #include "../PixelString.h"
23
24 ✗ void PixelStringTester::fillInSmartReceiver(PixelString* ps, VirtualString& vs, uint8_t* inChannelData, uint32_t& offset, uint8_t*& outChannelData) const {
25 ✗ for (int x = 0; x < vs.pixelCount * vs.channelsPerNode(); ++x) {
26 ✗ int cn = ps->m_outputMap[offset];
27 ✗ const uint8_t* brightness = ps->m_brightnessMaps[offset++];
28 ✗ *outChannelData = brightness[inChannelData[cn]];
29 ✗ ++outChannelData;
30 }
31 ✗ }
32
33 3070 PixelStringTester* PixelStringTester::getPixelStringTester(int i) {
34 static std::vector<PixelStringTester*> TESTERS = {
35 nullptr, // 0 position is OFF
36 &OutputPortNumberPixelStringTester::INSTANCE,
37 &PixelCountPixelStringTester::INSTANCE_BYPORT,
38 &PixelCountPixelStringTester::INSTANCE_BYSTRING,
39 &PixelFadeStringTester::INSTANCE_RED,
40 &PixelFadeStringTester::INSTANCE_GREEN,
41 &PixelFadeStringTester::INSTANCE_BLUE,
42 &PixelFadeStringTester::INSTANCE_WHITE
43
4/8
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 3066 times.
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
3078 };
44
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 3067 times.
3070 if (i < TESTERS.size()) {
45 3 return TESTERS[i];
46 }
47
2/2
✓ Branch 0 taken 2946 times.
✓ Branch 1 taken 121 times.
3067 if (i == 999) {
48 2946 return &CurrentBasedPixelCountPixelStringTester::INSTANCE;
49 }
50 121 return nullptr;
51 }
52