diff --git a/beast/unit_test/suite.h b/beast/unit_test/suite.h index 71a1c934a..f3e0aa585 100644 --- a/beast/unit_test/suite.h +++ b/beast/unit_test/suite.h @@ -173,16 +173,16 @@ public: logged if the condition is false. @return `true` if the test condition indicates success. */ - template + template bool - expect (Condition shouldBeTrue, + expect(Condition const& shouldBeTrue, String const& reason); - template + template bool - expect (Condition shouldBeTrue) + expect(Condition const& shouldBeTrue) { - return expect (shouldBeTrue, ""); + return expect(shouldBeTrue, ""); } /** Expect an exception from f() */ @@ -411,16 +411,16 @@ suite::operator()(runner& r) template inline bool -suite::expect (Condition shouldBeTrue, +suite::expect(Condition const& shouldBeTrue, String const& reason) { - bool const b = - static_cast(shouldBeTrue); - if (b) + if(shouldBeTrue) + { pass(); - else - fail (reason); - return b; + return true; + } + fail(reason); + return false; } template