Lines Matching refs:req
41 static void fail_cb(uv_fs_t* req) { in fail_cb() argument
45 static void handle_result(uv_fs_t* req) { in handle_result() argument
53 ASSERT_EQ(req->fs_type, UV_FS_COPYFILE); in handle_result()
54 ASSERT_OK(req->result); in handle_result()
57 r = uv_fs_stat(NULL, &stat_req, req->path, NULL); in handle_result()
71 uv_fs_req_cleanup(req); in handle_result()
78 uv_fs_t req; in touch_file() local
83 r = uv_fs_open(NULL, &req, name, in touch_file()
86 uv_fs_req_cleanup(&req); in touch_file()
94 r = uv_fs_write(NULL, &req, file, &buf, 1, i, NULL); in touch_file()
95 uv_fs_req_cleanup(&req); in touch_file()
99 r = uv_fs_close(NULL, &req, file, NULL); in touch_file()
100 uv_fs_req_cleanup(&req); in touch_file()
108 uv_fs_t req; in TEST_IMPL() local
114 r = uv_fs_copyfile(NULL, &req, src, dst, -1, NULL); in TEST_IMPL()
116 uv_fs_req_cleanup(&req); in TEST_IMPL()
121 r = uv_fs_copyfile(NULL, &req, src, dst, 0, NULL); in TEST_IMPL()
122 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
124 uv_fs_req_cleanup(&req); in TEST_IMPL()
126 r = uv_fs_stat(NULL, &req, dst, NULL); in TEST_IMPL()
128 uv_fs_req_cleanup(&req); in TEST_IMPL()
132 r = uv_fs_copyfile(NULL, &req, src, src, 0, NULL); in TEST_IMPL()
134 uv_fs_req_cleanup(&req); in TEST_IMPL()
136 r = uv_fs_stat(NULL, &req, src, NULL); in TEST_IMPL()
138 ASSERT_EQ(12, req.statbuf.st_size); in TEST_IMPL()
139 uv_fs_req_cleanup(&req); in TEST_IMPL()
144 r = uv_fs_copyfile(NULL, &req, fixture, dst, 0, NULL); in TEST_IMPL()
146 handle_result(&req); in TEST_IMPL()
151 r = uv_fs_copyfile(NULL, &req, src, dst, 0, NULL); in TEST_IMPL()
153 handle_result(&req); in TEST_IMPL()
156 r = uv_fs_copyfile(NULL, &req, fixture, dst, 0, NULL); in TEST_IMPL()
158 handle_result(&req); in TEST_IMPL()
161 ASSERT_OK(uv_fs_chmod(NULL, &req, dst, 0644, NULL)); in TEST_IMPL()
162 uv_fs_req_cleanup(&req); in TEST_IMPL()
163 r = uv_fs_copyfile(NULL, &req, fixture, dst, UV_FS_COPYFILE_EXCL, NULL); in TEST_IMPL()
165 uv_fs_req_cleanup(&req); in TEST_IMPL()
168 ASSERT_OK(uv_fs_chmod(NULL, &req, dst, 0644, NULL)); in TEST_IMPL()
169 uv_fs_req_cleanup(&req); in TEST_IMPL()
171 r = uv_fs_copyfile(NULL, &req, src, dst, 0, NULL); in TEST_IMPL()
173 handle_result(&req); in TEST_IMPL()
178 r = uv_fs_copyfile(NULL, &req, src, dst, 0, NULL); in TEST_IMPL()
180 handle_result(&req); in TEST_IMPL()
185 r = uv_fs_copyfile(loop, &req, fixture, dst, 0, handle_result); in TEST_IMPL()
191 ASSERT_OK(uv_fs_chmod(NULL, &req, dst, 0644, NULL)); in TEST_IMPL()
192 uv_fs_req_cleanup(&req); in TEST_IMPL()
196 r = uv_fs_copyfile(loop, &req, fixture, dst, -1, fail_cb); in TEST_IMPL()
202 r = uv_fs_copyfile(NULL, &req, fixture, dst, UV_FS_COPYFILE_FICLONE, NULL); in TEST_IMPL()
204 handle_result(&req); in TEST_IMPL()
208 r = uv_fs_copyfile(NULL, &req, fixture, dst, UV_FS_COPYFILE_FICLONE_FORCE, in TEST_IMPL()
213 handle_result(&req); in TEST_IMPL()
220 r = uv_fs_copyfile(NULL, &req, fixture, dst, 0, NULL); in TEST_IMPL()
223 ASSERT_EQ(req.result, UV_EACCES); in TEST_IMPL()
226 uv_fs_req_cleanup(&req); in TEST_IMPL()