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

Function test_sub_sat_u8_16

examples/SIMD/simd_tests.cpp:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void test_sub_sat_u8_16(TestResult& result) {
78 uint8_t a_data[16] = {100, 50, 200, 10, 100, 50, 200, 10, 100, 50, 200, 10, 100, 50, 200, 10};
79 uint8_t b_data[16] = {50, 100, 50, 100, 50, 100, 50, 100, 50, 100, 50, 100, 50, 100, 50, 100};
80 uint8_t expected[16] = {50, 0, 150, 0, 50, 0, 150, 0, 50, 0, 150, 0, 50, 0, 150, 0};
81 uint8_t output[16] = {0};
82
83 simd_u8x16 a = load_u8_16(a_data);
84 simd_u8x16 b = load_u8_16(b_data);
85 simd_u8x16 c = sub_sat_u8_16(a, b);
86 store_u8_16(output, c);
87
88 if (!compare_u8_arrays(expected, output, 16)) {
89 result.fail("Saturating subtract produced incorrect results");
90 }
91}
92
93void test_scale_u8_16(TestResult& result) {
94 uint8_t input[16] = {255, 128, 64, 32, 255, 128, 64, 32, 255, 128, 64, 32, 255, 128, 64, 32};

Callers

nothing calls this directly

Calls 2

compare_u8_arraysFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected