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 first tests for monitor_t and fix monitor_t::abort #249

Merged
merged 2 commits into from
Jun 5, 2018

Conversation

sigiesec
Copy link
Member

@sigiesec sigiesec commented Jun 5, 2018

No description provided.

Solution: add a test and fix implementation of monitor_t::abort to make it usable
@bluca bluca merged commit 97d2cb2 into zeromq:master Jun 5, 2018
@coveralls
Copy link

Pull Request Test Coverage Report for Build 120

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 54 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-8.0%) to 77.706%

Files with Coverage Reduction New Missed Lines %
zmq.hpp 54 69.85%
Totals Coverage Status
Change from base Build 119: -8.0%
Covered Lines: 359
Relevant Lines: 462

💛 - Coveralls

)

target_link_libraries(
unit_tests
PRIVATE gtest_main
PRIVATE gtest
PRIVATE gmock_main
Copy link
Contributor

Choose a reason for hiding this comment

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

is the indentation intentional ?

Copy link
Member Author

Choose a reason for hiding this comment

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

No... probably this is a problem with tabs vs. spaces

bind_socket.bind("tcp://127.0.0.1:*");
char endpoint[255];
size_t endpoint_len = sizeof(endpoint);
bind_socket.getsockopt(ZMQ_LAST_ENDPOINT, &endpoint, &endpoint_len);
Copy link
Contributor

Choose a reason for hiding this comment

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

you have this logic for endpoint, two sockets in testutil.hpp, could you try to reuse, please?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yes, there's loopback_ipv4_binder. I will change that.

bind_socket.bind("tcp://127.0.0.1:*");
char endpoint[255];
size_t endpoint_len = sizeof(endpoint);
bind_socket.getsockopt(ZMQ_LAST_ENDPOINT, &endpoint, &endpoint_len);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

});

connect_socket.connect(endpoint);
std::this_thread::sleep_for(std::chrono::milliseconds(250));
Copy link
Contributor

Choose a reason for hiding this comment

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

that made total running time of unit_tests ~13 times slower (~21ms -> ~270ms). Why do you need this? You want to abort while events are pending?

Copy link
Member Author

Choose a reason for hiding this comment

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

I want to wait until the expected events have been processed. If I abort immediately, they will probably not have been received. But maybe the expectations on expected events can be left out from this test. Then no waiting is necessary.

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.

None yet

4 participants