Skip to content

Commit

Permalink
some more adjustments to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosta-Github committed Mar 28, 2014
1 parent fc87b83 commit 2b40b98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
Expand All @@ -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
Expand All @@ -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
============
Expand Down
4 changes: 3 additions & 1 deletion cute/detail/macros_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down

0 comments on commit 2b40b98

Please sign in to comment.