[Intel-wired-lan] [PATCH iwl-next 06/13] lib: packing: add KUnit tests adapted from selftests
Jacob Keller
jacob.e.keller at intel.com
Wed Aug 28 20:39:44 UTC 2024
On 8/28/2024 11:47 AM, Jeff Johnson wrote:
> On 8/27/24 14:52, Jacob Keller wrote:
>> Add 24 simple KUnit tests for the lib/packing.c pack() and unpack() APIs.
>>
>> The first 16 tests exercise all combinations of quirks with a simple magic
>> number value on a 16-byte buffer. The remaining 8 tests cover
>> non-multiple-of-4 buffer sizes.
>>
>> These tests were originally written by Vladimir as simple selftest
>> functions. I adapted them to KUnit, refactoring them into a table driven
>> approach. This will aid in adding additional tests in the future.
>>
>> Co-developed-by: Vladimir Oltean <vladimir.oltean at nxp.com>
>> Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
>> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
>> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel at intel.com>
>> ---
>> lib/packing_test.c | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> MAINTAINERS | 1 +
>> lib/Kconfig | 12 +++
>> lib/Makefile | 1 +
>> 4 files changed, 270 insertions(+)
>>
>> diff --git a/lib/packing_test.c b/lib/packing_test.c
>> new file mode 100644
>> index 000000000000..52e039e2231b
>> --- /dev/null
>> +++ b/lib/packing_test.c
> ...
>> +static struct kunit_suite packing_test_suite = {
>> + .name = "packing",
>> + .test_cases = packing_test_cases,
>> +};
>> +kunit_test_suite(packing_test_suite);
>> +
>> +MODULE_LICENSE("GPL");
>
> Since commit 1fffe7a34c89 ("script: modpost: emit a warning when the
> description is missing"), a module without a MODULE_DESCRIPTION() will
> result in a warning when built with make W=1. Recently, multiple
> developers have been eradicating these warnings treewide, and very few
> are left, so please don't introduce a new one :)
>
> Please add the missing MODULE_DESCRIPTION()
>
Yep, we caught this with our NIPA CI too. Will fix.
More information about the Intel-wired-lan
mailing list