From 9bbebe5fdd14d8a6135e4f22d430f76a3389c5e1 Mon Sep 17 00:00:00 2001 From: Crzyrndm Date: Mon, 18 Jun 2018 19:27:27 +1200 Subject: [PATCH] Add __LINE__ to test assert failed messages --- tests/helpers/assertions.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/helpers/assertions.hpp b/tests/helpers/assertions.hpp index 86c9b23a..8be904d3 100644 --- a/tests/helpers/assertions.hpp +++ b/tests/helpers/assertions.hpp @@ -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))