kunit: fix display of failed expectations for strings
PATCH 1/1 kunit: fix display of failed expectations for strings
Currently the following expectation
KUNIT_EXPECT_STREQ(test, "hi", "bye");
will produce:
Expected "hi" == "bye", but
"hi" == 1625079497
"bye" == 1625079500After this patch:
Expected "hi" == "bye", but
"hi" == hi
"bye" == byeKUNIT_INIT_BINARY_STR_ASSERT_STRUCT() was written but just mistakenly not actually used by KUNIT_EXPECT_STREQ() and friends.
Signed-off-by Daniel Latypov <[email protected]>
--- include/kunit/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/kunit/test.h +1 -1
@@ -1105,7 +1105,7 @@ do { \ KUNIT_ASSERTION(test, \ strcmp(__left, __right) op 0, \ kunit_binary_str_assert, \ - KUNIT_INIT_BINARY_ASSERT_STRUCT(test, \ + KUNIT_INIT_BINARY_STR_ASSERT_STRUCT(test, \ assert_type, \#op , \ #left, \
base-commit: 495023e4e49e4b7dee35928800bf0317276576c1
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
Quoted 10 lines · Daniel Latypov
Currently the following expectation
KUNIT_EXPECT_STREQ(test, "hi", "bye");
will produce:
Expected "hi" == "bye", but"hi" == 1625079497 "bye" == 1625079500After this patch:
Expected "hi" == "bye", but
Quoted 7 lines
"hi" == hi "bye" == bye
KUNIT_INIT_BINARY_STR_ASSERT_STRUCT()was written but just mistakenly not actually used byKUNIT_EXPECT_STREQ()and friends.Signed-off-by Daniel Latypov <[email protected]>
Reviewed-by Brendan Higgins <[email protected]>
Tested-by Brendan Higgins <[email protected]>