Browse files

test: move loop cleanup code to the individual tests

  • Loading branch information...
1 parent 28eb619 commit 47eb03490ac6e2456f903c0e72ecb22f68b3d0e9 @piscisaureus piscisaureus committed Oct 16, 2012
Showing with 187 additions and 3 deletions.
  1. +2 −0 test/benchmark-async-pummel.c
  2. +1 −0 test/benchmark-async.c
  3. +1 −0 test/benchmark-fs-stat.c
  4. +1 −0 test/benchmark-getaddrinfo.c
  5. +2 −0 test/benchmark-loop-count.c
  6. +1 −0 test/benchmark-million-timers.c
  7. +1 −0 test/benchmark-multi-accept.c
  8. +1 −0 test/benchmark-ping-pongs.c
  9. +1 −0 test/benchmark-pound.c
  10. +5 −0 test/benchmark-pump.c
  11. +1 −0 test/benchmark-spawn.c
  12. +1 −0 test/benchmark-tcp-write-batch.c
  13. +1 −0 test/benchmark-udp-pummel.c
  14. +0 −1 test/runner.c
  15. +5 −0 test/task.h
  16. +1 −0 test/test-active.c
  17. +1 −0 test/test-async.c
  18. +1 −0 test/test-callback-order.c
  19. +1 −0 test/test-callback-stack.c
  20. +2 −0 test/test-connection-fail.c
  21. +1 −0 test/test-delayed-accept.c
  22. +8 −0 test/test-fs-event.c
  23. +1 −0 test/test-fs-poll.c
  24. +24 −0 test/test-fs.c
  25. +2 −0 test/test-getaddrinfo.c
  26. +2 −0 test/test-getsockname.c
  27. +1 −0 test/test-idle.c
  28. +11 −2 test/test-ipc-send-recv.c
  29. +5 −0 test/test-ipc.c
  30. +1 −0 test/test-loop-handles.c
  31. +1 −0 test/test-multiple-listen.c
  32. +3 −0 test/test-ping-pong.c
  33. +4 −0 test/test-pipe-bind-error.c
  34. +2 −0 test/test-pipe-connect-error.c
  35. +1 −0 test/test-poll-close.c
  36. +2 −0 test/test-poll.c
  37. +22 −0 test/test-ref.c
  38. +1 −0 test/test-run-once.c
  39. +2 −0 test/test-shutdown-close.c
  40. +1 −0 test/test-shutdown-eof.c
  41. +2 −0 test/test-signal.c
  42. +19 −0 test/test-spawn.c
  43. +2 −0 test/test-stdio-over-pipes.c
  44. +7 −0 test/test-tcp-bind-error.c
  45. +5 −0 test/test-tcp-bind6-error.c
  46. +1 −0 test/test-tcp-close-while-connecting.c
  47. +1 −0 test/test-tcp-close.c
  48. +1 −0 test/test-tcp-connect-error-after-write.c
  49. +1 −0 test/test-tcp-connect-error.c
  50. +1 −0 test/test-tcp-connect-timeout.c
  51. +1 −0 test/test-tcp-connect6-error.c
  52. +1 −0 test/test-tcp-flags.c
  53. +1 −0 test/test-tcp-open.c
  54. +1 −0 test/test-tcp-shutdown-after-write.c
  55. +1 −0 test/test-tcp-unexpected-read.c
  56. +1 −0 test/test-tcp-write-error.c
  57. +1 −0 test/test-tcp-write-to-half-open-connection.c
  58. +1 −0 test/test-tcp-writealot.c
  59. +1 −0 test/test-threadpool.c
  60. +1 −0 test/test-timer-again.c
  61. +2 −0 test/test-timer.c
  62. +1 −0 test/test-tty.c
  63. +1 −0 test/test-udp-dgram-too-big.c
  64. +2 −0 test/test-udp-ipv6.c
  65. +1 −0 test/test-udp-multicast-join.c
  66. +1 −0 test/test-udp-multicast-ttl.c
  67. +1 −0 test/test-udp-open.c
  68. +1 −0 test/test-udp-options.c
  69. +1 −0 test/test-udp-send-and-recv.c
  70. +1 −0 test/test-walk-handles.c
View
2 test/benchmark-async-pummel.c
@@ -73,6 +73,8 @@ static int test_async_pummel(int nthreads) {
fmt(callbacks / (time / 1e9)));
free(tids);
+
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-async.c
@@ -113,6 +113,7 @@ static int test_async(int nthreads) {
free(threads);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-fs-stat.c
@@ -131,5 +131,6 @@ BENCHMARK_IMPL(fs_stat) {
warmup(path);
sync_bench(path);
async_bench(path);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-getaddrinfo.c
@@ -90,5 +90,6 @@ BENCHMARK_IMPL(getaddrinfo) {
LOGF("getaddrinfo: %.0f req/s\n",
(double) calls_completed / (double) (end_time - start_time) * 1000.0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/benchmark-loop-count.c
@@ -67,6 +67,7 @@ BENCHMARK_IMPL(loop_count) {
ns / 1e9,
NUM_TICKS / (ns / 1e9));
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -84,5 +85,6 @@ BENCHMARK_IMPL(loop_count_timed) {
LOGF("loop_count: %lu ticks (%.0f ticks/s)\n", ticks, ticks / 5.0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-million-timers.c
@@ -61,5 +61,6 @@ BENCHMARK_IMPL(million_timers) {
LOGF("%.2f seconds\n", (after - before) / 1e9);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-multi-accept.c
@@ -416,6 +416,7 @@ static int test_tcp(unsigned int num_servers, unsigned int num_clients) {
free(clients);
free(servers);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-ping-pongs.c
@@ -209,5 +209,6 @@ BENCHMARK_IMPL(ping_pongs) {
ASSERT(completed_pingers == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-pound.c
@@ -300,6 +300,7 @@ static int pound_it(int concurrency,
closed_streams / secs,
conns_failed);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
5 test/benchmark-pump.c
@@ -404,6 +404,7 @@ HELPER_IMPL(pipe_pump_server) {
uv_run(loop);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -421,6 +422,8 @@ void tcp_pump(int n) {
maybe_connect_some();
uv_run(loop);
+
+ MAKE_VALGRIND_HAPPY();
}
@@ -435,6 +438,8 @@ void pipe_pump(int n) {
maybe_connect_some();
uv_run(loop);
+
+ MAKE_VALGRIND_HAPPY();
}
View
1 test/benchmark-spawn.c
@@ -158,5 +158,6 @@ BENCHMARK_IMPL(spawn) {
LOGF("spawn: %.0f spawns/s\n",
(double) N / (double) (end_time - start_time) * 1000.0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-tcp-write-batch.c
@@ -136,5 +136,6 @@ BENCHMARK_IMPL(tcp_write_batch) {
(long)NUM_WRITE_REQS,
(stop - start) / 1e9);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/benchmark-udp-pummel.c
@@ -204,6 +204,7 @@ static int do_packet_storm(int n_senders,
send_cb_called,
duration / 1000.0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/runner.c
@@ -300,7 +300,6 @@ int run_test_part(const char* test, const char* part) {
if (strcmp(test, task->task_name) == 0 &&
strcmp(part, task->process_name) == 0) {
r = task->main();
- uv_loop_delete(uv_default_loop());
return r;
}
}
View
5 test/task.h
@@ -91,6 +91,11 @@ typedef enum {
} \
} while (0)
+/* This macro cleans up the main loop. This is used to avoid valgrind
+ * warnings about memory being "leaked" by the main event loop.
+ */
+#define MAKE_VALGRIND_HAPPY() \
+ uv_loop_delete(uv_default_loop())
/* Just sugar for wrapping the main() for a task or helper. */
#define TEST_IMPL(name) \
View
1 test/test-active.c
@@ -78,5 +78,6 @@ TEST_IMPL(active) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-async.c
@@ -116,5 +116,6 @@ TEST_IMPL(async) {
ASSERT(0 == uv_thread_join(&thread));
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-callback-order.c
@@ -72,5 +72,6 @@ TEST_IMPL(callback_order) {
ASSERT(idle_cb_called == 1);
ASSERT(timer_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-callback-stack.c
@@ -199,5 +199,6 @@ TEST_IMPL(callback_stack) {
ASSERT(shutdown_cb_called == 1 && "shutdown_cb must be called exactly once");
ASSERT(close_cb_called == 2 && "close_cb must be called exactly twice");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-connection-fail.c
@@ -124,6 +124,7 @@ TEST_IMPL(connection_fail) {
ASSERT(timer_close_cb_calls == 0);
ASSERT(timer_cb_calls == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -144,5 +145,6 @@ TEST_IMPL(connection_fail_doesnt_auto_close) {
ASSERT(timer_close_cb_calls == 1);
ASSERT(timer_cb_calls == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-delayed-accept.c
@@ -184,5 +184,6 @@ TEST_IMPL(delayed_accept) {
ASSERT(connect_cb_called == 2);
ASSERT(close_cb_called == 7);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
8 test/test-fs-event.c
@@ -201,6 +201,7 @@ TEST_IMPL(fs_event_watch_dir) {
remove("watch_dir/file1");
remove("watch_dir/");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -234,6 +235,7 @@ TEST_IMPL(fs_event_watch_file) {
remove("watch_dir/file1");
remove("watch_dir/");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -252,6 +254,7 @@ TEST_IMPL(fs_event_watch_file_twice) {
ASSERT(0 == uv_timer_start(&timer, timer_cb_watch_twice, 10, 0));
ASSERT(0 == uv_run(loop));
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -289,6 +292,7 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
/* Cleanup */
remove("watch_file");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -321,6 +325,7 @@ TEST_IMPL(fs_event_no_callback_on_close) {
remove("watch_dir/file1");
remove("watch_dir/");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -361,6 +366,7 @@ TEST_IMPL(fs_event_immediate_close) {
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -390,6 +396,7 @@ TEST_IMPL(fs_event_close_with_pending_event) {
remove("watch_dir/file");
remove("watch_dir/");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -455,6 +462,7 @@ TEST_IMPL(fs_event_close_in_callback) {
remove("watch_dir/file5");
remove("watch_dir/");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-fs-poll.c
@@ -141,5 +141,6 @@ TEST_IMPL(fs_poll) {
ASSERT(timer_cb_called == 2);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
24 test/test-fs.c
@@ -482,6 +482,7 @@ TEST_IMPL(fs_file_noent) {
/* TODO add EACCES test */
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -508,6 +509,7 @@ TEST_IMPL(fs_file_nametoolong) {
uv_run(loop);
ASSERT(open_cb_count == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -536,6 +538,7 @@ TEST_IMPL(fs_file_loop) {
unlink("test_symlink");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -653,6 +656,7 @@ TEST_IMPL(fs_file_async) {
unlink("test_file");
unlink("test_file2");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -737,6 +741,7 @@ TEST_IMPL(fs_file_sync) {
unlink("test_file");
unlink("test_file2");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -828,6 +833,7 @@ TEST_IMPL(fs_async_dir) {
unlink("test_dir/file2");
rmdir("test_dir");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -891,6 +897,7 @@ TEST_IMPL(fs_async_sendfile) {
unlink("test_file");
unlink("test_file2");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -946,6 +953,7 @@ TEST_IMPL(fs_fstat) {
/* Cleanup. */
unlink("test_file");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1042,6 +1050,7 @@ TEST_IMPL(fs_chmod) {
/* Cleanup. */
unlink("test_file");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1104,6 +1113,7 @@ TEST_IMPL(fs_chown) {
/* Cleanup. */
unlink("test_file");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1186,6 +1196,7 @@ TEST_IMPL(fs_link) {
unlink("test_file_link");
unlink("test_file_link2");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1208,6 +1219,7 @@ TEST_IMPL(fs_readlink) {
ASSERT(req.errorno == UV_ENOENT);
uv_fs_req_cleanup(&req);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1329,6 +1341,7 @@ TEST_IMPL(fs_symlink) {
unlink("test_file_symlink2");
unlink("test_file_symlink2_symlink");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1440,6 +1453,7 @@ TEST_IMPL(fs_symlink_dir) {
rmdir("test_dir");
rmdir("test_dir_symlink");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1490,6 +1504,7 @@ TEST_IMPL(fs_utime) {
/* Cleanup. */
unlink(path);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1521,6 +1536,7 @@ TEST_IMPL(fs_stat_root) {
r = uv_fs_stat(loop, &stat_req, "\\\\?\\C:\\", NULL);
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
#endif
@@ -1580,6 +1596,7 @@ TEST_IMPL(fs_futime) {
/* Cleanup. */
unlink(path);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1596,6 +1613,7 @@ TEST_IMPL(fs_stat_missing_path) {
ASSERT(uv_last_error(loop).code == UV_ENOENT);
uv_fs_req_cleanup(&req);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1627,6 +1645,7 @@ TEST_IMPL(fs_readdir_empty_dir) {
uv_fs_rmdir(loop, &req, path, NULL);
uv_fs_req_cleanup(&req);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1650,6 +1669,7 @@ TEST_IMPL(fs_readdir_file) {
uv_run(loop);
ASSERT(readdir_cb_count == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1679,6 +1699,7 @@ TEST_IMPL(fs_open_dir) {
uv_run(loop);
ASSERT(open_cb_count == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1747,6 +1768,7 @@ TEST_IMPL(fs_file_open_append) {
/* Cleanup */
unlink("test_file");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1815,6 +1837,7 @@ TEST_IMPL(fs_rename_to_existing_file) {
unlink("test_file");
unlink("test_file2");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -1871,5 +1894,6 @@ TEST_IMPL(fs_read_file_eof) {
/* Cleanup */
unlink("test_file");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-getaddrinfo.c
@@ -88,6 +88,7 @@ TEST_IMPL(getaddrinfo_basic) {
ASSERT(getaddrinfo_cbs == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -118,5 +119,6 @@ TEST_IMPL(getaddrinfo_concurrent) {
ASSERT(callback_counts[i] == 1);
}
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-getsockname.c
@@ -322,6 +322,7 @@ TEST_IMPL(getsockname_tcp) {
ASSERT(getsocknamecount == 3);
ASSERT(getpeernamecount == 3);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -338,5 +339,6 @@ TEST_IMPL(getsockname_udp) {
ASSERT(getsocknamecount == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-idle.c
@@ -77,5 +77,6 @@ TEST_IMPL(idle_starvation) {
ASSERT(timer_cb_called == 1);
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
13 test/test-ipc-send-recv.c
@@ -123,7 +123,11 @@ TEST_IMPL(ipc_send_recv_pipe) {
r = uv_pipe_bind(&ctx.send.pipe, TEST_PIPENAME);
ASSERT(r == 0);
- return run_test();
+ r = run_test();
+ ASSERT(r == 0);
+
+ MAKE_VALGRIND_HAPPY();
+ return 0;
}
@@ -138,7 +142,11 @@ TEST_IMPL(ipc_send_recv_tcp) {
r = uv_tcp_bind(&ctx.send.tcp, uv_ip4_addr("127.0.0.1", TEST_PORT));
ASSERT(r == 0);
- return run_test();
+ r = run_test();
+ ASSERT(r == 0);
+
+ MAKE_VALGRIND_HAPPY();
+ return 0;
}
@@ -205,5 +213,6 @@ int ipc_send_recv_helper(void) {
r = uv_run(uv_default_loop());
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
5 test/test-ipc.c
@@ -321,6 +321,7 @@ static int run_ipc_test(const char* helper, uv_read2_cb read_cb) {
r = uv_run(uv_default_loop());
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -374,6 +375,7 @@ TEST_IMPL(listen_with_simultaneous_accepts) {
ASSERT(r == 0);
ASSERT(server.reqs_pending == 32);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -396,6 +398,7 @@ TEST_IMPL(listen_no_simultaneous_accepts) {
ASSERT(r == 0);
ASSERT(server.reqs_pending == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
#endif
@@ -570,6 +573,7 @@ int ipc_helper(int listen_after_write) {
ASSERT(connection_accepted == 1);
ASSERT(close_cb_called == 3);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -616,5 +620,6 @@ int ipc_helper_tcp_connection() {
ASSERT(tcp_conn_write_cb_called == 1);
ASSERT(close_cb_called == 4);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-loop-handles.c
@@ -332,5 +332,6 @@ TEST_IMPL(loop_handles) {
ASSERT(idle_2_close_cb_called == idle_2_cb_started);
ASSERT(idle_2_is_active == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-multiple-listen.c
@@ -98,5 +98,6 @@ TEST_IMPL(multiple_listen) {
ASSERT(connect_cb_called == 1);
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
3 test/test-ping-pong.c
@@ -228,6 +228,7 @@ TEST_IMPL(tcp_ping_pong) {
ASSERT(completed_pingers == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -238,6 +239,7 @@ TEST_IMPL(tcp_ping_pong_v6) {
ASSERT(completed_pingers == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -248,5 +250,6 @@ TEST_IMPL(pipe_ping_pong) {
ASSERT(completed_pingers == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
4 test/test-pipe-bind-error.c
@@ -71,6 +71,7 @@ TEST_IMPL(pipe_bind_error_addrinuse) {
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -92,6 +93,7 @@ TEST_IMPL(pipe_bind_error_addrnotavail) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -115,6 +117,7 @@ TEST_IMPL(pipe_bind_error_inval) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -136,5 +139,6 @@ TEST_IMPL(pipe_listen_without_bind) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-pipe-connect-error.c
@@ -73,6 +73,7 @@ TEST_IMPL(pipe_connect_bad_name) {
ASSERT(close_cb_called == 1);
ASSERT(connect_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -92,5 +93,6 @@ TEST_IMPL(pipe_connect_to_file) {
ASSERT(close_cb_called == 1);
ASSERT(connect_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-poll-close.c
@@ -68,5 +68,6 @@ TEST_IMPL(poll_close) {
ASSERT(close_cb_called == NUM_SOCKETS);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-poll.c
@@ -556,6 +556,8 @@ static void start_poll_test() {
spurious_writable_wakeups > 20);
ASSERT(closed_connections == NUM_CLIENTS * 2);
+
+ MAKE_VALGRIND_HAPPY();
}
View
22 test/test-ref.c
@@ -96,6 +96,7 @@ static void connect_and_shutdown(uv_connect_t* req, int status) {
TEST_IMPL(ref) {
uv_run(uv_default_loop());
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -107,6 +108,7 @@ TEST_IMPL(idle_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -117,6 +119,7 @@ TEST_IMPL(async_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -128,6 +131,7 @@ TEST_IMPL(prepare_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -139,6 +143,7 @@ TEST_IMPL(check_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -156,6 +161,7 @@ TEST_IMPL(unref_in_prepare_cb) {
uv_prepare_start(&h, prepare_cb);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -166,6 +172,7 @@ TEST_IMPL(timer_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -177,6 +184,7 @@ TEST_IMPL(timer_ref2) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -187,6 +195,7 @@ TEST_IMPL(fs_event_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -198,6 +207,7 @@ TEST_IMPL(fs_poll_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -208,6 +218,7 @@ TEST_IMPL(tcp_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -219,6 +230,7 @@ TEST_IMPL(tcp_ref2) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -233,6 +245,7 @@ TEST_IMPL(tcp_ref3) {
ASSERT(connect_cb_called == 1);
ASSERT(shutdown_cb_called == 1);
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -248,6 +261,7 @@ TEST_IMPL(tcp_ref4) {
ASSERT(write_cb_called == 1);
ASSERT(shutdown_cb_called == 1);
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -258,6 +272,7 @@ TEST_IMPL(udp_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -271,6 +286,7 @@ TEST_IMPL(udp_ref2) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -288,6 +304,7 @@ TEST_IMPL(udp_ref3) {
ASSERT(req_cb_called == 1);
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -298,6 +315,7 @@ TEST_IMPL(pipe_ref) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -309,6 +327,7 @@ TEST_IMPL(pipe_ref2) {
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -322,6 +341,7 @@ TEST_IMPL(pipe_ref3) {
ASSERT(connect_cb_called == 1);
ASSERT(shutdown_cb_called == 1);
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -336,6 +356,7 @@ TEST_IMPL(pipe_ref4) {
ASSERT(write_cb_called == 1);
ASSERT(shutdown_cb_called == 1);
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -371,5 +392,6 @@ TEST_IMPL(process_ref) {
do_close(&h);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-run-once.c
@@ -44,5 +44,6 @@ TEST_IMPL(run_once) {
while (uv_run_once(uv_default_loop()));
ASSERT(idle_counter == NUM_TICKS);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-shutdown-close.c
@@ -81,6 +81,7 @@ TEST_IMPL(shutdown_close_tcp) {
ASSERT(shutdown_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -99,5 +100,6 @@ TEST_IMPL(shutdown_close_pipe) {
ASSERT(shutdown_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-shutdown-eof.c
@@ -178,6 +178,7 @@ TEST_IMPL(shutdown_eof) {
ASSERT(called_timer_close_cb == 1);
ASSERT(called_timer_cb == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-signal.c
@@ -119,6 +119,7 @@ TEST_IMPL(we_get_signal) {
ASSERT(tc.ncalls == NSIGNALS);
ASSERT(sc.ncalls == NSIGNALS);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -144,6 +145,7 @@ TEST_IMPL(we_get_signals) {
for (i = 0; i < ARRAY_SIZE(tc); i++)
ASSERT(tc[i].ncalls == NSIGNALS);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
19 test/test-spawn.c
@@ -152,6 +152,8 @@ TEST_IMPL(spawn_fails) {
ASSERT(0 != uv_is_active((uv_handle_t*)&process));
ASSERT(0 == uv_run(uv_default_loop()));
ASSERT(uv_last_error(uv_default_loop()).code == UV_ENOENT);
+
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -170,6 +172,7 @@ TEST_IMPL(spawn_exit_code) {
ASSERT(exit_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -202,6 +205,7 @@ TEST_IMPL(spawn_stdout) {
printf("output is: %s", output);
ASSERT(strcmp("hello world\n", output) == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -254,6 +258,7 @@ TEST_IMPL(spawn_stdout_to_file) {
/* Cleanup. */
unlink("stdout_file");
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -296,6 +301,7 @@ TEST_IMPL(spawn_stdin) {
ASSERT(close_cb_called == 3); /* Once for process twice for the pipe. */
ASSERT(strcmp(buffer, output) == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -330,6 +336,7 @@ TEST_IMPL(spawn_stdio_greater_than_3) {
printf("output from stdio[3] is: %s", output);
ASSERT(strcmp("fourth stdio!\n", output) == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -351,6 +358,7 @@ TEST_IMPL(spawn_ignored_stdio) {
ASSERT(exit_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -375,6 +383,7 @@ TEST_IMPL(spawn_and_kill) {
ASSERT(exit_cb_called == 1);
ASSERT(close_cb_called == 2); /* Once for process and once for timer. */
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -402,6 +411,7 @@ TEST_IMPL(spawn_detached) {
err = uv_kill(process.pid, 15);
ASSERT(err.code == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -459,6 +469,7 @@ TEST_IMPL(spawn_and_kill_with_std) {
ASSERT(exit_cb_called == 1);
ASSERT(close_cb_called == 5); /* process x 1, timer x 1, stdio x 3. */
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -505,6 +516,7 @@ TEST_IMPL(spawn_and_ping) {
ASSERT(exit_cb_called == 1);
ASSERT(strcmp(output, "TEST") == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -538,6 +550,7 @@ TEST_IMPL(kill) {
ASSERT(exit_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -585,6 +598,7 @@ TEST_IMPL(spawn_detect_pipe_name_collisions_on_windows) {
printf("output is: %s", output);
ASSERT(strcmp("hello world\n", output) == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -744,6 +758,7 @@ TEST_IMPL(spawn_setuid_setgid) {
ASSERT(exit_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
#endif
@@ -777,6 +792,7 @@ TEST_IMPL(spawn_setuid_fails) {
ASSERT(exit_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -808,6 +824,7 @@ TEST_IMPL(spawn_setgid_fails) {
ASSERT(exit_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
#endif
@@ -839,6 +856,7 @@ TEST_IMPL(spawn_setuid_fails) {
ASSERT(close_cb_called == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -860,6 +878,7 @@ TEST_IMPL(spawn_setgid_fails) {
ASSERT(close_cb_called == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
#endif
View
2 test/test-stdio-over-pipes.c
@@ -147,6 +147,7 @@ TEST_IMPL(stdio_over_pipes) {
ASSERT(memcmp("hello world\n", output, 12) == 0);
ASSERT(output_used == 12);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -242,5 +243,6 @@ int stdio_over_pipes_helper() {
ASSERT(on_pipe_read_called == 1);
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
7 test/test-tcp-bind-error.c
@@ -63,6 +63,7 @@ TEST_IMPL(tcp_bind_error_addrinuse) {
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -87,6 +88,7 @@ TEST_IMPL(tcp_bind_error_addrnotavail_1) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -108,6 +110,7 @@ TEST_IMPL(tcp_bind_error_addrnotavail_2) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -133,6 +136,7 @@ TEST_IMPL(tcp_bind_error_fault) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -159,6 +163,7 @@ TEST_IMPL(tcp_bind_error_inval) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -174,6 +179,7 @@ TEST_IMPL(tcp_bind_localhost_ok) {
r = uv_tcp_bind(&server, addr);
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -187,5 +193,6 @@ TEST_IMPL(tcp_listen_without_bind) {
r = uv_listen((uv_stream_t*)&server, 128, NULL);
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
5 test/test-tcp-bind6-error.c
@@ -63,6 +63,7 @@ TEST_IMPL(tcp_bind6_error_addrinuse) {
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -84,6 +85,7 @@ TEST_IMPL(tcp_bind6_error_addrnotavail) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -109,6 +111,7 @@ TEST_IMPL(tcp_bind6_error_fault) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -135,6 +138,7 @@ TEST_IMPL(tcp_bind6_error_inval) {
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -150,5 +154,6 @@ TEST_IMPL(tcp_bind6_localhost_ok) {
r = uv_tcp_bind6(&server, addr);
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-close-while-connecting.c
@@ -76,5 +76,6 @@ TEST_IMPL(tcp_close_while_connecting) {
ASSERT(timer1_cb_called == 1);
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-close.c
@@ -125,5 +125,6 @@ TEST_IMPL(tcp_close) {
ASSERT(write_cb_called == NUM_WRITE_REQS);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-connect-error-after-write.c
@@ -91,5 +91,6 @@ TEST_IMPL(tcp_connect_error_after_write) {
ASSERT(write_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-connect-error.c
@@ -66,5 +66,6 @@ TEST_IMPL(tcp_connect_error_fault) {
ASSERT(connect_cb_called == 0);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-connect-timeout.c
@@ -81,5 +81,6 @@ TEST_IMPL(tcp_connect_timeout) {
r = uv_run(uv_default_loop());
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-connect6-error.c
@@ -64,5 +64,6 @@ TEST_IMPL(tcp_connect6_error_fault) {
ASSERT(connect_cb_called == 0);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-flags.c
@@ -47,5 +47,6 @@ TEST_IMPL(tcp_flags) {
r = uv_run(loop);
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-open.c
@@ -170,5 +170,6 @@ TEST_IMPL(tcp_open) {
ASSERT(write_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-shutdown-after-write.c
@@ -127,5 +127,6 @@ TEST_IMPL(tcp_shutdown_after_write) {
ASSERT(conn_close_cb_called == 1);
ASSERT(timer_close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-unexpected-read.c
@@ -109,5 +109,6 @@ TEST_IMPL(tcp_unexpected_read) {
*/
ASSERT(ticks <= 20);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-write-error.c
@@ -164,5 +164,6 @@ TEST_IMPL(tcp_write_error) {
ASSERT(write_cb_error_called >= 1);
ASSERT(tcp_client.write_queue_size == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-write-to-half-open-connection.c
@@ -131,5 +131,6 @@ TEST_IMPL(tcp_write_to_half_open_connection) {
ASSERT(write_cb_called > 0);
ASSERT(read_cb_called > 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tcp-writealot.c
@@ -166,5 +166,6 @@ TEST_IMPL(tcp_writealot) {
free(send_buffer);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-threadpool.c
@@ -53,5 +53,6 @@ TEST_IMPL(threadpool_queue_work_simple) {
ASSERT(work_cb_count == 1);
ASSERT(after_work_cb_count == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-timer-again.c
@@ -137,5 +137,6 @@ TEST_IMPL(timer_again) {
(long int)(uv_now(uv_default_loop()) - start_time));
ASSERT(700 <= uv_now(uv_default_loop()) - start_time);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-timer.c
@@ -129,6 +129,7 @@ TEST_IMPL(timer) {
ASSERT(500 <= uv_now(uv_default_loop()) - start_time);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
@@ -148,5 +149,6 @@ TEST_IMPL(timer_start_twice) {
ASSERT(once_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-tty.c
@@ -106,5 +106,6 @@ TEST_IMPL(tty) {
uv_run(loop);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-udp-dgram-too-big.c
@@ -82,5 +82,6 @@ TEST_IMPL(udp_dgram_too_big) {
ASSERT(send_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
2 test/test-udp-ipv6.c
@@ -133,6 +133,8 @@ static void do_test(uv_udp_recv_cb recv_cb, int bind_flags) {
uv_run(uv_default_loop());
ASSERT(close_cb_called == 3);
+
+ MAKE_VALGRIND_HAPPY();
}
View
1 test/test-udp-multicast-join.c
@@ -135,5 +135,6 @@ TEST_IMPL(udp_multicast_join) {
ASSERT(sv_send_cb_called == 1);
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-udp-multicast-ttl.c
@@ -82,5 +82,6 @@ TEST_IMPL(udp_multicast_ttl) {
ASSERT(sv_send_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-udp-open.c
@@ -149,5 +149,6 @@ TEST_IMPL(udp_open) {
ASSERT(send_cb_called == 1);
ASSERT(close_cb_called == 1);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-udp-options.c
@@ -82,5 +82,6 @@ TEST_IMPL(udp_options) {
r = uv_run(loop);
ASSERT(r == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-udp-send-and-recv.c
@@ -204,5 +204,6 @@ TEST_IMPL(udp_send_and_recv) {
ASSERT(sv_recv_cb_called == 1);
ASSERT(close_cb_called == 2);
+ MAKE_VALGRIND_HAPPY();
return 0;
}
View
1 test/test-walk-handles.c
@@ -73,5 +73,6 @@ TEST_IMPL(walk_handles) {
uv_walk(loop, walk_cb, magic_cookie);
ASSERT(seen_timer_handle == 0);
+ MAKE_VALGRIND_HAPPY();
return 0;
}

0 comments on commit 47eb034

Please sign in to comment.