From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] assert_streq: add newlines to failure message
Date: Tue, 26 Oct 2021 17:27:46 -0400 [thread overview]
Message-ID: <20211026212746.671762-1-dmalcolm@redhat.com> (raw)
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
next reply other threads:[~2021-10-26 21:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 21:27 David Malcolm [this message]
2021-10-28 14:53 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211026212746.671762-1-dmalcolm@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).