Skip to content

Commit c92c87b

Browse files
dota17baylesj
authored andcommitted
Add some test cases in ValueTest (open-source-parsers#1010)
* add some test cases in ValueTest * add some test cases in ValueTest
1 parent b941149 commit c92c87b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/test_lib_json/main.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,17 @@ JSONTEST_FIXTURE(ValueTest, checkNormalizeFloatingPointStr) {
141141
JSONTEST_ASSERT_STRING_EQUAL("1234.0", normalizeFloatingPointStr("1234.0"));
142142
JSONTEST_ASSERT_STRING_EQUAL("1234.0e0",
143143
normalizeFloatingPointStr("1234.0e0"));
144+
JSONTEST_ASSERT_STRING_EQUAL("1234.0e-1",
145+
normalizeFloatingPointStr("1234.0e-1"));
144146
JSONTEST_ASSERT_STRING_EQUAL("1234.0e+0",
145147
normalizeFloatingPointStr("1234.0e+0"));
148+
JSONTEST_ASSERT_STRING_EQUAL("1234.0e+1",
149+
normalizeFloatingPointStr("1234.0e+001"));
146150
JSONTEST_ASSERT_STRING_EQUAL("1234e-1", normalizeFloatingPointStr("1234e-1"));
151+
JSONTEST_ASSERT_STRING_EQUAL("1234e+0",
152+
normalizeFloatingPointStr("1234e+000"));
153+
JSONTEST_ASSERT_STRING_EQUAL("1234e+1",
154+
normalizeFloatingPointStr("1234e+001"));
147155
JSONTEST_ASSERT_STRING_EQUAL("1234e10", normalizeFloatingPointStr("1234e10"));
148156
JSONTEST_ASSERT_STRING_EQUAL("1234e10",
149157
normalizeFloatingPointStr("1234e010"));
@@ -155,8 +163,6 @@ JSONTEST_FIXTURE(ValueTest, checkNormalizeFloatingPointStr) {
155163
normalizeFloatingPointStr("1234e+100"));
156164
JSONTEST_ASSERT_STRING_EQUAL("1234e-100",
157165
normalizeFloatingPointStr("1234e-100"));
158-
JSONTEST_ASSERT_STRING_EQUAL("1234e+1",
159-
normalizeFloatingPointStr("1234e+001"));
160166
}
161167

162168
JSONTEST_FIXTURE(ValueTest, memberCount) {
@@ -172,6 +178,9 @@ JSONTEST_FIXTURE(ValueTest, memberCount) {
172178
JSONTEST_ASSERT_PRED(checkMemberCount(emptyString_, 0));
173179
JSONTEST_ASSERT_PRED(checkMemberCount(string_, 0));
174180
JSONTEST_ASSERT_PRED(checkMemberCount(true_, 0));
181+
JSONTEST_ASSERT_PRED(checkMemberCount(false_, 0));
182+
JSONTEST_ASSERT_PRED(checkMemberCount(string1_, 0));
183+
JSONTEST_ASSERT_PRED(checkMemberCount(float_, 0));
175184
}
176185

177186
JSONTEST_FIXTURE(ValueTest, objects) {

0 commit comments

Comments
 (0)