# Re: \[PATCH net-next v2 06/10\] lib: packing: add KUnit tests adapted from selftests

- From: Vladimir Oltean \<vladimir.oltean@nxp.com\>
- Date: 2024-10-03 15:18:32 
- List: netdev
- Page: https://ratatoskr.run/netdev/2024/10/11307351
- Thread: https://ratatoskr.run/netdev/2024/10/11307241/t.md

```text
On Wed, Oct 02, 2024 at 02:51:55PM -0700, 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@nxp.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
```
