mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Add default to UnitTest::fail() and tidy up
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
Reference in New Issue
Block a user