]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib/crc16_kunit.c: add KUnit tests for crc16
authorVinicius Peixoto <vpeixoto@lkcamp.dev>
Sat, 12 Oct 2024 07:43:49 +0000 (04:43 -0300)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 6 Nov 2024 01:12:31 +0000 (17:12 -0800)
commit5d042707089f0d0c49473d05250e4f319a71e1df
tree6dd6f2eec802c9f6a1ef8118bbe36e528efa1853
parenta9d38bcd7337f051912174ebfc500e1cef73982e
lib/crc16_kunit.c: add KUnit tests for crc16

Add Kunit tests for the kernel's implementation of the standard CRC-16
algorithm (<linux/crc16.h>).  The test data consists of 100
randomly-generated test cases, validated against a naive CRC-16
implementation.

This test follows roughly the same logic as lib/crc32test.c, but without
the performance measurements.

Link: https://lkml.kernel.org/r/20241012-crc16-kunit-v3-1-0ca75cb58ca9@lkcamp.dev
Signed-off-by: Vinicius Peixoto <vpeixoto@lkcamp.dev>
Co-developed-by: Enzo Bertoloti <ebertoloti@lkcamp.dev>
Signed-off-by: Enzo Bertoloti <ebertoloti@lkcamp.dev>
Co-developed-by: Fabricio Gasperin <fgasperin@lkcamp.dev>
Signed-off-by: Fabricio Gasperin <fgasperin@lkcamp.dev>
Suggested-by: David Laight <David.Laight@ACULAB.COM>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Rae Moar <rmoar@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/Kconfig.debug
lib/Makefile
lib/crc16_kunit.c [new file with mode: 0644]