-
Notifications
You must be signed in to change notification settings - Fork 758
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
Conversation
Solution: added test case
Solution: add a test and fix implementation of monitor_t::abort to make it usable
Pull Request Test Coverage Report for Build 120
💛 - Coveralls |
) | ||
|
||
target_link_libraries( | ||
unit_tests | ||
PRIVATE gtest_main | ||
PRIVATE gtest | ||
PRIVATE gmock_main |
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.
is the indentation intentional ?
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.
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); |
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.
you have this logic for endpoint, two sockets in testutil.hpp, could you try to reuse, please?
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.
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); |
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.
same here
}); | ||
|
||
connect_socket.connect(endpoint); | ||
std::this_thread::sleep_for(std::chrono::milliseconds(250)); |
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.
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?
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.
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.
No description provided.