Re: [PATCH v6 3/8] iio: test: add kunit test for fixed-point parsing
From: Andy Shevchenko <hidden>
Date: 2026-02-03 15:38:49
Also in:
linux-devicetree, linux-iio, lkml
From: Andy Shevchenko <hidden>
Date: 2026-02-03 15:38:49
Also in:
linux-devicetree, linux-iio, lkml
On Fri, Jan 30, 2026 at 10:06:44AM +0000, Rodrigo Alencar via B4 Relay wrote:
Add kunit test cases that aims to verify expected behavior for iio_str_to_fixpoint() and iio_str_to_fixpoint64(). To run the test, create a .kunitconfig file with: CONFIG_KUNIT=y CONFIG_IIO=y CONFIG_IIO_FIXPOINT_PARSE_KUNIT_TEST=y and run the command: ./tools/testing/kunit/kunit.py run --kunitconfig=.kunitconfig
Thanks for the test cases! There are some nit-picks, otherwise Reviewed-by: Andy Shevchenko <redacted> ...
+#include <kunit/test.h>
+ errno.h // -ERANGE
+#include <linux/iio/iio.h>
+ limits.h // S32_MIN
+#include <linux/math.h>
+ types.h // s32 ...
+static struct kunit_suite iio_fixpoint_parse_test_suite = {
+ .name = "iio-fixpoint-parse",
+ .test_cases = iio_fixpoint_parse_test_cases,
+};+
Unneeded blank line.
+kunit_test_suite(iio_fixpoint_parse_test_suite);
-- With Best Regards, Andy Shevchenko