From 2b40b98a59ac334d8ed2db76e6317cefb2a8ed84 Mon Sep 17 00:00:00 2001 From: Kosta Date: Fri, 28 Mar 2014 11:14:56 +0100 Subject: [PATCH] some more adjustments to the documentation --- README.md | 6 ++++-- cute/detail/macros_impl.hpp | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5683947..8657062 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This would produce the following output with the provided IDE reporter: ``` .../cute_tests.cpp:64: error: Test two strings for equality .../cute_tests.cpp:64: error: duration: 0 ms -.../cute_tests.cpp:67: error: reason: str1 == str2 +.../cute_tests.cpp:67: error: reason: validation failed: str1 == str2 .../cute_tests.cpp:67: error: with: str1 == str2 => "hello" == "world" ``` @@ -50,7 +50,7 @@ This would produce the following output with the provided IDE reporter: ``` .../cute_tests.cpp:70: error: Capture additional values .../cute_tests.cpp:70: error: duration: 0 ms -.../cute_tests.cpp:79: error: reason: str1 == str2 +.../cute_tests.cpp:79: error: reason: validation failed: str1 == str2 .../cute_tests.cpp:79: error: with: str1 == str2 => "hello" == "world" .../cute_tests.cpp:79: error: with: str1.size() => 5 .../cute_tests.cpp:79: error: with: str2.capacity() => 22 @@ -67,6 +67,8 @@ Each validation macro can be extended by several `CUTE_CAPTURE()` occurrences in Note that `cute` stops a test case by throwing an `exception` as soon as a violation of a `CUTE_ASSERT*()` is detected. +If a `CUTE_TEST` does not trigger any validation during it's execution the test is reported as failed as well, since this usually indicates an error in test implementation. + related work ============ diff --git a/cute/detail/macros_impl.hpp b/cute/detail/macros_impl.hpp index 4954abc..9264826 100644 --- a/cute/detail/macros_impl.hpp +++ b/cute/detail/macros_impl.hpp @@ -13,7 +13,9 @@ try { \ ++cute::detail::eval_context::current().checks_performed; \ if(!(EXPR_EVAL)) { \ - cute::detail::eval_context::current().register_exception(cute::exception(FILE, LINE, EXPR_TEXT, "", CAPTURES1, CAPTURES2)); \ + cute::detail::eval_context::current().register_exception( \ + cute::exception(FILE, LINE, "validation failed: " EXPR_TEXT, "", CAPTURES1, CAPTURES2) \ + ); \ } \ } catch(cute::exception const& ex) { \ cute::detail::eval_context::current().register_exception(ex); \