The helpers are unused outside of tests and redundant with the existing bool read(std::string_view raw);.
Fix both issues by removing them.
Also, simplify the tests code by removing a std::string constructor where possible.
The helpers are unused outside of tests and redundant with the existing bool read(std::string_view raw);.
Fix both issues by removing them.
Also, simplify the tests code by removing a std::string constructor where possible.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | stickies-v, TheCharlatan |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
93 | @@ -94,9 +94,7 @@ class UniValue { 94 | std::string write(unsigned int prettyIndent = 0, 95 | unsigned int indentLevel = 0) const; 96 | 97 | - bool read(const char *raw, size_t len); 98 | - bool read(const char *raw) { return read(raw, strlen(raw)); }
nit: can't get iwyu to work on this file, but i think #include <cstring> is now no longer required
can't get iwyu to work on this file
You can just use the output produced by CI (tidy)
but i think #include <cstring> is now no longer required
Thanks, done.
utACK 9999cfc1f3b728132e011f0aec24211212924de2
67 | @@ -68,7 +68,7 @@ 68 | <RawTestFile Include="..\..\src\test\data\*.raw" /> 69 | </ItemGroup> 70 | <HeaderFromHexdump RawFilePath="%(RawTestFile.FullPath)" HeaderFilePath="%(RawTestFile.FullPath).h" SourceHeader="static unsigned const char %(RawTestFile.Filename)_raw[] = {" SourceFooter="};" /> 71 | - <HeaderFromHexdump RawFilePath="%(JsonTestFile.FullPath)" HeaderFilePath="%(JsonTestFile.FullPath).h" SourceHeader="namespace json_tests{ static unsigned const char %(JsonTestFile.Filename)[] = {" SourceFooter="};}" /> 72 | + <HeaderFromHexdump RawFilePath="%(JsonTestFile.FullPath)" HeaderFilePath="%(JsonTestFile.FullPath).h" SourceHeader="#include <string> /*\n*/ namespace json_tests{ static const std::string %(JsonTestFile.Filename){" SourceFooter="};}" />
cc @sipsorcery @hebasto Any idea how to make a newline after the #include statement here on Windows?
What about this? Adds a CR/LF so should work on windows? (but can't test)
<HeaderFromHexdump RawFilePath="%(JsonTestFile.FullPath)" HeaderFilePath="%(JsonTestFile.FullPath).h" SourceHeader="#include <string>
namespace json_tests{ static const std::string %(JsonTestFile.Filename){" SourceFooter="};}" />
Thanks, no idea if and why it worked, but the Windows CI passed the step.
utACK fa940f41eaffa4b2a28c465a10a4c12d4b8976b8
tACK fa940f41eaffa4b2a28c465a10a4c12d4b8976b8