mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-18 04:58:51 +02:00
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.
This commit is contained in:
parent
627b495352
commit
099bd85ed7
@ -117,6 +117,8 @@ Test that an expected error is actually thrown and error when it isn't
|
|||||||
THROW_FMT( \
|
THROW_FMT( \
|
||||||
TestError, "statement '%s' returned but error %s, '%s' was expected", #statement, errorTypeName(&errorTypeExpected), \
|
TestError, "statement '%s' returned but error %s, '%s' was expected", #statement, errorTypeName(&errorTypeExpected), \
|
||||||
errorMessageExpected); \
|
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)); \
|
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); \
|
TEST_ERROR(statement, errorTypeExpected, TEST_ERROR_FMT_buffer); \
|
||||||
|
\
|
||||||
|
stackTraceTestFileLineSet(0); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************************************************************************
|
/***********************************************************************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user