Add __LINE__ to test assert failed messages

This commit is contained in:
Crzyrndm 2018-06-18 19:27:27 +12:00
parent bd90cc4786
commit 9bbebe5fdd

View File

@ -20,7 +20,8 @@
catch (...) \
{ \
} \
throw xlnt::exception("assert failed -> " XLNT_STRINGIFY(expression)); \
throw xlnt::exception( \
"assert failed at L:" XLNT_STRINGIFY(__LINE__) "\n" XLNT_STRINGIFY(expression)); \
} while (false)
#define xlnt_assert_throws_nothing(expression) \
@ -34,7 +35,7 @@
catch (...) \
{ \
} \
throw xlnt::exception("assert throws nothing failed -> " XLNT_STRINGIFY(expression)); \
throw xlnt::exception("assert throws nothing failed at L:" XLNT_STRINGIFY(__LINE__) "\n" XLNT_STRINGIFY(expression)); \
} while (false)
#define xlnt_assert_throws(expression, exception_type) \
@ -51,7 +52,7 @@
catch (...) \
{ \
} \
throw xlnt::exception("assert throws failed -> " XLNT_STRINGIFY(expression)); \
throw xlnt::exception("assert throws failed at L:" XLNT_STRINGIFY(__LINE__) "\n" XLNT_STRINGIFY(expression)); \
} while (false)
#define xlnt_assert_equals(left, right) xlnt_assert((left) == (right))