mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +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()!
|
// If this goes off it means you forgot to call beginTestCase()!
|
||||||
bassert (m_case != nullptr);
|
bassert (m_case != nullptr);
|
||||||
|
|
||||||
Item item (true);
|
m_case->items.add (Item (true));
|
||||||
|
|
||||||
m_case->items.add (item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnitTest::fail (String const& failureMessage)
|
void UnitTest::fail (String const& failureMessage)
|
||||||
@@ -148,7 +146,7 @@ void UnitTest::fail (String const& failureMessage)
|
|||||||
Item item (false, failureMessage);
|
Item item (false, failureMessage);
|
||||||
|
|
||||||
m_case->failures++;
|
m_case->failures++;
|
||||||
int const caseNumber = m_case->items.add (item);
|
int const caseNumber = m_case->items.add (Item (false, failureMessage));
|
||||||
|
|
||||||
String s;
|
String s;
|
||||||
s << "#" << String (caseNumber) << " failed: " << failureMessage;
|
s << "#" << String (caseNumber) << " failed: " << failureMessage;
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ public:
|
|||||||
void pass ();
|
void pass ();
|
||||||
|
|
||||||
/** Causes the test item to fail. */
|
/** 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. */
|
/** Records an exception in the test item. */
|
||||||
void failException ();
|
void failException ();
|
||||||
|
|||||||
Reference in New Issue
Block a user