| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include "../drivers/video/graphics.c" |
| 4 | |
| 5 | #include <libpayload.h> |
| 6 | #include <tests/test.h> |
| 7 | |
| 8 | static void test_lanczos(void **state) |
| 9 | { |
| 10 | /* This makes sure the `x` in lanczos_weight() becomes very small. This |
| 11 | test is mostly here to prove we won't end up dividing by zero. */ |
| 12 | fpmath_t x = lanczos_weight(fpisub(1, fpfrac(1, 1 << 30)), S0 + 1); |
| 13 | assert_true(fpequals(x, fp(1))); |
| 14 | } |
| 15 | |
| 16 | int main(void) |
| 17 | { |
| 18 | const struct CMUnitTest tests[] = { |
| 19 | cmocka_unit_test(test_lanczos), |
| 20 | }; |
| 21 | |
| 22 | return lp_run_group_tests(tests, NULL, NULL); |
| 23 | } |