Return results of expect in UnitTest

This commit is contained in:
Vinnie Falco
2013-08-02 19:01:03 -07:00
parent 1df03b67e7
commit fd14957072
2 changed files with 10 additions and 6 deletions

View File

@@ -106,7 +106,7 @@ void UnitTest::beginTestCase (String const& name)
m_case = new Case (name, m_className);
}
void UnitTest::expect (bool trueCondition, String const& failureMessage)
bool UnitTest::expect (bool trueCondition, String const& failureMessage)
{
if (trueCondition)
{
@@ -116,9 +116,11 @@ void UnitTest::expect (bool trueCondition, String const& failureMessage)
{
fail (failureMessage);
}
return trueCondition;
}
void UnitTest::unexpected (bool falseCondition, String const& failureMessage)
bool UnitTest::unexpected (bool falseCondition, String const& failureMessage)
{
if (! falseCondition)
{
@@ -128,6 +130,8 @@ void UnitTest::unexpected (bool falseCondition, String const& failureMessage)
{
fail (failureMessage);
}
return ! falseCondition;
}
void UnitTest::pass ()