-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
…e_ptr to ensure correct memory management
…ion return unique_ptr, in order to prevent breaking changes, mark the newCharReader function as deprecated
There was a problem hiding this 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
There was a problem hiding this 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?
@@ -2990,6 +2990,19 @@ JSONTEST_FIXTURE_LOCAL(ReaderTest, allowNumericKeysTest) { | |||
checkParse(R"({ 123 : "abc" })"); | |||
} | |||
|
|||
struct UniqueReaderTest : JsonTest::TestCase {}; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; | |||
|
|||
/* |
There was a problem hiding this comment.
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.
Closing this due to inactivity. Feel free to reopen if you are able to address feedback. |
this PR is the result of #1422 discussion