ext/libuv/test/test-fs-event.c in libuv-0.12.2 vs ext/libuv/test/test-fs-event.c in libuv-0.12.3
- old
+ new
@@ -48,11 +48,11 @@
#else
static char fs_event_filename[1024];
#endif /* defined(PATH_MAX) */
static int timer_cb_touch_called;
-static void fs_event_unlink_files(uv_timer_t* handle, int status);
+static void fs_event_unlink_files(uv_timer_t* handle);
static void create_dir(uv_loop_t* loop, const char* name) {
int r;
uv_fs_t req;
r = uv_fs_mkdir(loop, &req, name, 0755, NULL);
@@ -145,11 +145,11 @@
file_prefix,
i);
return fs_event_filename;
}
-static void fs_event_create_files(uv_timer_t* handle, int status) {
+static void fs_event_create_files(uv_timer_t* handle) {
int i;
/* Already created all files */
if (fs_event_created == fs_event_file_count) {
uv_close((uv_handle_t*) &timer, close_cb);
@@ -162,11 +162,11 @@
/* And unlink them */
ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files, 50, 0));
}
-void fs_event_unlink_files(uv_timer_t* handle, int status) {
+void fs_event_unlink_files(uv_timer_t* handle) {
int r;
int i;
/* NOTE: handle might be NULL if invoked not as timer callback */
@@ -191,15 +191,14 @@
ASSERT(filename == NULL || strcmp(filename, "file2") == 0);
ASSERT(0 == uv_fs_event_stop(handle));
uv_close((uv_handle_t*)handle, close_cb);
}
-static void timer_cb_close_handle(uv_timer_t* timer, int status) {
+static void timer_cb_close_handle(uv_timer_t* timer) {
uv_handle_t* handle;
ASSERT(timer != NULL);
- ASSERT(status == 0);
handle = timer->data;
uv_close((uv_handle_t*)timer, NULL);
uv_close((uv_handle_t*)handle, close_cb);
}
@@ -221,29 +220,28 @@
timer.data = handle;
uv_timer_start(&timer, timer_cb_close_handle, 250, 0);
}
}
-static void timer_cb_file(uv_timer_t* handle, int status) {
+static void timer_cb_file(uv_timer_t* handle) {
++timer_cb_called;
if (timer_cb_called == 1) {
touch_file(handle->loop, "watch_dir/file1");
} else {
touch_file(handle->loop, "watch_dir/file2");
uv_close((uv_handle_t*)handle, close_cb);
}
}
-static void timer_cb_touch(uv_timer_t* timer, int status) {
- ASSERT(status == 0);
+static void timer_cb_touch(uv_timer_t* timer) {
uv_close((uv_handle_t*)timer, NULL);
touch_file(timer->loop, "watch_file");
timer_cb_touch_called++;
}
-static void timer_cb_watch_twice(uv_timer_t* handle, int status) {
+static void timer_cb_watch_twice(uv_timer_t* handle) {
uv_fs_event_t* handles = handle->data;
uv_close((uv_handle_t*) (handles + 0), NULL);
uv_close((uv_handle_t*) (handles + 1), NULL);
uv_close((uv_handle_t*) handle, NULL);
}
@@ -251,11 +249,11 @@
TEST_IMPL(fs_event_watch_dir) {
uv_loop_t* loop = uv_default_loop();
int r;
/* Setup */
- fs_event_unlink_files(NULL, 0);
+ fs_event_unlink_files(NULL);
remove("watch_dir/file2");
remove("watch_dir/file1");
remove("watch_dir/");
create_dir(loop, "watch_dir");
@@ -273,11 +271,11 @@
ASSERT(fs_event_cb_called == 2 * fs_event_file_count);
ASSERT(fs_event_created == fs_event_file_count);
ASSERT(close_cb_called == 2);
/* Cleanup */
- fs_event_unlink_files(NULL, 0);
+ fs_event_unlink_files(NULL);
remove("watch_dir/file2");
remove("watch_dir/file1");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
@@ -456,15 +454,13 @@
int events, int status) {
ASSERT(0 && "should never be called");
}
-static void timer_cb(uv_timer_t* handle, int status) {
+static void timer_cb(uv_timer_t* handle) {
int r;
- ASSERT(status == 0);
-
r = uv_fs_event_init(handle->loop, &fs_event);
ASSERT(r == 0);
r = uv_fs_event_start(&fs_event, fs_event_fail, ".", 0);
ASSERT(r == 0);
@@ -670,10 +666,10 @@
int status) {
if (status != 0)
fs_event_error_reported = status;
}
-static void timer_cb_nop(uv_timer_t* handle, int status) {
+static void timer_cb_nop(uv_timer_t* handle) {
++timer_cb_called;
uv_close((uv_handle_t*) handle, close_cb);
}
static void fs_event_error_report_close_cb(uv_handle_t* handle) {