From: David Malcolm Date: Mon, 25 Oct 2021 21:16:07 +0000 (-0400) Subject: assert_streq: add newlines to failure message X-Git-Tag: upstream/12.2.0~3901 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebfc3a2304383edf7ccd50a327e380ee6a8afa43;p=platform%2Fupstream%2Fgcc.git assert_streq: add newlines to failure message Adding newlines so that the two strings line up makes string equality failures considerably easier to read. gcc/ChangeLog: * selftest.c (assert_streq): Add newlines when emitting non-equal non-NULL strings. Signed-off-by: David Malcolm --- diff --git a/gcc/selftest.c b/gcc/selftest.c index 8f1cde0..0db56f3 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); } }