Separated exceptions out

philsquared
2012-03-28 11:18:18 -07:00
parent ef6bda5321
commit d35f861181

@@ -1,4 +1,3 @@
# Assertion Macros # Assertion Macros
Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (_EQUALS, _NOTEQUALS, _GREATER_THAN etc). Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (_EQUALS, _NOTEQUALS, _GREATER_THAN etc).
@@ -15,13 +14,14 @@ The CHECK family are equivalent but execution continues in the same test case ev
**REQUIRE(** _expression_ **)** and **REQUIRE(** _expression_ **)** and
**CHECK(** _expression_ **)** **CHECK(** _expression_ **)**
Evaluates the expression and records the result. If an exception is thrown it is caught, reported, and counted as a failure. These are the macros you will use most of the time Evaluates the expression and records the result. If an exception is thrown it is caught, reported, and counted as a failure. These are the macros you will use most of the time
<br /><br />
**REQUIRE_FALSE(** _expression_ **)** and **REQUIRE_FALSE(** _expression_ **)** and
**CHECK_FALSE(** _expression_ **)** **CHECK_FALSE(** _expression_ **)**
Evaluates the expression and records the _logical NOT_ of the result. If an exception is thrown it is caught, reported, and counted as a failure. Evaluates the expression and records the _logical NOT_ of the result. If an exception is thrown it is caught, reported, and counted as a failure.
(these forms exist as a workaround for the fact that ! prefixed expressions cannot be decomposed). (these forms exist as a workaround for the fact that ! prefixed expressions cannot be decomposed).
## Exceptions
**REQUIRE_THROWS(** _expression_ **)** and **REQUIRE_THROWS(** _expression_ **)** and
**CHECK_THROWS(** _expression_ **)** **CHECK_THROWS(** _expression_ **)**
Expects that an exception (of any type) is be thrown during evaluation of the expression. Expects that an exception (of any type) is be thrown during evaluation of the expression.