MCPcopy Create free account
hub / github.com/FastLED/FastLED / FL_TEST_FILE

Function FL_TEST_FILE

tests/fl/channels/validation.cpp:8–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "fl/channels/validation.h"
7
8FL_TEST_FILE(FL_FILEPATH) {
9
10using namespace fl;
11
12// Basic test configuration
13SingleTestConfig makeBasicConfig() {
14 SingleTestConfig config;
15 config.driver_name = "PARLIO";
16 config.lane_sizes = {100};
17 config.pattern = "MSB_LSB_A";
18 config.iterations = 1;
19 config.pin_tx = 1;
20 config.pin_rx = 0;
21 return config;
22}
23
24FL_TEST_CASE("Basic configuration succeeds") {
25 SingleTestConfig config = makeBasicConfig();
26 SingleTestResult result = runSingleValidationTest(config);
27
28 FL_CHECK(result.success);
29 FL_CHECK(result.driver == "PARLIO");
30 FL_CHECK(result.lane_count == 1);
31 FL_CHECK(result.lane_sizes.size() == 1u);
32 FL_CHECK(result.lane_sizes[0] == 100);
33}
34
35FL_TEST_CASE("Multi-lane configuration") {
36 SingleTestConfig config = makeBasicConfig();
37 config.lane_sizes = {100, 200, 150};
38
39 SingleTestResult result = runSingleValidationTest(config);
40
41 FL_CHECK(result.success);
42 FL_CHECK(result.lane_count == 3);
43 FL_CHECK(result.lane_sizes.size() == 3u);
44 FL_CHECK(result.lane_sizes[0] == 100);
45 FL_CHECK(result.lane_sizes[1] == 200);
46 FL_CHECK(result.lane_sizes[2] == 150);
47}
48
49FL_TEST_CASE("Invalid lane count - 0 lanes") {
50 SingleTestConfig config = makeBasicConfig();
51 config.lane_sizes.clear();
52
53 SingleTestResult result = runSingleValidationTest(config);
54
55 FL_CHECK_FALSE(result.success);
56 FL_CHECK(result.error_message.has_value());
57}
58
59FL_TEST_CASE("Invalid lane count - more than 16 lanes") {
60 SingleTestConfig config = makeBasicConfig();
61 config.lane_sizes = {
62 100, 100, 100, 100, 100, 100, 100, 100, 100,
63 100, 100, 100, 100, 100, 100, 100, 100}; // 17 lanes
64
65 SingleTestResult result = runSingleValidationTest(config);

Callers

nothing calls this directly

Calls 6

makeBasicConfigFunction · 0.85
runSingleValidationTestFunction · 0.85
sizeMethod · 0.45
clearMethod · 0.45
has_valueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected