Add some test cases in ValueTest (#1010)

* add some test cases in ValueTest

* add some test cases in ValueTest
This commit is contained in:
dota17 2019-08-27 03:36:51 +08:00 committed by Jordan Bayles
parent b941149a37
commit c92c87b47d

View File

@ -141,9 +141,17 @@ JSONTEST_FIXTURE(ValueTest, checkNormalizeFloatingPointStr) {
JSONTEST_ASSERT_STRING_EQUAL("1234.0", normalizeFloatingPointStr("1234.0"));
JSONTEST_ASSERT_STRING_EQUAL("1234.0e0",
normalizeFloatingPointStr("1234.0e0"));
JSONTEST_ASSERT_STRING_EQUAL("1234.0e-1",
normalizeFloatingPointStr("1234.0e-1"));
JSONTEST_ASSERT_STRING_EQUAL("1234.0e+0",
normalizeFloatingPointStr("1234.0e+0"));
JSONTEST_ASSERT_STRING_EQUAL("1234.0e+1",
normalizeFloatingPointStr("1234.0e+001"));
JSONTEST_ASSERT_STRING_EQUAL("1234e-1", normalizeFloatingPointStr("1234e-1"));
JSONTEST_ASSERT_STRING_EQUAL("1234e+0",
normalizeFloatingPointStr("1234e+000"));
JSONTEST_ASSERT_STRING_EQUAL("1234e+1",
normalizeFloatingPointStr("1234e+001"));
JSONTEST_ASSERT_STRING_EQUAL("1234e10", normalizeFloatingPointStr("1234e10"));
JSONTEST_ASSERT_STRING_EQUAL("1234e10",
normalizeFloatingPointStr("1234e010"));
@ -155,8 +163,6 @@ JSONTEST_FIXTURE(ValueTest, checkNormalizeFloatingPointStr) {
normalizeFloatingPointStr("1234e+100"));
JSONTEST_ASSERT_STRING_EQUAL("1234e-100",
normalizeFloatingPointStr("1234e-100"));
JSONTEST_ASSERT_STRING_EQUAL("1234e+1",
normalizeFloatingPointStr("1234e+001"));
}
JSONTEST_FIXTURE(ValueTest, memberCount) {
@ -172,6 +178,9 @@ JSONTEST_FIXTURE(ValueTest, memberCount) {
JSONTEST_ASSERT_PRED(checkMemberCount(emptyString_, 0));
JSONTEST_ASSERT_PRED(checkMemberCount(string_, 0));
JSONTEST_ASSERT_PRED(checkMemberCount(true_, 0));
JSONTEST_ASSERT_PRED(checkMemberCount(false_, 0));
JSONTEST_ASSERT_PRED(checkMemberCount(string1_, 0));
JSONTEST_ASSERT_PRED(checkMemberCount(float_, 0));
}
JSONTEST_FIXTURE(ValueTest, objects) {