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

Function test_avg_round_u8_16

examples/SIMD/simd_tests.cpp:175–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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};
177 uint8_t b_data[16] = {50, 100, 150, 20, 50, 100, 150, 20, 50, 100, 150, 20, 50, 100, 150, 20};
178 uint8_t expected[16] = {76, 76, 176, 16, 76, 76, 176, 16, 76, 76, 176, 16, 76, 76, 176, 16};
179 uint8_t output[16] = {0};
180
181 simd_u8x16 a = load_u8_16(a_data);
182 simd_u8x16 b = load_u8_16(b_data);
183 simd_u8x16 c = avg_round_u8_16(a, b);
184 store_u8_16(output, c);
185
186 if (!compare_u8_arrays(expected, output, 16)) {
187 result.fail("Rounding average operation produced incorrect results");
188 }
189}
190
191// ============================================================================
192// Bitwise Tests

Callers

nothing calls this directly

Calls 2

compare_u8_arraysFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected