linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kunit: fix display of failed expectations for strings
@ 2020-11-02 23:23 Daniel Latypov
  2020-11-05 16:05 ` Brendan Higgins
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Latypov @ 2020-11-02 23:23 UTC (permalink / raw)
  To: brendanhiggins
  Cc: davidgow, linux-kernel, linux-kselftest, skhan, Daniel Latypov

Currently the following expectation
  KUNIT_EXPECT_STREQ(test, "hi", "bye");
will produce:
  Expected "hi" == "bye", but
      "hi" == 1625079497
      "bye" == 1625079500

After this patch:
  Expected "hi" == "bye", but
      "hi" == hi
      "bye" == bye

KUNIT_INIT_BINARY_STR_ASSERT_STRUCT() was written but just mistakenly
not actually used by KUNIT_EXPECT_STREQ() and friends.

Signed-off-by: Daniel Latypov <dlatypov@google.com>
---
 include/kunit/test.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/kunit/test.h b/include/kunit/test.h
index 9197da792336..2c1553105958 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -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
-- 
2.29.1.341.ge80a0c044ae-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kunit: fix display of failed expectations for strings
  2020-11-02 23:23 [PATCH] kunit: fix display of failed expectations for strings Daniel Latypov
@ 2020-11-05 16:05 ` Brendan Higgins
  0 siblings, 0 replies; 2+ messages in thread
From: Brendan Higgins @ 2020-11-05 16:05 UTC (permalink / raw)
  To: Daniel Latypov
  Cc: David Gow, Linux Kernel Mailing List,
	open list:KERNEL SELFTEST FRAMEWORK, Shuah Khan

On Mon, Nov 2, 2020 at 3:23 PM Daniel Latypov <dlatypov@google.com> wrote:
>
> Currently the following expectation
>   KUNIT_EXPECT_STREQ(test, "hi", "bye");
> will produce:
>   Expected "hi" == "bye", but
>       "hi" == 1625079497
>       "bye" == 1625079500
>
> After this patch:
>   Expected "hi" == "bye", but
>       "hi" == hi
>       "bye" == bye
>
> KUNIT_INIT_BINARY_STR_ASSERT_STRUCT() was written but just mistakenly
> not actually used by KUNIT_EXPECT_STREQ() and friends.
>
> Signed-off-by: Daniel Latypov <dlatypov@google.com>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-05 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 23:23 [PATCH] kunit: fix display of failed expectations for strings Daniel Latypov
2020-11-05 16:05 ` Brendan Higgins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).