Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add makeCharReader function to deprecated newCharReader #1424

Closed
wants to merge 13 commits into from

Conversation

AssafPassalCG
Copy link

this PR is the result of #1422 discussion

include/json/reader.h Outdated Show resolved Hide resolved
src/jsontestrunner/main.cpp Outdated Show resolved Hide resolved
src/lib_json/json_reader.cpp Outdated Show resolved Hide resolved
src/test_lib_json/main.cpp Outdated Show resolved Hide resolved
src/lib_json/json_reader.cpp Outdated Show resolved Hide resolved
src/lib_json/json_reader.cpp Outdated Show resolved Hide resolved
src/lib_json/json_writer.cpp Outdated Show resolved Hide resolved
src/lib_json/json_reader.cpp Outdated Show resolved Hide resolved
include/json/reader.h Show resolved Hide resolved
Copy link
Contributor

@BillyDonahue BillyDonahue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make a minimal PR

include/json/reader.h Show resolved Hide resolved
Copy link
Contributor

@BillyDonahue BillyDonahue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test for makeCharReader?

include/json/reader.h Outdated Show resolved Hide resolved
@@ -2990,6 +2990,19 @@ JSONTEST_FIXTURE_LOCAL(ReaderTest, allowNumericKeysTest) {
checkParse(R"({ 123 : "abc" })");
}

struct UniqueReaderTest : JsonTest::TestCase {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate fixture not needed. Just make it a member of CharReaderTest.

@@ -2990,6 +2990,19 @@ JSONTEST_FIXTURE_LOCAL(ReaderTest, allowNumericKeysTest) {
checkParse(R"({ 123 : "abc" })");
}

struct UniqueReaderTest : JsonTest::TestCase {};

JSONTEST_FIXTURE_LOCAL(UniqueReaderTest, parseWithNoErrors) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent of this test is to exercise makeCharReader, not "parseWithNoErrors".


JSONTEST_FIXTURE_LOCAL(UniqueReaderTest, parseWithNoErrors) {
Json::CharReaderBuilder b;
CharReaderPtr reader = b.makeCharReader();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the explicit return type of makeCharReader here to make the test more clear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's assert the value of reader since we're specifically testing the factory.

@@ -337,6 +340,9 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
CharReaderBuilder();
~CharReaderBuilder() override;

/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Doxygen comment /**.
Compress to 1-line.

@baylesj
Copy link
Contributor

baylesj commented Sep 12, 2024

Closing this due to inactivity. Feel free to reopen if you are able to address feedback.

@baylesj baylesj closed this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants