diff --git a/beast/unit_test/suite.h b/beast/unit_test/suite.h index b88f19b98..1e9dab6aa 100644 --- a/beast/unit_test/suite.h +++ b/beast/unit_test/suite.h @@ -346,11 +346,13 @@ bool suite::expect (Condition shouldBeTrue, String const& reason) { - if (shouldBeTrue) + bool const b = + static_cast(shouldBeTrue); + if (b) pass(); else fail (reason); - return shouldBeTrue; + return b; } template @@ -359,11 +361,13 @@ bool suite::unexpected (Condition shouldBeFalse, String const& reason) { - if (! shouldBeFalse) + bool const b = + static_cast(shouldBeFalse); + if (! b) pass(); else fail (reason); - return ! shouldBeFalse; + return ! b; } template