From 237b5e704fb19d00d352703fc0f649d10179c04a Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 10 Jun 2015 18:58:21 -0700 Subject: [PATCH] Convert to bool in suite::expect --- beast/unit_test/suite.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/beast/unit_test/suite.h b/beast/unit_test/suite.h index b88f19b985..1e9dab6aae 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