diff options
author | Saúl Ibarra Corretgé <saghul@gmail.com> | 2014-11-21 15:43:12 +0100 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2014-12-09 17:57:06 +0100 |
commit | eac867258e0308d956c01e41fa3faae698639f8c (patch) | |
tree | 02fdcadb1d25dbb47fd0ea62974f227b2ac23c56 /deps/uv/test/test-fs.c | |
parent | 153ce23727d935b4ae1c6850547df1a606cf0295 (diff) | |
download | android-node-v8-eac867258e0308d956c01e41fa3faae698639f8c.tar.gz android-node-v8-eac867258e0308d956c01e41fa3faae698639f8c.tar.bz2 android-node-v8-eac867258e0308d956c01e41fa3faae698639f8c.zip |
deps: update libuv to 1.0.1
PR-URL: https://github.com/joyent/node/pull/8785
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'deps/uv/test/test-fs.c')
-rw-r--r-- | deps/uv/test/test-fs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c index 3e9dcb81fc..471860a76c 100644 --- a/deps/uv/test/test-fs.c +++ b/deps/uv/test/test-fs.c @@ -109,6 +109,7 @@ static uv_fs_t utime_req; static uv_fs_t futime_req; static char buf[32]; +static char buf2[32]; static char test_buf[] = "test-buffer\n"; static char test_buf2[] = "second-buffer\n"; static uv_buf_t iov; @@ -2200,12 +2201,15 @@ TEST_IMPL(fs_write_multiple_bufs) { uv_fs_req_cleanup(&open_req1); memset(buf, 0, sizeof(buf)); - iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, NULL); + memset(buf2, 0, sizeof(buf2)); + /* Read the strings back to separate buffers. */ + iovs[0] = uv_buf_init(buf, sizeof(test_buf)); + iovs[1] = uv_buf_init(buf2, sizeof(test_buf2)); + r = uv_fs_read(loop, &read_req, open_req1.result, iovs, 2, 0, NULL); ASSERT(r >= 0); ASSERT(read_req.result >= 0); - ASSERT(memcmp(buf, test_buf, sizeof(test_buf)) == 0); - ASSERT(strcmp(buf + sizeof(test_buf), test_buf2) == 0); + ASSERT(strcmp(buf, test_buf) == 0); + ASSERT(strcmp(buf2, test_buf2) == 0); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(buf, sizeof(buf)); |