diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-04-22 15:16:50 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-04-22 15:16:50 +0000 |
commit | 1a99df430cd17693e2829ab45b1d46d27b92be0c (patch) | |
tree | 1c0af8959771c5b0f817e1717d51b77eb13491a2 /lib/common/Test.h | |
parent | 171d6d30490f1414e0936af087a3c1cb111b2804 (diff) |
Display file and line where memory leak test failed. (refs #3)
Diffstat (limited to 'lib/common/Test.h')
-rw-r--r-- | lib/common/Test.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/common/Test.h b/lib/common/Test.h index e485f2ee..89f74563 100644 --- a/lib/common/Test.h +++ b/lib/common/Test.h @@ -317,7 +317,8 @@ inline void TestRemoteProcessMemLeaksFunc(const char *filename, first_fail_line = line; } ++failures; - printf("FAILURE: MemLeak report not available (file %s)\n", filename); + printf("FAILURE: MemLeak report not available (file %s) " + "at %s:%d\n", filename, file, line); } else { @@ -331,12 +332,13 @@ inline void TestRemoteProcessMemLeaksFunc(const char *filename, } ++failures; printf("FAILURE: Memory leaks found in other process " - "(file %s)\n==========\n", filename); + "(file %s) at %s:%d\n==========\n", + filename, file, line); FILE *f = fopen(filename, "r"); - char line[512]; - while(::fgets(line, sizeof(line), f) != 0) + char linebuf[512]; + while(::fgets(linebuf, sizeof(linebuf), f) != 0) { - printf("%s", line); + printf("%s", linebuf); } fclose(f); printf("==========\n"); |