Add default to UnitTest::fail() and tidy up

This commit is contained in:
Vinnie Falco
2013-08-02 08:35:39 -07:00
parent b7e3de987f
commit 87fe9ed877
2 changed files with 3 additions and 5 deletions

View File

@@ -135,9 +135,7 @@ void UnitTest::pass ()
// If this goes off it means you forgot to call beginTestCase()!
bassert (m_case != nullptr);
Item item (true);
m_case->items.add (item);
m_case->items.add (Item (true));
}
void UnitTest::fail (String const& failureMessage)
@@ -148,7 +146,7 @@ void UnitTest::fail (String const& failureMessage)
Item item (false, failureMessage);
m_case->failures++;
int const caseNumber = m_case->items.add (item);
int const caseNumber = m_case->items.add (Item (false, failureMessage));
String s;
s << "#" << String (caseNumber) << " failed: " << failureMessage;

View File

@@ -295,7 +295,7 @@ public:
void pass ();
/** Causes the test item to fail. */
void fail (String const& failureMessage);
void fail (String const& failureMessage = String::empty);
/** Records an exception in the test item. */
void failException ();