From a433804ee6c4112eb17951bd1468348c91f43506 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 11 Apr 2016 17:42:07 -0400 Subject: [PATCH] unit_test::suite fix warning --- beast/unit_test/suite.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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