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

spawn_test: use BOOST_CHECK_EQUAL() #1327

Closed
wants to merge 1 commit into from

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Dec 2, 2022

  • tests: spawn_test: use BOOST_CHECK_EQUAL() for checking equality of temporary_buffer

while debugging #1320, i ran into following failure on circleci:

/home/circleci/project/tests/unit/spawn_test.cc(103): error: in "test_spawn_input": check echo == echo.copy_of(text) has failed

*** 1 failure is detected in the test module "/home/circleci/project/tests/unit/spawn_test.cc"
FAILED: tests/unit/CMakeFiles/test_unit_spawn_run /home/circleci/project/build/debug/tests/unit/CMakeFiles/test_unit_spawn_run 
cd /home/circleci/project/build/debug/tests/unit && /home/circleci/project/build/debug/tests/unit/spawn_test -- -c 2

see https://app.circleci.com/pipelines/github/tchaikov/seastar/280/workflows/dc64d0ce-fab2-47b1-a80e-9134e39695dc/jobs/3336

@@ -147,6 +149,11 @@ public:
bool empty() const noexcept { return !size(); }
/// Checks whether the buffer is not empty.
explicit operator bool() const noexcept { return size(); }

friend std::ostream& operator<<(std::ostream& os, const temporary_buffer& b) {
return os << std::string_view{b.get(), b.size()};
Copy link
Contributor

Choose a reason for hiding this comment

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

temporary buffer typically contains binary data, I don't feel comfortable adding a way to dump raw bytes into a terminal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xemul hi Pavel, yeah. i suspected this could be controversial despite that it was only used in test. but indeed, it does not make sense to dump binary to a terminal. dropped the commit adding operator<<().

…emporary_buffer

so we can have better understanding of failures, if this test fails.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
@tchaikov tchaikov changed the title temporary_buffer, spawn_test: add operator<<() and use BOOST_CHECK_EQUAL() spawn_test: use BOOST_CHECK_EQUAL() Dec 2, 2022
@tchaikov
Copy link
Contributor Author

tchaikov commented Dec 2, 2022

changelog

  • dropped the commit adding operator<<(ostream&, ..) for temporary_buffer<..>.

@xemul xemul closed this in 4b6255c Dec 2, 2022
@tchaikov tchaikov deleted the temporary-buffer branch December 2, 2022 13:11
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.

2 participants