You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Mahler <bm...@apache.org> on 2018/03/02 01:33:19 UTC

Re: Review Request 59989: Added a test `ProtobufTest.JsonifyMap`.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59989/#review198502
-----------------------------------------------------------


Fix it, then Ship it!





3rdparty/stout/tests/protobuf_tests.cpp
Lines 637 (patched)
<https://reviews.apache.org/r/59989/#comment278647>

    Extra new line here.



3rdparty/stout/tests/protobuf_tests.cpp
Lines 675-676 (patched)
<https://reviews.apache.org/r/59989/#comment278648>

    Do you want to use a raw string literal here to avoid all the escaping? (6) from here: http://en.cppreference.com/w/cpp/language/string_literal


- Benjamin Mahler


On Feb. 28, 2018, 11:28 p.m., Qian Zhang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59989/
> -----------------------------------------------------------
> 
> (Updated Feb. 28, 2018, 11:28 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Benjamin Mahler, Chun-Hung Hsiao, and Zhitao Li.
> 
> 
> Bugs: MESOS-7656
>     https://issues.apache.org/jira/browse/MESOS-7656
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added a test `ProtobufTest.JsonifyMap`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/tests/protobuf_tests.cpp be35ad0d1e16501df67752a1818f79751419a43d 
> 
> 
> Diff: https://reviews.apache.org/r/59989/diff/4/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Qian Zhang
> 
>


Re: Review Request 59989: Added a test `ProtobufTest.JsonifyMap`.

Posted by Qian Zhang <zh...@gmail.com>.

> On March 2, 2018, 9:33 a.m., Benjamin Mahler wrote:
> > 3rdparty/stout/tests/protobuf_tests.cpp
> > Lines 675-676 (patched)
> > <https://reviews.apache.org/r/59989/diff/4/?file=1922649#file1922649line675>
> >
> >     Do you want to use a raw string literal here to avoid all the escaping? (6) from here: http://en.cppreference.com/w/cpp/language/string_literal
> 
> Qian Zhang wrote:
>     Yeah, I thought that before. However I see all other protobuf tests in this file are using `strings::remove()`, I think it may not appropriate to change them to use raw string in this patch. How about I post a follow-up patch to change all of them?
> 
> Qian Zhang wrote:
>     Second thought, it seems we cannot do it in these tests, because raw string literal will keep all the whitespaces and newlines, but `stringify(JSON::Object)` will not, so the comparison between them in the test will always fail.

We can combine the use of raw string literal and `strings::remove()`, i.e., use `strings:remove()` to remove the spaces and newlines in the raw string literal.

Here is the patch:
https://reviews.apache.org/r/66076/


- Qian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59989/#review198502
-----------------------------------------------------------


On March 6, 2018, 5:29 p.m., Qian Zhang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59989/
> -----------------------------------------------------------
> 
> (Updated March 6, 2018, 5:29 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Benjamin Mahler, Chun-Hung Hsiao, and Zhitao Li.
> 
> 
> Bugs: MESOS-7656
>     https://issues.apache.org/jira/browse/MESOS-7656
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added a test `ProtobufTest.JsonifyMap`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/tests/protobuf_tests.cpp be35ad0d1e16501df67752a1818f79751419a43d 
> 
> 
> Diff: https://reviews.apache.org/r/59989/diff/5/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Qian Zhang
> 
>


Re: Review Request 59989: Added a test `ProtobufTest.JsonifyMap`.

Posted by Qian Zhang <zh...@gmail.com>.

> On March 2, 2018, 9:33 a.m., Benjamin Mahler wrote:
> > 3rdparty/stout/tests/protobuf_tests.cpp
> > Lines 675-676 (patched)
> > <https://reviews.apache.org/r/59989/diff/4/?file=1922649#file1922649line675>
> >
> >     Do you want to use a raw string literal here to avoid all the escaping? (6) from here: http://en.cppreference.com/w/cpp/language/string_literal
> 
> Qian Zhang wrote:
>     Yeah, I thought that before. However I see all other protobuf tests in this file are using `strings::remove()`, I think it may not appropriate to change them to use raw string in this patch. How about I post a follow-up patch to change all of them?

Second thought, it seems we cannot do it in these tests, because raw string literal will keep all the whitespaces and newlines, but `stringify(JSON::Object)` will not, so the comparison between them in the test will always fail.


- Qian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59989/#review198502
-----------------------------------------------------------


On March 6, 2018, 5:29 p.m., Qian Zhang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59989/
> -----------------------------------------------------------
> 
> (Updated March 6, 2018, 5:29 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Benjamin Mahler, Chun-Hung Hsiao, and Zhitao Li.
> 
> 
> Bugs: MESOS-7656
>     https://issues.apache.org/jira/browse/MESOS-7656
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added a test `ProtobufTest.JsonifyMap`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/tests/protobuf_tests.cpp be35ad0d1e16501df67752a1818f79751419a43d 
> 
> 
> Diff: https://reviews.apache.org/r/59989/diff/5/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Qian Zhang
> 
>


Re: Review Request 59989: Added a test `ProtobufTest.JsonifyMap`.

Posted by Qian Zhang <zh...@gmail.com>.

> On March 2, 2018, 9:33 a.m., Benjamin Mahler wrote:
> > 3rdparty/stout/tests/protobuf_tests.cpp
> > Lines 675-676 (patched)
> > <https://reviews.apache.org/r/59989/diff/4/?file=1922649#file1922649line675>
> >
> >     Do you want to use a raw string literal here to avoid all the escaping? (6) from here: http://en.cppreference.com/w/cpp/language/string_literal

Yeah, I thought that before. However I see all other protobuf tests in this file are using `strings::remove()`, I think it may not appropriate to change them to use raw string in this patch. How about I post a follow-up patch to change all of them?


- Qian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59989/#review198502
-----------------------------------------------------------


On March 1, 2018, 7:28 a.m., Qian Zhang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59989/
> -----------------------------------------------------------
> 
> (Updated March 1, 2018, 7:28 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Benjamin Mahler, Chun-Hung Hsiao, and Zhitao Li.
> 
> 
> Bugs: MESOS-7656
>     https://issues.apache.org/jira/browse/MESOS-7656
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added a test `ProtobufTest.JsonifyMap`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/tests/protobuf_tests.cpp be35ad0d1e16501df67752a1818f79751419a43d 
> 
> 
> Diff: https://reviews.apache.org/r/59989/diff/4/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Qian Zhang
> 
>