public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] doio/growfiles.c: show line number when test failed
Date: Mon, 27 Feb 2017 14:51:03 +0800	[thread overview]
Message-ID: <20170227065103.GA30910@localhost.localdomain> (raw)

Please review this patch. Thanks.

The original code always shows "growfiles.c:132: Test failed". With this
patch, it will show the right line number where exit() be called.
---
 testcases/kernel/fs/doio/growfiles.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/fs/doio/growfiles.c b/testcases/kernel/fs/doio/growfiles.c
index bbad230..6f25a54 100644
--- a/testcases/kernel/fs/doio/growfiles.c
+++ b/testcases/kernel/fs/doio/growfiles.c
@@ -125,11 +125,11 @@ char *TCID = "growfiles";	/* Default test program identifier.    */
 int TST_TOTAL = 1;		/* Total number of test cases. */
 
 /* To avoid extensive modifications to the code, use this bodge */
-#define exit(x) myexit(x)
-void myexit(int x)
+#define exit(x) myexit(__FILE__, __LINE__, x)
+void myexit(const char *file, const int lineno, int x)
 {
 	if (x)
-		tst_resm(TFAIL, "Test failed");
+		tst_resm_(file, lineno, TFAIL, "Test failed");
 	else
 		tst_resm(TPASS, "Test passed");
 	tst_exit();
-- 
2.7.4


             reply	other threads:[~2017-02-27  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27  6:51 Han Pingtian [this message]
2017-03-02 14:32 ` [LTP] [PATCH] doio/growfiles.c: show line number when test failed Cyril Hrubis

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=20170227065103.GA30910@localhost.localdomain \
    --to=hanpt@linux.vnet.ibm.com \
    --cc=ltp@lists.linux.it \
    /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