File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1083,6 +1083,9 @@ bool OurReader::readValue() {
1083
1083
case tokenNumber:
1084
1084
successful = decodeNumber (token);
1085
1085
break ;
1086
+ case tokenHexadecimal:
1087
+ successful = decodeHexadecimal (token);
1088
+ break ;
1086
1089
case tokenString:
1087
1090
successful = decodeString (token);
1088
1091
break ;
@@ -1969,7 +1972,7 @@ CharReader* CharReaderBuilder::newCharReader() const {
1969
1972
features.failIfExtra_ = settings_[" failIfExtra" ].asBool ();
1970
1973
features.rejectDupKeys_ = settings_[" rejectDupKeys" ].asBool ();
1971
1974
features.allowSpecialFloats_ = settings_[" allowSpecialFloats" ].asBool ();
1972
- features.allowHexadecimal_ = settings_[" allowHexacecimal " ].asBool ();
1975
+ features.allowHexadecimal_ = settings_[" allowHexadecimal " ].asBool ();
1973
1976
features.skipBom_ = settings_[" skipBom" ].asBool ();
1974
1977
return new OurCharReader (collectComments, features);
1975
1978
}
@@ -1987,7 +1990,7 @@ bool CharReaderBuilder::validate(Json::Value* invalid) const {
1987
1990
" failIfExtra" ,
1988
1991
" rejectDupKeys" ,
1989
1992
" allowSpecialFloats" ,
1990
- " allowHexacecimal " ,
1993
+ " allowHexadecimal " ,
1991
1994
" skipBom" ,
1992
1995
};
1993
1996
for (auto si = settings_.begin (); si != settings_.end (); ++si) {
Original file line number Diff line number Diff line change @@ -3577,6 +3577,8 @@ JSONTEST_FIXTURE_LOCAL(CharReaderAllowHexadecimal, disallowHex) {
3577
3577
JSONTEST_FIXTURE_LOCAL (CharReaderAllowHexadecimal, hexObject) {
3578
3578
Json::CharReaderBuilder b;
3579
3579
b.settings_ [" allowHexadecimal" ] = true ;
3580
+ Json::Value invalid;
3581
+ JSONTEST_ASSERT (b.validate (&invalid)) << invalid;
3580
3582
CharReaderPtr reader (b.newCharReader ());
3581
3583
{
3582
3584
Json::Value root;
@@ -3622,7 +3624,7 @@ JSONTEST_FIXTURE_LOCAL(CharReaderAllowHexadecimal, hexNumbers) {
3622
3624
const char * c0 = td.in .c_str ();
3623
3625
const char * c1 = c0 + td.in .size ();
3624
3626
bool ok = reader->parse (c0, c1, &root, &errs);
3625
- JSONTEST_ASSERT_EQUAL (td.ok , ok);
3627
+ JSONTEST_ASSERT (td.ok == ok) << " in: " << td. in ;
3626
3628
if (td.ok )
3627
3629
{
3628
3630
JSONTEST_ASSERT_EQUAL (0u , errs.size ());
You can’t perform that action at this time.
0 commit comments