diff --git a/src/beast/beast/unit_test/suite.h b/src/beast/beast/unit_test/suite.h index b88f19b985..1e9dab6aae 100644 --- a/src/beast/beast/unit_test/suite.h +++ b/src/beast/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