-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test: fix issues reported by Coverity #8870
Conversation
Test failures are caused by parallel/test-tick-processor-builtin and parallel/test-tick-processor-unknown and do not seem to caused by this change, that only touches cctest executable. |
} | ||
class Timeout { | ||
public: | ||
Timeout(uv_loop_t* loop) : timed_out(false), done_(false) { |
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.
explicit
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.
Done
} | ||
bool timed_out; | ||
private: | ||
static void setFlag(uv_timer_t* timer) { |
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.
Style nit: can you either call this SetFlag
or set_flag
? Ditto for markDone.
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.
Done (used set_flag and mark_done)
LGTM once @bnoordhuis is happy with it. |
Thank you for the review. I uploaded a new version, please take another look. |
LGTM |
@bnoordhuis I've implemented your suggestions, please take another look. |
uv_timer_t* timer = start_timer(&timed_out); \ | ||
while (((condition)) && !timed_out) { \ | ||
Timeout timeout(&loop); \ | ||
while (((condition)) && !timeout.timed_out) { \ |
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.
While you're here, maybe you can remove the extraneous parentheses around condition
?
Wrapped the timer into class to ensure it is cleaned up properly. PR-URL: #8870 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Wrapped the timer into class to ensure it is cleaned up properly. PR-URL: #8870 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Wrapped the timer into class to ensure it is cleaned up properly. PR-URL: #8870 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
This is a refactoring of the inspector socket test case.
Description of change
Wrapped the timer into class to ensure it is cleaned up properly.
CC: @ofrobots