diff --git a/beast/unit_test/suite.h b/beast/unit_test/suite.h index 2e70df7a..1b54a6ec 100644 --- a/beast/unit_test/suite.h +++ b/beast/unit_test/suite.h @@ -164,9 +164,17 @@ public: logged if the condition is false. @return `true` if the test condition indicates success. */ + template + bool + expect (Condition shouldBeTrue, + String const& reason); + template bool - expect (Condition shouldBeTrue, std::string const& reason = ""); + expect (Condition shouldBeTrue) + { + return expect (shouldBeTrue, ""); + } /** Return the argument associated with the runner. */ std::string const& @@ -177,9 +185,17 @@ public: // DEPRECATED // @return `true` if the test condition indicates success (a false value) + template + bool + unexpected (Condition shouldBeFalse, + String const& reason); + template bool - unexpected (Condition shouldBeFalse, std::string const& reason = ""); + unexpected (Condition shouldBeFalse) + { + return unexpected (shouldBeFalse, ""); + } /** Record a successful test condition. */ template @@ -324,10 +340,11 @@ suite::operator() (runner& r) run (r); } -template +template inline bool -suite::expect (Condition shouldBeTrue, std::string const& reason) +suite::expect (Condition shouldBeTrue, + String const& reason) { if (shouldBeTrue) pass(); @@ -336,10 +353,11 @@ suite::expect (Condition shouldBeTrue, std::string const& reason) return shouldBeTrue; } -template +template inline bool -suite::unexpected (Condition shouldBeFalse, std::string const& reason) +suite::unexpected (Condition shouldBeFalse, + String const& reason) { if (! shouldBeFalse) pass();