Patchwork [3/5] fs-tests: integck: fix line number in CHECK() output

login
register
mail settings
Submitter Artem Bityutskiy
Date April 24, 2011, 4:16 p.m.
Message ID <1303661778-13214-4-git-send-email-dedekind1@gmail.com>
Download mbox | patch
Permalink /patch/92668/
State New
Headers show

Comments

Artem Bityutskiy - April 24, 2011, 4:16 p.m.
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

In 'check_failed()' use the file and line number provided by the CHECK()
macro via the function parameters, rather than using __LINE__ directly.
Otherwise the funtion prints its own line, instead of the line where the
CHECK() failed.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 tests/fs-tests/integrity/integck.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 80d34c0..9f03709 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -233,7 +233,7 @@  static void check_failed(const char *cond, const char *func, const char *file,
 
 	fflush(stdout);
 	errmsg("condition '%s' failed in %s() at %s:%d",
-	       cond, func, __FILE__, __LINE__);
+	       cond, func, file, line);
 	normsg("error %d (%s)", error, strerror(error));
 	/*
 	 * Note, to make this work well you need: