mirror of
https://github.com/libuv/libuv
synced 2025-03-28 21:13:16 +00:00
style fixes to close_cb_stack
This commit is contained in:
parent
2414d7e728
commit
84ebdf8429
@ -1,6 +1,9 @@
|
||||
#include "../oio.h"
|
||||
#include "test.h"
|
||||
|
||||
/* TODO: Add explanation of why we want on_close to be called from fresh
|
||||
* stack.
|
||||
*/
|
||||
|
||||
int nested = 0;
|
||||
int close_cb_called = 0;
|
||||
@ -18,19 +21,22 @@ TEST_IMPL(close_cb_stack) {
|
||||
|
||||
oio_init();
|
||||
|
||||
if (oio_tcp_handle_init(&handle, &close_cb, NULL))
|
||||
if (oio_tcp_handle_init(&handle, &close_cb, NULL)) {
|
||||
FATAL(oio_tcp_handle_init failed)
|
||||
}
|
||||
|
||||
nested++;
|
||||
|
||||
if (oio_close(&handle))
|
||||
if (oio_close(&handle)) {
|
||||
FATAL(oio_close failed)
|
||||
}
|
||||
|
||||
nested--;
|
||||
|
||||
oio_run();
|
||||
|
||||
ASSERT(close_cb_called && "oio_close_cb must be called exactly once")
|
||||
ASSERT(nested == 0)
|
||||
ASSERT(close_cb_called == 1 && "oio_close_cb must be called exactly once")
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user