linux/lib/kunit
Richard Fitzgerald 1bddcf77ce kunit: test: Avoid cast warning when adding kfree() as an action
In kunit_log_test() pass the kfree_wrapper() function to kunit_add_action()
instead of directly passing kfree().

This prevents a cast warning:

lib/kunit/kunit-test.c:565:25: warning: cast from 'void (*)(const void *)'
to 'kunit_action_t *' (aka 'void (*)(void *)') converts to incompatible
function type [-Wcast-function-type-strict]

   564		full_log = string_stream_get_string(test->log);
 > 565		kunit_add_action(test, (kunit_action_t *)kfree, full_log);

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311070041.kWVYx7YP-lkp@intel.com/
Fixes: 05e2006ce4 ("kunit: Use string_stream for test log")
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-11-14 13:01:57 -07:00
..
.kunitconfig
Kconfig
Makefile
assert.c kunit: Don't use a managed alloc in is_literal() 2023-09-18 10:45:30 -06:00
attributes.c
debugfs.c kunit: Use string_stream for test log 2023-09-18 10:45:53 -06:00
debugfs.h
executor.c kunit: Fix possible memory leak in kunit_filter_suites() 2023-09-28 08:51:02 -06:00
executor_test.c kunit: test: Fix the possible memory leak in executor_test 2023-09-28 08:51:07 -06:00
hooks-impl.h
hooks.c
kunit-example-test.c kunit: Reset test status on each param iteration 2023-09-18 10:46:56 -06:00
kunit-test.c kunit: test: Avoid cast warning when adding kfree() as an action 2023-11-14 13:01:57 -07:00
resource.c
static_stub.c
string-stream-test.c kunit: string-stream: Test performance of string_stream 2023-09-18 10:45:59 -06:00
string-stream.c kunit: string-stream: Add tests for freeing resource-managed string_stream 2023-09-18 10:45:46 -06:00
string-stream.h kunit: string-stream: Decouple string_stream from kunit 2023-09-18 10:45:40 -06:00
test.c kunit: Reset suite counter right before running tests 2023-11-14 13:01:47 -07:00
try-catch-impl.h
try-catch.c