mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
New unit_test framework:
* Header-only! * No external dependencies or other beast modules * Compilation options allow for: - Stand-alone application to run a single test suite - Stand-alone application to run a set of test suites - Global suite of tests inline with the host application - Disable test suite generation completely * Existing tests reworked to use the new classes
This commit is contained in:
@@ -17,15 +17,15 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../../../beast/beast/unit_test/suite.h"
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class JsonCppTests : public beast::UnitTest
|
||||
class JsonCpp_test : public beast::unit_test::suite
|
||||
{
|
||||
public:
|
||||
void testBadJson ()
|
||||
{
|
||||
beginTestCase ("bad input");
|
||||
|
||||
char const* s (
|
||||
"{\"method\":\"ledger\",\"params\":[{\"ledger_index\":1e300}]}"
|
||||
);
|
||||
@@ -37,16 +37,12 @@ public:
|
||||
pass ();
|
||||
}
|
||||
|
||||
void runTest ()
|
||||
void run ()
|
||||
{
|
||||
testBadJson ();
|
||||
}
|
||||
|
||||
JsonCppTests () : UnitTest ("JsonCpp", "ripple")
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static JsonCppTests jsonCppTests;
|
||||
BEAST_DEFINE_TESTSUITE(JsonCpp,json,ripple);
|
||||
|
||||
} // namespace ripple
|
||||
} // ripple
|
||||
|
||||
Reference in New Issue
Block a user