mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Refine Json unit test
This commit is contained in:
@@ -23,17 +23,6 @@ using namespace beast;
|
||||
class JsonCppTests : public UnitTest
|
||||
{
|
||||
public:
|
||||
void testSprintf ()
|
||||
{
|
||||
beginTestCase ("sprintf");
|
||||
|
||||
char buffer [256];
|
||||
|
||||
double const value (1.0000000000000001e+300);
|
||||
|
||||
sprintf (buffer, "%#f", value);
|
||||
}
|
||||
|
||||
void testBadJson ()
|
||||
{
|
||||
beginTestCase ("bad input");
|
||||
@@ -45,19 +34,12 @@ public:
|
||||
Json::Value j;
|
||||
Json::Reader r;
|
||||
|
||||
if (! r.parse (s, j))
|
||||
{
|
||||
pass ();
|
||||
}
|
||||
else
|
||||
{
|
||||
fail ();
|
||||
}
|
||||
r.parse (s, j);
|
||||
pass ();
|
||||
}
|
||||
|
||||
void runTest ()
|
||||
{
|
||||
testSprintf();
|
||||
testBadJson ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user