pgbackrest.git / summary / log / commit / refs
commit 099bd85ed7cdca017fbfae4d12134a00fcf2236b
Author: David Steele <david@pgmasters.net>
Date: Tue Apr 07 18:42:05 2020 +0000
Reset line number in TEST_ERROR*() macros.
If these are not reset then an error not wrapped in a TEST_ERROR*() macro may show the line number of the previous error in a stack trace, which is confusing.
It is better for the line number to be unreported than wrong.
test/src/common/harnessTest.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test/src/common/harnessTest.h b/test/src/common/harnessTest.h
index 432798212..c5bc71d2b 100644
--- a/test/src/common/harnessTest.h
+++ b/test/src/common/harnessTest.h
@@ -117,6 +117,8 @@ Test that an expected error is actually thrown and error when it isn't
THROW_FMT( \
TestError, "statement '%s' returned but error %s, '%s' was expected", #statement, errorTypeName(&errorTypeExpected), \
errorMessageExpected); \
+ \
+ stackTraceTestFileLineSet(0); \
}
/***********************************************************************************************************************************
@@ -130,6 +132,8 @@ Test error with a formatted expected message
THROW_FMT(AssertError, "error message needs more than the %zu characters available", sizeof(TEST_ERROR_FMT_buffer)); \
\
TEST_ERROR(statement, errorTypeExpected, TEST_ERROR_FMT_buffer); \
+ \
+ stackTraceTestFileLineSet(0); \
}
/***********************************************************************************************************************************
[parent: 627b49535222]