summaryrefslogtreecommitdiff
path: root/deps/uv/test/test-fs-poll.c
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2014-02-26 18:08:30 -0800
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-02-26 18:08:30 -0800
commitcd08c8a0e5e99ed4933b87fc5e188afcd4299f73 (patch)
treec05e93d47f89df1f7a782ee9c70bb2c97d557cd4 /deps/uv/test/test-fs-poll.c
parentf3189ace6b5e31a874df421ac2f74da0e77cb14d (diff)
downloadandroid-node-v8-cd08c8a0e5e99ed4933b87fc5e188afcd4299f73.tar.gz
android-node-v8-cd08c8a0e5e99ed4933b87fc5e188afcd4299f73.tar.bz2
android-node-v8-cd08c8a0e5e99ed4933b87fc5e188afcd4299f73.zip
uv: Upgrade to v0.11.21
Diffstat (limited to 'deps/uv/test/test-fs-poll.c')
-rw-r--r--deps/uv/test/test-fs-poll.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/deps/uv/test/test-fs-poll.c b/deps/uv/test/test-fs-poll.c
index 9213f04b34..27c6c3c3db 100644
--- a/deps/uv/test/test-fs-poll.c
+++ b/deps/uv/test/test-fs-poll.c
@@ -33,6 +33,11 @@ static void poll_cb(uv_fs_poll_t* handle,
const uv_stat_t* prev,
const uv_stat_t* curr);
+static void poll_cb_fail(uv_fs_poll_t* handle,
+ int status,
+ const uv_stat_t* prev,
+ const uv_stat_t* curr);
+
static uv_fs_poll_t poll_handle;
static uv_timer_t timer_handle;
static uv_loop_t* loop;
@@ -72,6 +77,14 @@ static void timer_cb(uv_timer_t* handle, int status) {
}
+static void poll_cb_fail(uv_fs_poll_t* handle,
+ int status,
+ const uv_stat_t* prev,
+ const uv_stat_t* curr) {
+ ASSERT(0 && "fail_cb called");
+}
+
+
static void poll_cb(uv_fs_poll_t* handle,
int status,
const uv_stat_t* prev,
@@ -144,3 +157,29 @@ TEST_IMPL(fs_poll) {
MAKE_VALGRIND_HAPPY();
return 0;
}
+
+
+TEST_IMPL(fs_poll_getpath) {
+ char buf[1024];
+ size_t len;
+ loop = uv_default_loop();
+
+ remove(FIXTURE);
+
+ ASSERT(0 == uv_fs_poll_init(loop, &poll_handle));
+ len = sizeof buf;
+ ASSERT(UV_EINVAL == uv_fs_poll_getpath(&poll_handle, buf, &len));
+ ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb_fail, FIXTURE, 100));
+ len = sizeof buf;
+ ASSERT(0 == uv_fs_poll_getpath(&poll_handle, buf, &len));
+ ASSERT(0 == memcmp(buf, FIXTURE, len));
+
+ uv_close((uv_handle_t*) &poll_handle, close_cb);
+
+ ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
+
+ ASSERT(close_cb_called == 1);
+
+ MAKE_VALGRIND_HAPPY();
+ return 0;
+}