test-loop-configure.c
Go to the documentation of this file.
1 /* Copyright (c) 2014, Ben Noordhuis <info@bnoordhuis.nl>
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14  */
15 
16 #include "uv.h"
17 #include "task.h"
18 
19 static void timer_cb(uv_timer_t* handle) {
20  uv_close((uv_handle_t*) handle, NULL);
21 }
22 
23 
24 TEST_IMPL(loop_configure) {
27  ASSERT(0 == uv_loop_init(&loop));
28 #ifdef _WIN32
30 #else
32 #endif
36  ASSERT(0 == uv_loop_close(&loop));
37  return 0;
38 }
async_greeter_server_with_graceful_shutdown.loop
loop
Definition: async_greeter_server_with_graceful_shutdown.py:59
task.h
ASSERT
#define ASSERT(expr)
Definition: task.h:102
uv_run
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
Definition: unix/core.c:361
TEST_IMPL
TEST_IMPL(loop_configure)
Definition: test-loop-configure.c:24
timer_cb
static void timer_cb(uv_timer_t *handle)
Definition: test-loop-configure.c:19
uv_close
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
Definition: unix/core.c:112
uv_loop_close
UV_EXTERN int uv_loop_close(uv_loop_t *loop)
Definition: uv-common.c:761
UV_RUN_DEFAULT
@ UV_RUN_DEFAULT
Definition: uv.h:254
uv_loop_init
UV_EXTERN int uv_loop_init(uv_loop_t *loop)
Definition: loop.c:30
uv_timer_s
Definition: uv.h:850
uv.h
uv_loop_configure
UV_EXTERN int uv_loop_configure(uv_loop_t *loop, uv_loop_option option,...)
Definition: uv-common.c:716
UV_LOOP_BLOCK_SIGNAL
@ UV_LOOP_BLOCK_SIGNAL
Definition: uv.h:250
handle
static csh handle
Definition: test_arm_regression.c:16
uv_handle_s
Definition: uv.h:441
uv_timer_start
UV_EXTERN int uv_timer_start(uv_timer_t *handle, uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
Definition: timer.c:66
uv_loop_s
Definition: uv.h:1767
uv_timer_init
UV_EXTERN int uv_timer_init(uv_loop_t *, uv_timer_t *handle)
Definition: timer.c:58
timer_handle
static uv_timer_t timer_handle
Definition: benchmark-loop-count.c:32


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:30