diff --git a/include/uv.h b/include/uv.h index d85f74fe..b9c8be9a 100644 --- a/include/uv.h +++ b/include/uv.h @@ -1802,8 +1802,6 @@ struct uv_counters_s { struct uv_loop_s { UV_LOOP_PRIVATE_FIELDS - /* Diagnostic counters */ - uv_counters_t counters; /* The last error */ uv_err_t last_err; /* Loop reference counting */ diff --git a/src/fs-poll.c b/src/fs-poll.c index 99d3bcfa..a70c0472 100644 --- a/src/fs-poll.c +++ b/src/fs-poll.c @@ -36,8 +36,6 @@ static uv_statbuf_t zero_statbuf; int uv_fs_poll_init(uv_loop_t* loop, uv_fs_poll_t* handle) { /* TODO(bnoordhuis) Mark fs_req internal. */ uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_POLL); - loop->counters.fs_poll_init++; - if (uv_timer_init(loop, &handle->timer_handle)) return -1; diff --git a/src/unix/async.c b/src/unix/async.c index 192a3618..6386c6d6 100644 --- a/src/unix/async.c +++ b/src/unix/async.c @@ -65,8 +65,6 @@ int uv_async_init(uv_loop_t* loop, uv_async_t* handle, uv_async_cb async_cb) { return uv__set_sys_error(loop, errno); uv__handle_init(loop, (uv_handle_t*)handle, UV_ASYNC); - loop->counters.async_init++; - handle->async_cb = async_cb; handle->pending = 0; diff --git a/src/unix/cygwin.c b/src/unix/cygwin.c index a99779d4..7153a7b8 100644 --- a/src/unix/cygwin.c +++ b/src/unix/cygwin.c @@ -73,7 +73,6 @@ int uv_fs_event_init(uv_loop_t* loop, const char* filename, uv_fs_event_cb cb, int flags) { - loop->counters.fs_event_init++; uv__set_sys_error(loop, ENOSYS); return -1; } diff --git a/src/unix/internal.h b/src/unix/internal.h index ede6c441..cfdb88d9 100644 --- a/src/unix/internal.h +++ b/src/unix/internal.h @@ -105,7 +105,6 @@ enum { inline static void uv__req_init(uv_loop_t* loop, uv_req_t* req, uv_req_type type) { - loop->counters.req_init++; req->type = type; uv__req_register(loop, req); } diff --git a/src/unix/kqueue.c b/src/unix/kqueue.c index ee1bbd17..be68b586 100644 --- a/src/unix/kqueue.c +++ b/src/unix/kqueue.c @@ -90,8 +90,6 @@ int uv_fs_event_init(uv_loop_t* loop, int flags) { int fd; - loop->counters.fs_event_init++; - /* We don't support any flags yet. */ assert(!flags); diff --git a/src/unix/linux/inotify.c b/src/unix/linux/inotify.c index 51ea996a..3c290883 100644 --- a/src/unix/linux/inotify.c +++ b/src/unix/linux/inotify.c @@ -176,8 +176,6 @@ int uv_fs_event_init(uv_loop_t* loop, int events; int wd; - loop->counters.fs_event_init++; - /* We don't support any flags yet. */ assert(!flags); diff --git a/src/unix/loop-watcher.c b/src/unix/loop-watcher.c index 6e6a6890..9d1414b8 100644 --- a/src/unix/loop-watcher.c +++ b/src/unix/loop-watcher.c @@ -25,7 +25,6 @@ #define UV_LOOP_WATCHER_DEFINE(name, type) \ int uv_##name##_init(uv_loop_t* loop, uv_##name##_t* handle) { \ uv__handle_init(loop, (uv_handle_t*)handle, UV_##type); \ - loop->counters.name##_init++; \ handle->name##_cb = NULL; \ return 0; \ } \ diff --git a/src/unix/pipe.c b/src/unix/pipe.c index 957e96f8..30809dc2 100644 --- a/src/unix/pipe.c +++ b/src/unix/pipe.c @@ -34,7 +34,6 @@ static void uv__pipe_accept(uv_loop_t* loop, uv__io_t* w, int events); int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) { uv__stream_init(loop, (uv_stream_t*)handle, UV_NAMED_PIPE); - loop->counters.pipe_init++; handle->shutdown_req = NULL; handle->connect_req = NULL; handle->pipe_fname = NULL; diff --git a/src/unix/poll.c b/src/unix/poll.c index 13796ab5..8d6e299d 100644 --- a/src/unix/poll.c +++ b/src/unix/poll.c @@ -54,8 +54,6 @@ static void uv__poll_io(uv_loop_t* loop, uv__io_t* w, int events) { int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) { uv__handle_init(loop, (uv_handle_t*) handle, UV_POLL); - loop->counters.poll_init++; - handle->fd = fd; handle->poll_cb = NULL; uv__io_init(&handle->io_watcher, uv__poll_io, fd, 0); diff --git a/src/unix/process.c b/src/unix/process.c index 18f76715..fce7b1c4 100644 --- a/src/unix/process.c +++ b/src/unix/process.c @@ -362,7 +362,6 @@ int uv_spawn(uv_loop_t* loop, UV_PROCESS_SETUID))); uv__handle_init(loop, (uv_handle_t*)process, UV_PROCESS); - loop->counters.process_init++; ngx_queue_init(&process->queue); stdio_count = options.stdio_count; diff --git a/src/unix/stream.c b/src/unix/stream.c index 26875a7c..70abb0e5 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -57,8 +57,6 @@ void uv__stream_init(uv_loop_t* loop, uv_stream_t* stream, uv_handle_type type) { uv__handle_init(loop, (uv_handle_t*)stream, type); - loop->counters.stream_init++; - stream->alloc_cb = NULL; stream->close_cb = NULL; stream->connection_cb = NULL; @@ -489,7 +487,6 @@ start: } else { /* Successful write */ - /* Update the counters. */ while (n >= 0) { uv_buf_t* buf = &(req->bufs[req->write_index]); size_t len = buf->len; diff --git a/src/unix/sunos.c b/src/unix/sunos.c index 8c626a3a..7ff56c06 100644 --- a/src/unix/sunos.c +++ b/src/unix/sunos.c @@ -183,8 +183,6 @@ int uv_fs_event_init(uv_loop_t* loop, int portfd; int first_run = 0; - loop->counters.fs_event_init++; - /* We don't support any flags yet. */ assert(!flags); if (loop->fs_fd == -1) { @@ -233,7 +231,6 @@ int uv_fs_event_init(uv_loop_t* loop, const char* filename, uv_fs_event_cb cb, int flags) { - loop->counters.fs_event_init++; uv__set_sys_error(loop, ENOSYS); return -1; } diff --git a/src/unix/tcp.c b/src/unix/tcp.c index d9cbd0b4..441473cd 100644 --- a/src/unix/tcp.c +++ b/src/unix/tcp.c @@ -30,7 +30,6 @@ int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* tcp) { uv__stream_init(loop, (uv_stream_t*)tcp, UV_TCP); - loop->counters.tcp_init++; tcp->idle_handle = NULL; return 0; } diff --git a/src/unix/timer.c b/src/unix/timer.c index 0d81997b..a560584d 100644 --- a/src/unix/timer.c +++ b/src/unix/timer.c @@ -39,8 +39,6 @@ RB_GENERATE_STATIC(uv__timers, uv_timer_s, tree_entry, uv__timer_cmp) int uv_timer_init(uv_loop_t* loop, uv_timer_t* handle) { - loop->counters.timer_init++; - uv__handle_init(loop, (uv_handle_t*)handle, UV_TIMER); handle->timer_cb = NULL; diff --git a/src/unix/tty.c b/src/unix/tty.c index 7193db8b..3ef9064a 100644 --- a/src/unix/tty.c +++ b/src/unix/tty.c @@ -45,7 +45,6 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) { tty->flags |= UV_STREAM_BLOCKING; } - loop->counters.tty_init++; tty->mode = 0; return 0; } diff --git a/src/unix/udp.c b/src/unix/udp.c index 9f87060a..0d88a7b2 100644 --- a/src/unix/udp.c +++ b/src/unix/udp.c @@ -453,8 +453,6 @@ int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) { memset(handle, 0, sizeof *handle); uv__handle_init(loop, (uv_handle_t*)handle, UV_UDP); - loop->counters.udp_init++; - handle->fd = -1; ngx_queue_init(&handle->write_queue); ngx_queue_init(&handle->write_completed_queue); diff --git a/src/uv-common.h b/src/uv-common.h index d159727d..4608ee54 100644 --- a/src/uv-common.h +++ b/src/uv-common.h @@ -158,7 +158,6 @@ UNUSED static void uv__handle_unref(uv_handle_t* h) { UNUSED static void uv__handle_init(uv_loop_t* loop, uv_handle_t* handle, uv_handle_type type) { - loop->counters.handle_init++; handle->loop = loop; handle->type = type; handle->flags = UV__HANDLE_REF; /* ref the loop when active */ diff --git a/src/win/async.c b/src/win/async.c index 1b733c40..ed1e9960 100644 --- a/src/win/async.c +++ b/src/win/async.c @@ -78,8 +78,6 @@ int uv_async_init(uv_loop_t* loop, uv_async_t* handle, uv_async_cb async_cb) { req->type = UV_WAKEUP; req->data = handle; - loop->counters.async_init++; - uv__handle_start(handle); return 0; diff --git a/src/win/core.c b/src/win/core.c index e288fc4c..d704d886 100644 --- a/src/win/core.c +++ b/src/win/core.c @@ -96,8 +96,6 @@ static void uv_loop_init(uv_loop_t* loop) { loop->active_udp_streams = 0; loop->last_err = uv_ok_; - - memset(&loop->counters, 0, sizeof loop->counters); } diff --git a/src/win/fs-event.c b/src/win/fs-event.c index 68e03e39..a5d425bc 100644 --- a/src/win/fs-event.c +++ b/src/win/fs-event.c @@ -55,8 +55,6 @@ static void uv_fs_event_init_handle(uv_loop_t* loop, uv_fs_event_t* handle, } uv__handle_start(handle); - - loop->counters.fs_event_init++; } diff --git a/src/win/loop-watcher.c b/src/win/loop-watcher.c index 615f7cde..1a028620 100644 --- a/src/win/loop-watcher.c +++ b/src/win/loop-watcher.c @@ -39,7 +39,6 @@ void uv_loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle) { #define UV_LOOP_WATCHER_DEFINE(name, NAME) \ int uv_##name##_init(uv_loop_t* loop, uv_##name##_t* handle) { \ uv__handle_init(loop, (uv_handle_t*) handle, UV_##NAME); \ - loop->counters.name##_init++; \ \ return 0; \ } \ diff --git a/src/win/pipe.c b/src/win/pipe.c index 5da14eaa..e0d08e1c 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -88,8 +88,6 @@ int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) { uv_req_init(loop, (uv_req_t*) &handle->ipc_header_write_req); - loop->counters.pipe_init++; - return 0; } diff --git a/src/win/poll.c b/src/win/poll.c index 9800b716..30819894 100644 --- a/src/win/poll.c +++ b/src/win/poll.c @@ -558,8 +558,6 @@ int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle, handle->poll_req_2.type = UV_POLL_REQ; handle->poll_req_2.data = handle; - loop->counters.poll_init++; - return 0; } diff --git a/src/win/process.c b/src/win/process.c index a8f690d9..7479341a 100644 --- a/src/win/process.c +++ b/src/win/process.c @@ -74,9 +74,6 @@ static void uv_process_init(uv_loop_t* loop, uv_process_t* handle) { uv_req_init(loop, (uv_req_t*)&handle->close_req); handle->close_req.type = UV_PROCESS_CLOSE; handle->close_req.data = handle; - - loop->counters.handle_init++; - loop->counters.process_init++; } diff --git a/src/win/req-inl.h b/src/win/req-inl.h index a0d91cb1..643171b2 100644 --- a/src/win/req-inl.h +++ b/src/win/req-inl.h @@ -80,7 +80,6 @@ INLINE static void uv_req_init(uv_loop_t* loop, uv_req_t* req) { - loop->counters.req_init++; req->type = UV_UNKNOWN_REQ; SET_REQ_SUCCESS(req); } diff --git a/src/win/stream-inl.h b/src/win/stream-inl.h index 7e2311c6..3cde668a 100644 --- a/src/win/stream-inl.h +++ b/src/win/stream-inl.h @@ -36,8 +36,6 @@ INLINE static void uv_stream_init(uv_loop_t* loop, uv__handle_init(loop, (uv_handle_t*) handle, type); handle->write_queue_size = 0; handle->activecnt = 0; - - loop->counters.stream_init++; } diff --git a/src/win/tcp.c b/src/win/tcp.c index 2a25358d..fdca4529 100644 --- a/src/win/tcp.c +++ b/src/win/tcp.c @@ -149,8 +149,6 @@ int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* handle) { handle->func_connectex = NULL; handle->processed_accepts = 0; - loop->counters.tcp_init++; - return 0; } diff --git a/src/win/timer.c b/src/win/timer.c index 94b7b219..e9eab9ab 100644 --- a/src/win/timer.c +++ b/src/win/timer.c @@ -71,8 +71,6 @@ int uv_timer_init(uv_loop_t* loop, uv_timer_t* handle) { handle->timer_cb = NULL; handle->repeat = 0; - loop->counters.timer_init++; - return 0; } diff --git a/src/win/tty.c b/src/win/tty.c index 66103e6b..e67a6be2 100644 --- a/src/win/tty.c +++ b/src/win/tty.c @@ -92,8 +92,6 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) { HANDLE win_handle; CONSOLE_SCREEN_BUFFER_INFO info; - loop->counters.tty_init++; - win_handle = (HANDLE) _get_osfhandle(fd); if (win_handle == INVALID_HANDLE_VALUE) { uv__set_sys_error(loop, ERROR_INVALID_HANDLE); diff --git a/src/win/udp.c b/src/win/udp.c index 3f19fe30..9ad2f69f 100644 --- a/src/win/udp.c +++ b/src/win/udp.c @@ -135,8 +135,6 @@ int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) { handle->recv_req.type = UV_UDP_RECV; handle->recv_req.data = handle; - loop->counters.udp_init++; - return 0; } diff --git a/test/test-counters-init.c b/test/test-counters-init.c deleted file mode 100644 index 63186842..00000000 --- a/test/test-counters-init.c +++ /dev/null @@ -1,215 +0,0 @@ -/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ -#define UNIX (defined(__unix__) || defined(__POSIX__) || defined(__APPLE__)) -#include "task.h" -#include "uv.h" -#include - -#if UNIX -#include /* unlink, rmdir, etc. */ -#else -# include -# include -# define unlink _unlink -# define rmdir _rmdir -# define stat _stati64 -# define open _open -# define write _write -# define lseek _lseek -# define close _close -#endif - -static char exepath[1024]; -static size_t exepath_size = 1024; -static char* args[3]; -static uv_fs_t open_req; -static uv_tcp_t tcp; -static uv_udp_t udp; -static uv_pipe_t uvpipe; -static uv_tty_t tty; -static uv_prepare_t prepare; -static uv_check_t check; -static uv_idle_t idle; -static uv_async_t async; -static uv_timer_t timer; -static uv_fs_event_t fs_event; -static uv_process_t process; -static uv_process_options_t options; -static uv_fs_t fs_req; - -static void exit_cb(uv_process_t* process, int exit_status, int term_signal) { - ASSERT(exit_status == 1); - ASSERT(term_signal == 0); - uv_close((uv_handle_t*)process, NULL); -} - -static void init_process_options(char* test, uv_exit_cb exit_cb) { - int r = uv_exepath(exepath, &exepath_size); - ASSERT(r == 0); - exepath[exepath_size] = '\0'; - args[0] = exepath; - args[1] = test; - args[2] = NULL; - options.file = exepath; - options.args = args; - options.exit_cb = exit_cb; -} - -static void create_dir(uv_loop_t* loop, const char* name) { - int r; - uv_fs_t req; - r = uv_fs_rmdir(loop, &req, name, NULL); - r = uv_fs_mkdir(loop, &req, name, 0755, NULL); - ASSERT(r == 0 || uv_last_error(loop).code == UV_EEXIST); - uv_fs_req_cleanup(&req); -} - -static void create_cb(uv_fs_t* req) { - ASSERT(req == &open_req); - ASSERT(req->fs_type == UV_FS_OPEN); - ASSERT(req->result != -1); - uv_fs_req_cleanup(req); - unlink("test_file"); -} - -TEST_IMPL(counters_init) { - int r; - uint64_t eio_init_prev; - uint64_t req_init_prev; - uint64_t handle_init_prev; - uint64_t stream_init_prev; - uint64_t tcp_init_prev; - uint64_t udp_init_prev; - uint64_t pipe_init_prev; - uint64_t tty_init_prev; - uint64_t prepare_init_prev; - uint64_t check_init_prev; - uint64_t idle_init_prev; - uint64_t async_init_prev; - uint64_t timer_init_prev; - uint64_t process_init_prev; - uint64_t fs_event_init_prev; - - /* req_init and eio_init test by uv_fs_open() */ - unlink("test_file"); - req_init_prev = uv_default_loop()->counters.req_init; - eio_init_prev = uv_default_loop()->counters.eio_init; - r = uv_fs_open(uv_default_loop(), &open_req, "test_file", O_WRONLY | O_CREAT, - S_IREAD | S_IWRITE, create_cb); - ASSERT(r == 0); - ASSERT(open_req.result == 0); - ASSERT(uv_default_loop()->counters.req_init == ++req_init_prev); -#ifndef _WIN32 - ASSERT(uv_default_loop()->counters.eio_init == ++eio_init_prev); -#endif - - /* tcp_init, stream_init and handle_init test by uv_tcp_init() */ - tcp_init_prev = uv_default_loop()->counters.tcp_init; - stream_init_prev = uv_default_loop()->counters.stream_init; - handle_init_prev = uv_default_loop()->counters.handle_init; - r = uv_tcp_init(uv_default_loop(), &tcp); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.tcp_init == ++tcp_init_prev); - ASSERT(uv_default_loop()->counters.stream_init == ++stream_init_prev); - ASSERT(uv_default_loop()->counters.handle_init == ++handle_init_prev); - uv_close((uv_handle_t*)&tcp, NULL); - - /* udp_init test by uv_udp_init() */ - udp_init_prev = uv_default_loop()->counters.udp_init; - r = uv_udp_init(uv_default_loop(), &udp); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.udp_init == ++udp_init_prev); - uv_close((uv_handle_t*)&udp, NULL); - - /* pipe_init uv_pipe_init() */ - pipe_init_prev = uv_default_loop()->counters.pipe_init; - uv_pipe_init(uv_default_loop(), &uvpipe, 0); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.pipe_init == ++pipe_init_prev); - uv_close((uv_handle_t*)&uvpipe, NULL); - - /* tty_init test by uv_tty_init()*/ - tty_init_prev = uv_default_loop()->counters.tty_init; - r = uv_tty_init(uv_default_loop(), &tty, 1, 0); - /* uv_tty_init() always returns -1 in run_test in Windows - so that we avoid to check return value. - */ -#ifndef _WIN32 - ASSERT(r == 0); - uv_close((uv_handle_t*)&tty, NULL); -#endif - ASSERT(uv_default_loop()->counters.tty_init == ++tty_init_prev); - - /* prepare_init test by uv_prepare_init() */ - prepare_init_prev = uv_default_loop()->counters.prepare_init; - r = uv_prepare_init(uv_default_loop(), &prepare); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.prepare_init == ++prepare_init_prev); - uv_close((uv_handle_t*)&prepare, NULL); - - /* check_init test by uv_check_init() */ - check_init_prev = uv_default_loop()->counters.check_init; - r = uv_check_init(uv_default_loop(), &check); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.check_init == ++check_init_prev); - uv_close((uv_handle_t*)&check, NULL); - - /* idle_init test by uv_idle_init() */ - idle_init_prev = uv_default_loop()->counters.idle_init; - r = uv_idle_init(uv_default_loop(), &idle); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.idle_init == ++idle_init_prev); - uv_close((uv_handle_t*)&idle, NULL); - - /* async_init test by uv_async_init() */ - async_init_prev = uv_default_loop()->counters.async_init; - r = uv_async_init(uv_default_loop(), &async, NULL); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.async_init == ++async_init_prev); - uv_close((uv_handle_t*)&async, NULL); - - /* timer_init test by uv_timer_init() */ - timer_init_prev = uv_default_loop()->counters.timer_init; - r = uv_timer_init(uv_default_loop(), &timer); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.timer_init == ++timer_init_prev); - uv_close((uv_handle_t*)&timer, NULL); - - /* process_init test by uv_spawn() */ - process_init_prev = uv_default_loop()->counters.process_init; - init_process_options("spawn_helper1", exit_cb); - r = uv_spawn(uv_default_loop(), &process, options); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.process_init == ++process_init_prev); - r = uv_run(uv_default_loop()); - ASSERT(r == 0); - - /* fs_event_init test by uv_fs_event_init() */ - create_dir(uv_default_loop(), "watch_dir"); - fs_event_init_prev = uv_default_loop()->counters.fs_event_init; - r = uv_fs_event_init(uv_default_loop(), &fs_event, "watch_dir", NULL, 0); - ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.fs_event_init == ++fs_event_init_prev); - uv_fs_rmdir(uv_default_loop(), &fs_req, "watch_dir", NULL); - uv_fs_req_cleanup(&fs_req); - - return 0; -} diff --git a/test/test-delayed-accept.c b/test/test-delayed-accept.c index 990444ef..672672a9 100644 --- a/test/test-delayed-accept.c +++ b/test/test-delayed-accept.c @@ -50,7 +50,6 @@ static void close_cb(uv_handle_t* handle) { static void do_accept(uv_timer_t* timer_handle, int status) { uv_tcp_t* server; uv_tcp_t* accepted_handle = (uv_tcp_t*)malloc(sizeof *accepted_handle); - uint64_t tcpcnt; int r; ASSERT(timer_handle != NULL); @@ -60,15 +59,10 @@ static void do_accept(uv_timer_t* timer_handle, int status) { r = uv_tcp_init(uv_default_loop(), accepted_handle); ASSERT(r == 0); - /* Test to that uv_default_loop()->counters.tcp_init does not increase across the uv_accept. */ - tcpcnt = uv_default_loop()->counters.tcp_init; - server = (uv_tcp_t*)timer_handle->data; r = uv_accept((uv_stream_t*)server, (uv_stream_t*)accepted_handle); ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.tcp_init == tcpcnt); - do_accept_called++; /* Immediately close the accepted handle. */ @@ -115,9 +109,6 @@ static void start_server() { r = uv_tcp_init(uv_default_loop(), server); ASSERT(r == 0); - ASSERT(uv_default_loop()->counters.tcp_init == 1); - ASSERT(uv_default_loop()->counters.handle_init == 1); - r = uv_tcp_bind(server, addr); ASSERT(r == 0); diff --git a/test/test-list.h b/test/test-list.h index 3eab32db..47e47eed 100644 --- a/test/test-list.h +++ b/test/test-list.h @@ -175,7 +175,6 @@ TEST_DECLARE (thread_rwlock) TEST_DECLARE (thread_create) TEST_DECLARE (strlcpy) TEST_DECLARE (strlcat) -TEST_DECLARE (counters_init) TEST_DECLARE (dlerror) TEST_DECLARE (poll_duplex) TEST_DECLARE (poll_unidirectional) @@ -419,7 +418,6 @@ TASK_LIST_START TEST_ENTRY (thread_create) TEST_ENTRY (strlcpy) TEST_ENTRY (strlcat) - TEST_ENTRY (counters_init) TEST_ENTRY (dlerror) #if 0 /* These are for testing the test runner. */ diff --git a/uv.gyp b/uv.gyp index 10e2cb9b..bb302e49 100644 --- a/uv.gyp +++ b/uv.gyp @@ -287,7 +287,6 @@ 'test/test-udp-options.c', 'test/test-udp-send-and-recv.c', 'test/test-udp-multicast-join.c', - 'test/test-counters-init.c', 'test/test-dlerror.c', 'test/test-udp-multicast-ttl.c', ],