get basic tests running
This commit is contained in:
parent
b69334ba82
commit
18dc444caf
@ -1083,6 +1083,9 @@ bool OurReader::readValue() {
|
||||
case tokenNumber:
|
||||
successful = decodeNumber(token);
|
||||
break;
|
||||
case tokenHexadecimal:
|
||||
successful = decodeHexadecimal(token);
|
||||
break;
|
||||
case tokenString:
|
||||
successful = decodeString(token);
|
||||
break;
|
||||
@ -1969,7 +1972,7 @@ CharReader* CharReaderBuilder::newCharReader() const {
|
||||
features.failIfExtra_ = settings_["failIfExtra"].asBool();
|
||||
features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool();
|
||||
features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool();
|
||||
features.allowHexadecimal_ = settings_["allowHexacecimal"].asBool();
|
||||
features.allowHexadecimal_ = settings_["allowHexadecimal"].asBool();
|
||||
features.skipBom_ = settings_["skipBom"].asBool();
|
||||
return new OurCharReader(collectComments, features);
|
||||
}
|
||||
@ -1987,7 +1990,7 @@ bool CharReaderBuilder::validate(Json::Value* invalid) const {
|
||||
"failIfExtra",
|
||||
"rejectDupKeys",
|
||||
"allowSpecialFloats",
|
||||
"allowHexacecimal",
|
||||
"allowHexadecimal",
|
||||
"skipBom",
|
||||
};
|
||||
for (auto si = settings_.begin(); si != settings_.end(); ++si) {
|
||||
|
@ -3577,6 +3577,8 @@ JSONTEST_FIXTURE_LOCAL(CharReaderAllowHexadecimal, disallowHex) {
|
||||
JSONTEST_FIXTURE_LOCAL(CharReaderAllowHexadecimal, hexObject) {
|
||||
Json::CharReaderBuilder b;
|
||||
b.settings_["allowHexadecimal"] = true;
|
||||
Json::Value invalid;
|
||||
JSONTEST_ASSERT(b.validate(&invalid)) << invalid;
|
||||
CharReaderPtr reader(b.newCharReader());
|
||||
{
|
||||
Json::Value root;
|
||||
@ -3622,7 +3624,7 @@ JSONTEST_FIXTURE_LOCAL(CharReaderAllowHexadecimal, hexNumbers) {
|
||||
const char* c0 = td.in.c_str();
|
||||
const char* c1 = c0 + td.in.size();
|
||||
bool ok = reader->parse(c0, c1, &root, &errs);
|
||||
JSONTEST_ASSERT_EQUAL(td.ok, ok);
|
||||
JSONTEST_ASSERT(td.ok == ok) << "in: " << td.in;
|
||||
if (td.ok)
|
||||
{
|
||||
JSONTEST_ASSERT_EQUAL(0u, errs.size());
|
||||
|
Loading…
Reference in New Issue
Block a user