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

Function test_avg_u8_16

examples/SIMD/simd_tests.cpp:159–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void test_avg_u8_16(TestResult& result) {
160 uint8_t a_data[16] = {100, 50, 200, 10, 100, 50, 200, 10, 100, 50, 200, 10, 100, 50, 200, 10};
161 uint8_t b_data[16] = {50, 100, 150, 20, 50, 100, 150, 20, 50, 100, 150, 20, 50, 100, 150, 20};
162 uint8_t expected[16] = {75, 75, 175, 15, 75, 75, 175, 15, 75, 75, 175, 15, 75, 75, 175, 15};
163 uint8_t output[16] = {0};
164
165 simd_u8x16 a = load_u8_16(a_data);
166 simd_u8x16 b = load_u8_16(b_data);
167 simd_u8x16 c = avg_u8_16(a, b);
168 store_u8_16(output, c);
169
170 if (!compare_u8_arrays(expected, output, 16)) {
171 result.fail("Average operation produced incorrect results");
172 }
173}
174
175void test_avg_round_u8_16(TestResult& result) {
176 uint8_t a_data[16] = {101, 51, 201, 11, 101, 51, 201, 11, 101, 51, 201, 11, 101, 51, 201, 11};

Callers

nothing calls this directly

Calls 2

compare_u8_arraysFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected