public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] assert_streq: add newlines to failure message
@ 2021-10-26 21:27 David Malcolm
  2021-10-28 14:53 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: David Malcolm @ 2021-10-26 21:27 UTC (permalink / raw)
  To: gcc-patches

Adding newlines so that the two strings line up makes string equality
failures considerably easier to read.

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
OK for trunk?

gcc/ChangeLog:
	* selftest.c (assert_streq): Add newlines when emitting non-equal
	non-NULL strings.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
 gcc/selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/selftest.c b/gcc/selftest.c
index 8f1cde0cc19..0db56f3b240 100644
--- a/gcc/selftest.c
+++ b/gcc/selftest.c
@@ -89,7 +89,7 @@ assert_streq (const location &loc,
 	if (strcmp (val1, val2) == 0)
 	  pass (loc, "ASSERT_STREQ");
 	else
-	  fail_formatted (loc, "ASSERT_STREQ (%s, %s) val1=\"%s\" val2=\"%s\"",
+	  fail_formatted (loc, "ASSERT_STREQ (%s, %s)\n val1=\"%s\"\n val2=\"%s\"\n",
 			  desc_val1, desc_val2, val1, val2);
       }
 }
-- 
2.26.3


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

* Re: [PATCH] assert_streq: add newlines to failure message
  2021-10-26 21:27 [PATCH] assert_streq: add newlines to failure message David Malcolm
@ 2021-10-28 14:53 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2021-10-28 14:53 UTC (permalink / raw)
  To: David Malcolm, gcc-patches



On 10/26/2021 3:27 PM, David Malcolm via Gcc-patches wrote:
> Adding newlines so that the two strings line up makes string equality
> failures considerably easier to read.
>
> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> OK for trunk?
>
> gcc/ChangeLog:
> 	* selftest.c (assert_streq): Add newlines when emitting non-equal
> 	non-NULL strings.
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
OK
jeff


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

end of thread, other threads:[~2021-10-28 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26 21:27 [PATCH] assert_streq: add newlines to failure message David Malcolm
2021-10-28 14:53 ` Jeff Law

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 read-only IMAP folder(s) and NNTP newsgroup(s).