add makeCharReader test, fix spelling
This commit is contained in:
parent
a5ef87288e
commit
e90c3c3303
@ -272,10 +272,7 @@ public:
|
||||
*/
|
||||
virtual CharReader* newCharReader() const = 0;
|
||||
|
||||
/** \brief Allocate a CharReader via newCharReader().
|
||||
* wrap the object in std::unique_ptr<CharReader> to esnure deletion.
|
||||
* \throw std::exception if something goes wrong (e.g. invalid settings)
|
||||
*/
|
||||
/** Wrap newCharReader's result in a std::unique_ptr. Throws if newCharReader throws. */
|
||||
std::unique_ptr<CharReader> makeCharReader() const;
|
||||
}; // Factory
|
||||
}; // CharReader
|
||||
|
@ -2990,6 +2990,19 @@ JSONTEST_FIXTURE_LOCAL(ReaderTest, allowNumericKeysTest) {
|
||||
checkParse(R"({ 123 : "abc" })");
|
||||
}
|
||||
|
||||
struct UniqueReaderTest : JsonTest::TestCase {};
|
||||
|
||||
JSONTEST_FIXTURE_LOCAL(UniqueReaderTest, parseWithNoErrors) {
|
||||
Json::CharReaderBuilder b;
|
||||
CharReaderPtr reader = b.makeCharReader();
|
||||
Json::String errs;
|
||||
Json::Value root;
|
||||
char const doc[] = R"({ "property" : "value" })";
|
||||
bool ok = reader->parse(doc, doc + std::strlen(doc), &root, &errs);
|
||||
JSONTEST_ASSERT(ok);
|
||||
JSONTEST_ASSERT(errs.empty());
|
||||
}
|
||||
|
||||
struct CharReaderTest : JsonTest::TestCase {};
|
||||
|
||||
JSONTEST_FIXTURE_LOCAL(CharReaderTest, parseWithNoErrors) {
|
||||
|
Loading…
Reference in New Issue
Block a user