From c92c87b47d7f2db163f58ac162432f1a9a60455a Mon Sep 17 00:00:00 2001 From: dota17 <50514813+dota17@users.noreply.github.com> Date: Tue, 27 Aug 2019 03:36:51 +0800 Subject: [PATCH] Add some test cases in ValueTest (#1010) * add some test cases in ValueTest * add some test cases in ValueTest --- src/test_lib_json/main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index c6f2c5c..7de8491 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -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) {