summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2016-09-23 13:09:41 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-05 17:11:30 -0700
commit93159a225083f134bace7d279cd84e46d5606350 (patch)
tree3f8a56fd55ff712e61a715d214760d491b4d2d35
parentc3f8de399bc089f973f6766e5dcd06922d5639cd (diff)
downloadvboot-93159a225083f134bace7d279cd84e46d5606350.tar.gz
Currently, test macros print out 'desc' regardless 'comment' is specified or not. This patch makes TEST_EQ print 'desc' only if 'comment' is not supplied. BUG=none BRANCH=none TEST=make runtests Change-Id: I9cc3c9a9561534352ae0315dfea983f2c212b909 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388859 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--tests/test_common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_common.c b/tests/test_common.c
index dae485f9..0a76ccdd 100644
--- a/tests/test_common.c
+++ b/tests/test_common.c
@@ -22,12 +22,12 @@ int test_eq(int result, int expected,
const char *preamble, const char *desc, const char *comment)
{
if (result == expected) {
- fprintf(stderr, "%s: %s, %s ... " COL_GREEN "PASSED\n" COL_STOP,
- preamble, desc, comment);
+ fprintf(stderr, "%s: %s ... " COL_GREEN "PASSED\n" COL_STOP,
+ preamble, comment ? comment : desc);
return 1;
} else {
- fprintf(stderr, "%s: %s, %s ... " COL_RED "FAILED\n" COL_STOP,
- preamble, desc, comment);
+ fprintf(stderr, "%s: %s ... " COL_RED "FAILED\n" COL_STOP,
+ preamble, comment ? comment : desc);
fprintf(stderr, " Expected: 0x%x (%d), got: 0x%x (%d)\n",
expected, expected, result, result);
gTestSuccess = 0;