WSL2-Linux-Kernel/lib/kunit
Daniel Latypov a8495ad8e9 kunit: remove format func from struct kunit_assert, get it to 0 bytes
Each calll to a KUNIT_EXPECT_*() macro creates a local variable which
contains a struct kunit_assert.

Normally, we'd hope the compiler would be able to optimize this away,
but we've seen cases where it hasn't, see
https://groups.google.com/g/kunit-dev/c/i3fZXgvBrfA/m/GbrMNej2BAAJ.

In changes like commit 21957f90b2 ("kunit: split out part of
kunit_assert into a static const"), we've moved more and more parts out
of struct kunit_assert and its children types (kunit_binary_assert).

This patch removes the final field and gets us to:
  sizeof(struct kunit_assert) == 0
  sizeof(struct kunit_binary_assert) == 24 (on UML x86_64).

This also reduces the amount of macro plumbing going on at the cost of
passing in one more arg to the base KUNIT_ASSERTION macro and
kunit_do_failed_assertion().

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-10-07 10:16:38 -06:00
..
.kunitconfig
Kconfig kunit: add kunit.enable to enable/disable KUnit test 2022-09-30 13:17:39 -06:00
Makefile
assert.c
debugfs.c
debugfs.h
executor.c kunit: add kunit.enable to enable/disable KUnit test 2022-09-30 13:17:39 -06:00
executor_test.c kunit: flatten kunit_suite*** to kunit_suite** in .kunit_test_suites 2022-07-11 17:13:15 -06:00
kunit-example-test.c
kunit-test.c kunit: make kunit_kfree() only work on pointers from kunit_malloc() and friends 2022-10-07 10:15:44 -06:00
resource.c
string-stream-test.c
string-stream.c kunit: drop test pointer in string_stream_fragment 2022-10-07 10:15:33 -06:00
string-stream.h kunit: drop test pointer in string_stream_fragment 2022-10-07 10:15:33 -06:00
test.c kunit: remove format func from struct kunit_assert, get it to 0 bytes 2022-10-07 10:16:38 -06:00
try-catch-impl.h
try-catch.c