Lines Matching refs:req

173   uv_fs_t req;  in check_permission()  local
176 r = uv_fs_stat(NULL, &req, filename, NULL); in check_permission()
178 ASSERT_OK(req.result); in check_permission()
180 s = &req.statbuf; in check_permission()
191 uv_fs_req_cleanup(&req); in check_permission()
195 static void dummy_cb(uv_fs_t* req) { in dummy_cb() argument
196 (void) req; in dummy_cb()
201 static void link_cb(uv_fs_t* req) { in link_cb() argument
202 ASSERT_EQ(req->fs_type, UV_FS_LINK); in link_cb()
203 ASSERT_OK(req->result); in link_cb()
205 uv_fs_req_cleanup(req); in link_cb()
209 static void symlink_cb(uv_fs_t* req) { in symlink_cb() argument
210 ASSERT_EQ(req->fs_type, UV_FS_SYMLINK); in symlink_cb()
211 ASSERT_OK(req->result); in symlink_cb()
213 uv_fs_req_cleanup(req); in symlink_cb()
216 static void readlink_cb(uv_fs_t* req) { in readlink_cb() argument
217 ASSERT_EQ(req->fs_type, UV_FS_READLINK); in readlink_cb()
218 ASSERT_OK(req->result); in readlink_cb()
219 ASSERT_OK(strcmp(req->ptr, "test_file_symlink2")); in readlink_cb()
221 uv_fs_req_cleanup(req); in readlink_cb()
225 static void realpath_cb(uv_fs_t* req) { in realpath_cb() argument
228 ASSERT_EQ(req->fs_type, UV_FS_REALPATH); in realpath_cb()
229 ASSERT_OK(req->result); in realpath_cb()
234 ASSERT_OK(_stricmp(req->ptr, test_file_abs_buf)); in realpath_cb()
237 ASSERT_OK(strcmp(req->ptr, test_file_abs_buf)); in realpath_cb()
240 uv_fs_req_cleanup(req); in realpath_cb()
244 static void access_cb(uv_fs_t* req) { in access_cb() argument
245 ASSERT_EQ(req->fs_type, UV_FS_ACCESS); in access_cb()
247 uv_fs_req_cleanup(req); in access_cb()
251 static void fchmod_cb(uv_fs_t* req) { in fchmod_cb() argument
252 ASSERT_EQ(req->fs_type, UV_FS_FCHMOD); in fchmod_cb()
253 ASSERT_OK(req->result); in fchmod_cb()
255 uv_fs_req_cleanup(req); in fchmod_cb()
256 check_permission("test_file", *(int*)req->data); in fchmod_cb()
260 static void chmod_cb(uv_fs_t* req) { in chmod_cb() argument
261 ASSERT_EQ(req->fs_type, UV_FS_CHMOD); in chmod_cb()
262 ASSERT_OK(req->result); in chmod_cb()
264 uv_fs_req_cleanup(req); in chmod_cb()
265 check_permission("test_file", *(int*)req->data); in chmod_cb()
269 static void fchown_cb(uv_fs_t* req) { in fchown_cb() argument
270 ASSERT_EQ(req->fs_type, UV_FS_FCHOWN); in fchown_cb()
271 ASSERT_OK(req->result); in fchown_cb()
273 uv_fs_req_cleanup(req); in fchown_cb()
277 static void chown_cb(uv_fs_t* req) { in chown_cb() argument
278 ASSERT_EQ(req->fs_type, UV_FS_CHOWN); in chown_cb()
279 ASSERT_OK(req->result); in chown_cb()
281 uv_fs_req_cleanup(req); in chown_cb()
284 static void lchown_cb(uv_fs_t* req) { in lchown_cb() argument
285 ASSERT_EQ(req->fs_type, UV_FS_LCHOWN); in lchown_cb()
286 ASSERT_OK(req->result); in lchown_cb()
288 uv_fs_req_cleanup(req); in lchown_cb()
291 static void chown_root_cb(uv_fs_t* req) { in chown_root_cb() argument
292 ASSERT_EQ(req->fs_type, UV_FS_CHOWN); in chown_root_cb()
295 ASSERT_OK(req->result); in chown_root_cb()
301 ASSERT_OK(req->result); in chown_root_cb()
305 ASSERT_EQ(req->result, UV_EINVAL); in chown_root_cb()
311 ASSERT(req->result == 0 || req->result == UV_EPERM); in chown_root_cb()
313 ASSERT_EQ(req->result, UV_EPERM); in chown_root_cb()
317 uv_fs_req_cleanup(req); in chown_root_cb()
320 static void unlink_cb(uv_fs_t* req) { in unlink_cb() argument
321 ASSERT_PTR_EQ(req, &unlink_req); in unlink_cb()
322 ASSERT_EQ(req->fs_type, UV_FS_UNLINK); in unlink_cb()
323 ASSERT_OK(req->result); in unlink_cb()
325 uv_fs_req_cleanup(req); in unlink_cb()
328 static void fstat_cb(uv_fs_t* req) { in fstat_cb() argument
329 uv_stat_t* s = req->ptr; in fstat_cb()
330 ASSERT_EQ(req->fs_type, UV_FS_FSTAT); in fstat_cb()
331 ASSERT_OK(req->result); in fstat_cb()
333 uv_fs_req_cleanup(req); in fstat_cb()
338 static void statfs_cb(uv_fs_t* req) { in statfs_cb() argument
341 ASSERT_EQ(req->fs_type, UV_FS_STATFS); in statfs_cb()
342 ASSERT_OK(req->result); in statfs_cb()
343 ASSERT_NOT_NULL(req->ptr); in statfs_cb()
344 stats = req->ptr; in statfs_cb()
365 uv_fs_req_cleanup(req); in statfs_cb()
366 ASSERT_NULL(req->ptr); in statfs_cb()
371 static void close_cb(uv_fs_t* req) { in close_cb() argument
373 ASSERT_PTR_EQ(req, &close_req); in close_cb()
374 ASSERT_EQ(req->fs_type, UV_FS_CLOSE); in close_cb()
375 ASSERT_OK(req->result); in close_cb()
377 uv_fs_req_cleanup(req); in close_cb()
385 static void ftruncate_cb(uv_fs_t* req) { in ftruncate_cb() argument
387 ASSERT_PTR_EQ(req, &ftruncate_req); in ftruncate_cb()
388 ASSERT_EQ(req->fs_type, UV_FS_FTRUNCATE); in ftruncate_cb()
389 ASSERT_OK(req->result); in ftruncate_cb()
391 uv_fs_req_cleanup(req); in ftruncate_cb()
396 static void fail_cb(uv_fs_t* req) { in fail_cb() argument
400 static void read_cb(uv_fs_t* req) { in read_cb() argument
402 ASSERT_PTR_EQ(req, &read_req); in read_cb()
403 ASSERT_EQ(req->fs_type, UV_FS_READ); in read_cb()
404 ASSERT_GE(req->result, 0); /* FIXME(bnoordhuis) Check if requested size? */ in read_cb()
406 uv_fs_req_cleanup(req); in read_cb()
419 static void open_cb(uv_fs_t* req) { in open_cb() argument
421 ASSERT_PTR_EQ(req, &open_req1); in open_cb()
422 ASSERT_EQ(req->fs_type, UV_FS_OPEN); in open_cb()
423 if (req->result < 0) { in open_cb()
424 fprintf(stderr, "async open error: %d\n", (int) req->result); in open_cb()
428 ASSERT(req->path); in open_cb()
429 ASSERT_OK(memcmp(req->path, "test_file2\0", 11)); in open_cb()
430 uv_fs_req_cleanup(req); in open_cb()
439 static void open_cb_simple(uv_fs_t* req) { in open_cb_simple() argument
440 ASSERT_EQ(req->fs_type, UV_FS_OPEN); in open_cb_simple()
441 if (req->result < 0) { in open_cb_simple()
442 fprintf(stderr, "async open error: %d\n", (int) req->result); in open_cb_simple()
446 ASSERT(req->path); in open_cb_simple()
447 uv_fs_req_cleanup(req); in open_cb_simple()
451 static void fsync_cb(uv_fs_t* req) { in fsync_cb() argument
453 ASSERT_PTR_EQ(req, &fsync_req); in fsync_cb()
454 ASSERT_EQ(req->fs_type, UV_FS_FSYNC); in fsync_cb()
455 ASSERT_OK(req->result); in fsync_cb()
457 uv_fs_req_cleanup(req); in fsync_cb()
463 static void fdatasync_cb(uv_fs_t* req) { in fdatasync_cb() argument
465 ASSERT_PTR_EQ(req, &fdatasync_req); in fdatasync_cb()
466 ASSERT_EQ(req->fs_type, UV_FS_FDATASYNC); in fdatasync_cb()
467 ASSERT_OK(req->result); in fdatasync_cb()
469 uv_fs_req_cleanup(req); in fdatasync_cb()
475 static void write_cb(uv_fs_t* req) { in write_cb() argument
477 ASSERT_PTR_EQ(req, &write_req); in write_cb()
478 ASSERT_EQ(req->fs_type, UV_FS_WRITE); in write_cb()
479 ASSERT_GE(req->result, 0); /* FIXME(bnoordhuis) Check if requested size? */ in write_cb()
481 uv_fs_req_cleanup(req); in write_cb()
487 static void create_cb(uv_fs_t* req) { in create_cb() argument
489 ASSERT_PTR_EQ(req, &open_req1); in create_cb()
490 ASSERT_EQ(req->fs_type, UV_FS_OPEN); in create_cb()
491 ASSERT_GE(req->result, 0); in create_cb()
493 uv_fs_req_cleanup(req); in create_cb()
495 r = uv_fs_write(loop, &write_req, req->result, &iov, 1, -1, write_cb); in create_cb()
500 static void rename_cb(uv_fs_t* req) { in rename_cb() argument
501 ASSERT_PTR_EQ(req, &rename_req); in rename_cb()
502 ASSERT_EQ(req->fs_type, UV_FS_RENAME); in rename_cb()
503 ASSERT_OK(req->result); in rename_cb()
505 uv_fs_req_cleanup(req); in rename_cb()
509 static void mkdir_cb(uv_fs_t* req) { in mkdir_cb() argument
510 ASSERT_PTR_EQ(req, &mkdir_req); in mkdir_cb()
511 ASSERT_EQ(req->fs_type, UV_FS_MKDIR); in mkdir_cb()
512 ASSERT_OK(req->result); in mkdir_cb()
514 ASSERT(req->path); in mkdir_cb()
515 ASSERT_OK(memcmp(req->path, "test_dir\0", 9)); in mkdir_cb()
516 uv_fs_req_cleanup(req); in mkdir_cb()
520 static void check_mkdtemp_result(uv_fs_t* req) { in check_mkdtemp_result() argument
523 ASSERT_EQ(req->fs_type, UV_FS_MKDTEMP); in check_mkdtemp_result()
524 ASSERT_OK(req->result); in check_mkdtemp_result()
525 ASSERT(req->path); in check_mkdtemp_result()
526 ASSERT_EQ(15, strlen(req->path)); in check_mkdtemp_result()
527 ASSERT_OK(memcmp(req->path, "test_dir_", 9)); in check_mkdtemp_result()
528 ASSERT_NE(0, memcmp(req->path + 9, "XXXXXX", 6)); in check_mkdtemp_result()
529 check_permission(req->path, 0700); in check_mkdtemp_result()
532 r = uv_fs_stat(NULL, &stat_req, req->path, NULL); in check_mkdtemp_result()
539 static void mkdtemp_cb(uv_fs_t* req) { in mkdtemp_cb() argument
540 ASSERT_PTR_EQ(req, &mkdtemp_req1); in mkdtemp_cb()
541 check_mkdtemp_result(req); in mkdtemp_cb()
546 static void check_mkstemp_result(uv_fs_t* req) { in check_mkstemp_result() argument
549 ASSERT_EQ(req->fs_type, UV_FS_MKSTEMP); in check_mkstemp_result()
550 ASSERT_GE(req->result, 0); in check_mkstemp_result()
551 ASSERT(req->path); in check_mkstemp_result()
552 ASSERT_EQ(16, strlen(req->path)); in check_mkstemp_result()
553 ASSERT_OK(memcmp(req->path, "test_file_", 10)); in check_mkstemp_result()
554 ASSERT_NE(0, memcmp(req->path + 10, "XXXXXX", 6)); in check_mkstemp_result()
555 check_permission(req->path, 0600); in check_mkstemp_result()
558 r = uv_fs_stat(NULL, &stat_req, req->path, NULL); in check_mkstemp_result()
565 static void mkstemp_cb(uv_fs_t* req) { in mkstemp_cb() argument
566 ASSERT_PTR_EQ(req, &mkstemp_req1); in mkstemp_cb()
567 check_mkstemp_result(req); in mkstemp_cb()
572 static void rmdir_cb(uv_fs_t* req) { in rmdir_cb() argument
573 ASSERT_PTR_EQ(req, &rmdir_req); in rmdir_cb()
574 ASSERT_EQ(req->fs_type, UV_FS_RMDIR); in rmdir_cb()
575 ASSERT_OK(req->result); in rmdir_cb()
577 ASSERT(req->path); in rmdir_cb()
578 ASSERT_OK(memcmp(req->path, "test_dir\0", 9)); in rmdir_cb()
579 uv_fs_req_cleanup(req); in rmdir_cb()
605 static void scandir_cb(uv_fs_t* req) { in scandir_cb() argument
607 ASSERT_PTR_EQ(req, &scandir_req); in scandir_cb()
608 ASSERT_EQ(req->fs_type, UV_FS_SCANDIR); in scandir_cb()
609 ASSERT_EQ(2, req->result); in scandir_cb()
610 ASSERT(req->ptr); in scandir_cb()
612 while (UV_EOF != uv_fs_scandir_next(req, &dent)) { in scandir_cb()
617 ASSERT(req->path); in scandir_cb()
618 ASSERT_OK(memcmp(req->path, "test_dir\0", 9)); in scandir_cb()
619 uv_fs_req_cleanup(req); in scandir_cb()
620 ASSERT(!req->ptr); in scandir_cb()
624 static void empty_scandir_cb(uv_fs_t* req) { in empty_scandir_cb() argument
627 ASSERT_PTR_EQ(req, &scandir_req); in empty_scandir_cb()
628 ASSERT_EQ(req->fs_type, UV_FS_SCANDIR); in empty_scandir_cb()
629 ASSERT_OK(req->result); in empty_scandir_cb()
630 ASSERT_NULL(req->ptr); in empty_scandir_cb()
631 ASSERT_EQ(UV_EOF, uv_fs_scandir_next(req, &dent)); in empty_scandir_cb()
632 uv_fs_req_cleanup(req); in empty_scandir_cb()
636 static void non_existent_scandir_cb(uv_fs_t* req) { in non_existent_scandir_cb() argument
639 ASSERT_PTR_EQ(req, &scandir_req); in non_existent_scandir_cb()
640 ASSERT_EQ(req->fs_type, UV_FS_SCANDIR); in non_existent_scandir_cb()
641 ASSERT_EQ(req->result, UV_ENOENT); in non_existent_scandir_cb()
642 ASSERT_NULL(req->ptr); in non_existent_scandir_cb()
643 ASSERT_EQ(UV_ENOENT, uv_fs_scandir_next(req, &dent)); in non_existent_scandir_cb()
644 uv_fs_req_cleanup(req); in non_existent_scandir_cb()
649 static void file_scandir_cb(uv_fs_t* req) { in file_scandir_cb() argument
650 ASSERT_PTR_EQ(req, &scandir_req); in file_scandir_cb()
651 ASSERT_EQ(req->fs_type, UV_FS_SCANDIR); in file_scandir_cb()
652 ASSERT_EQ(req->result, UV_ENOTDIR); in file_scandir_cb()
653 ASSERT_NULL(req->ptr); in file_scandir_cb()
654 uv_fs_req_cleanup(req); in file_scandir_cb()
659 static void stat_cb(uv_fs_t* req) { in stat_cb() argument
660 ASSERT_PTR_EQ(req, &stat_req); in stat_cb()
661 ASSERT(req->fs_type == UV_FS_STAT || req->fs_type == UV_FS_LSTAT); in stat_cb()
662 ASSERT_OK(req->result); in stat_cb()
663 ASSERT(req->ptr); in stat_cb()
665 uv_fs_req_cleanup(req); in stat_cb()
666 ASSERT(!req->ptr); in stat_cb()
669 static void stat_batch_cb(uv_fs_t* req) { in stat_batch_cb() argument
670 ASSERT(req->fs_type == UV_FS_STAT || req->fs_type == UV_FS_LSTAT); in stat_batch_cb()
671 ASSERT_OK(req->result); in stat_batch_cb()
672 ASSERT(req->ptr); in stat_batch_cb()
674 uv_fs_req_cleanup(req); in stat_batch_cb()
675 ASSERT(!req->ptr); in stat_batch_cb()
679 static void sendfile_cb(uv_fs_t* req) { in sendfile_cb() argument
680 ASSERT_PTR_EQ(req, &sendfile_req); in sendfile_cb()
681 ASSERT_EQ(req->fs_type, UV_FS_SENDFILE); in sendfile_cb()
682 ASSERT_EQ(65545, req->result); in sendfile_cb()
684 uv_fs_req_cleanup(req); in sendfile_cb()
688 static void sendfile_nodata_cb(uv_fs_t* req) { in sendfile_nodata_cb() argument
689 ASSERT_PTR_EQ(req, &sendfile_req); in sendfile_nodata_cb()
690 ASSERT_EQ(req->fs_type, UV_FS_SENDFILE); in sendfile_nodata_cb()
691 ASSERT_OK(req->result); in sendfile_nodata_cb()
693 uv_fs_req_cleanup(req); in sendfile_nodata_cb()
697 static void open_noent_cb(uv_fs_t* req) { in open_noent_cb() argument
698 ASSERT_EQ(req->fs_type, UV_FS_OPEN); in open_noent_cb()
699 ASSERT_EQ(req->result, UV_ENOENT); in open_noent_cb()
701 uv_fs_req_cleanup(req); in open_noent_cb()
704 static void open_nametoolong_cb(uv_fs_t* req) { in open_nametoolong_cb() argument
705 ASSERT_EQ(req->fs_type, UV_FS_OPEN); in open_nametoolong_cb()
706 ASSERT_EQ(req->result, UV_ENAMETOOLONG); in open_nametoolong_cb()
708 uv_fs_req_cleanup(req); in open_nametoolong_cb()
711 static void open_loop_cb(uv_fs_t* req) { in open_loop_cb() argument
712 ASSERT_EQ(req->fs_type, UV_FS_OPEN); in open_loop_cb()
713 ASSERT_EQ(req->result, UV_ELOOP); in open_loop_cb()
715 uv_fs_req_cleanup(req); in open_loop_cb()
720 uv_fs_t req; in TEST_IMPL() local
725 r = uv_fs_open(NULL, &req, "does_not_exist", UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
727 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
728 uv_fs_req_cleanup(&req); in TEST_IMPL()
730 r = uv_fs_open(loop, &req, "does_not_exist", UV_FS_O_RDONLY, 0, in TEST_IMPL()
745 uv_fs_t req; in TEST_IMPL() local
754 r = uv_fs_open(NULL, &req, name, UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
756 ASSERT_EQ(req.result, UV_ENAMETOOLONG); in TEST_IMPL()
757 uv_fs_req_cleanup(&req); in TEST_IMPL()
759 r = uv_fs_open(loop, &req, name, UV_FS_O_RDONLY, 0, open_nametoolong_cb); in TEST_IMPL()
771 uv_fs_t req; in TEST_IMPL() local
777 r = uv_fs_symlink(NULL, &req, "test_symlink", "test_symlink", 0, NULL); in TEST_IMPL()
792 uv_fs_req_cleanup(&req); in TEST_IMPL()
794 r = uv_fs_open(NULL, &req, "test_symlink", UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
796 ASSERT_EQ(req.result, UV_ELOOP); in TEST_IMPL()
797 uv_fs_req_cleanup(&req); in TEST_IMPL()
799 r = uv_fs_open(loop, &req, "test_symlink", UV_FS_O_RDONLY, 0, open_loop_cb); in TEST_IMPL()
817 uv_fs_t req; in check_utime() local
821 r = uv_fs_lstat(loop, &req, path, NULL); in check_utime()
823 r = uv_fs_stat(loop, &req, path, NULL); in check_utime()
827 ASSERT_OK(req.result); in check_utime()
828 s = &req.statbuf; in check_utime()
869 uv_fs_req_cleanup(&req); in check_utime()
873 static void utime_cb(uv_fs_t* req) { in utime_cb() argument
876 ASSERT_PTR_EQ(req, &utime_req); in utime_cb()
877 ASSERT_OK(req->result); in utime_cb()
878 ASSERT_EQ(req->fs_type, UV_FS_UTIME); in utime_cb()
880 c = req->data; in utime_cb()
883 uv_fs_req_cleanup(req); in utime_cb()
888 static void futime_cb(uv_fs_t* req) { in futime_cb() argument
891 ASSERT_PTR_EQ(req, &futime_req); in futime_cb()
892 ASSERT_OK(req->result); in futime_cb()
893 ASSERT_EQ(req->fs_type, UV_FS_FUTIME); in futime_cb()
895 c = req->data; in futime_cb()
898 uv_fs_req_cleanup(req); in futime_cb()
903 static void lutime_cb(uv_fs_t* req) { in lutime_cb() argument
906 ASSERT_OK(req->result); in lutime_cb()
907 ASSERT_EQ(req->fs_type, UV_FS_LUTIME); in lutime_cb()
909 c = req->data; in lutime_cb()
912 uv_fs_req_cleanup(req); in lutime_cb()
1253 uv_fs_t req; in test_sendfile() local
1312 r = uv_fs_read(NULL, &req, open_req1.result, &iov, 1, -1, NULL); in test_sendfile()
1314 ASSERT_GE(req.result, 0); in test_sendfile()
1316 uv_fs_req_cleanup(&req); in test_sendfile()
1382 uv_fs_t req; in TEST_IMPL() local
1410 r = uv_fs_write(NULL, &req, mkstemp_req1.result, &iov, 1, -1, NULL); in TEST_IMPL()
1412 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1413 uv_fs_req_cleanup(&req); in TEST_IMPL()
1416 uv_fs_close(NULL, &req, mkstemp_req1.result, NULL); in TEST_IMPL()
1417 uv_fs_req_cleanup(&req); in TEST_IMPL()
1418 uv_fs_close(NULL, &req, mkstemp_req2.result, NULL); in TEST_IMPL()
1419 uv_fs_req_cleanup(&req); in TEST_IMPL()
1421 fd = uv_fs_open(NULL, &req, mkstemp_req1.path, UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
1423 uv_fs_req_cleanup(&req); in TEST_IMPL()
1427 r = uv_fs_read(NULL, &req, fd, &iov, 1, -1, NULL); in TEST_IMPL()
1429 ASSERT_GE(req.result, 0); in TEST_IMPL()
1431 uv_fs_req_cleanup(&req); in TEST_IMPL()
1433 uv_fs_close(NULL, &req, fd, NULL); in TEST_IMPL()
1434 uv_fs_req_cleanup(&req); in TEST_IMPL()
1448 uv_fs_t req; in TEST_IMPL() local
1467 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1470 ASSERT_GE(req.result, 0); in TEST_IMPL()
1471 file = req.result; in TEST_IMPL()
1472 uv_fs_req_cleanup(&req); in TEST_IMPL()
1477 ASSERT_OK(uv_fs_fstat(NULL, &req, file, NULL)); in TEST_IMPL()
1478 ASSERT_OK(req.result); in TEST_IMPL()
1479 s = req.ptr; in TEST_IMPL()
1495 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1497 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1498 uv_fs_req_cleanup(&req); in TEST_IMPL()
1500 memset(&req.statbuf, 0xaa, sizeof(req.statbuf)); in TEST_IMPL()
1501 r = uv_fs_fstat(NULL, &req, file, NULL); in TEST_IMPL()
1503 ASSERT_OK(req.result); in TEST_IMPL()
1504 s = req.ptr; in TEST_IMPL()
1582 uv_fs_req_cleanup(&req); in TEST_IMPL()
1585 r = uv_fs_fstat(loop, &req, file, fstat_cb); in TEST_IMPL()
1591 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
1593 ASSERT_OK(req.result); in TEST_IMPL()
1594 uv_fs_req_cleanup(&req); in TEST_IMPL()
1613 uv_fs_t req; in TEST_IMPL() local
1620 res = uv_fs_fstat(NULL, &req, fd, NULL); in TEST_IMPL()
1622 ASSERT_OK(req.result); in TEST_IMPL()
1625 st = req.ptr; in TEST_IMPL()
1641 uv_fs_req_cleanup(&req); in TEST_IMPL()
1651 uv_fs_t req; in TEST_IMPL() local
1661 r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); in TEST_IMPL()
1663 ASSERT_LT(req.result, 0); in TEST_IMPL()
1664 uv_fs_req_cleanup(&req); in TEST_IMPL()
1667 r = uv_fs_access(loop, &req, "test_file", F_OK, access_cb); in TEST_IMPL()
1674 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1677 ASSERT_GE(req.result, 0); in TEST_IMPL()
1678 file = req.result; in TEST_IMPL()
1679 uv_fs_req_cleanup(&req); in TEST_IMPL()
1682 r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); in TEST_IMPL()
1684 ASSERT_OK(req.result); in TEST_IMPL()
1685 uv_fs_req_cleanup(&req); in TEST_IMPL()
1688 r = uv_fs_access(loop, &req, "test_file", F_OK, access_cb); in TEST_IMPL()
1695 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
1697 ASSERT_OK(req.result); in TEST_IMPL()
1698 uv_fs_req_cleanup(&req); in TEST_IMPL()
1701 r = uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); in TEST_IMPL()
1703 uv_fs_req_cleanup(&req); in TEST_IMPL()
1705 r = uv_fs_access(NULL, &req, "test_dir", W_OK, NULL); in TEST_IMPL()
1707 ASSERT_OK(req.result); in TEST_IMPL()
1708 uv_fs_req_cleanup(&req); in TEST_IMPL()
1727 uv_fs_t req; in TEST_IMPL() local
1735 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1738 ASSERT_GE(req.result, 0); in TEST_IMPL()
1739 file = req.result; in TEST_IMPL()
1740 uv_fs_req_cleanup(&req); in TEST_IMPL()
1743 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1745 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1746 uv_fs_req_cleanup(&req); in TEST_IMPL()
1750 r = uv_fs_chmod(NULL, &req, "test_file", 0200, NULL); in TEST_IMPL()
1752 ASSERT_OK(req.result); in TEST_IMPL()
1753 uv_fs_req_cleanup(&req); in TEST_IMPL()
1759 r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); in TEST_IMPL()
1761 ASSERT_OK(req.result); in TEST_IMPL()
1762 uv_fs_req_cleanup(&req); in TEST_IMPL()
1767 r = uv_fs_fchmod(NULL, &req, file, 0600, NULL); in TEST_IMPL()
1769 ASSERT_OK(req.result); in TEST_IMPL()
1770 uv_fs_req_cleanup(&req); in TEST_IMPL()
1778 req.data = &mode; in TEST_IMPL()
1780 r = uv_fs_chmod(loop, &req, "test_file", 0200, chmod_cb); in TEST_IMPL()
1790 req.data = &mode; in TEST_IMPL()
1792 r = uv_fs_chmod(loop, &req, "test_file", 0400, chmod_cb); in TEST_IMPL()
1800 req.data = &mode; in TEST_IMPL()
1802 r = uv_fs_fchmod(loop, &req, file, 0600, fchmod_cb); in TEST_IMPL()
1807 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
1825 uv_fs_t req; in TEST_IMPL() local
1834 &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1838 ASSERT_GE(req.result, 0); in TEST_IMPL()
1839 file = req.result; in TEST_IMPL()
1840 uv_fs_req_cleanup(&req); in TEST_IMPL()
1843 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1845 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1846 uv_fs_req_cleanup(&req); in TEST_IMPL()
1848 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
1851 r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); in TEST_IMPL()
1853 ASSERT_OK(req.result); in TEST_IMPL()
1854 uv_fs_req_cleanup(&req); in TEST_IMPL()
1859 r = uv_fs_unlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
1861 ASSERT_OK(req.result); in TEST_IMPL()
1862 uv_fs_req_cleanup(&req); in TEST_IMPL()
1871 uv_fs_chmod(NULL, &req, "test_file", 0600, NULL); in TEST_IMPL()
1872 uv_fs_req_cleanup(&req); in TEST_IMPL()
1882 uv_fs_t req; in TEST_IMPL() local
1891 &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1895 ASSERT_GE(req.result, 0); in TEST_IMPL()
1896 file = req.result; in TEST_IMPL()
1897 uv_fs_req_cleanup(&req); in TEST_IMPL()
1900 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1902 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1903 uv_fs_req_cleanup(&req); in TEST_IMPL()
1905 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
1910 uv_fs_req_cleanup(&req); in TEST_IMPL()
1915 r = uv_fs_unlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
1917 ASSERT_OK(req.result); in TEST_IMPL()
1918 uv_fs_req_cleanup(&req); in TEST_IMPL()
1927 uv_fs_chmod(NULL, &req, "test_file", 0600, NULL); in TEST_IMPL()
1928 uv_fs_req_cleanup(&req); in TEST_IMPL()
1938 uv_fs_t req; in TEST_IMPL() local
1947 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1950 ASSERT_GE(req.result, 0); in TEST_IMPL()
1951 file = req.result; in TEST_IMPL()
1952 uv_fs_req_cleanup(&req); in TEST_IMPL()
1955 r = uv_fs_chown(NULL, &req, "test_file", -1, -1, NULL); in TEST_IMPL()
1957 ASSERT_OK(req.result); in TEST_IMPL()
1958 uv_fs_req_cleanup(&req); in TEST_IMPL()
1961 r = uv_fs_fchown(NULL, &req, file, -1, -1, NULL); in TEST_IMPL()
1963 ASSERT_OK(req.result); in TEST_IMPL()
1964 uv_fs_req_cleanup(&req); in TEST_IMPL()
1967 r = uv_fs_chown(loop, &req, "test_file", -1, -1, chown_cb); in TEST_IMPL()
1975 r = uv_fs_chown(loop, &req, "test_file", 0, 0, chown_root_cb); in TEST_IMPL()
1982 r = uv_fs_fchown(loop, &req, file, -1, -1, fchown_cb); in TEST_IMPL()
1990 r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); in TEST_IMPL()
1992 ASSERT_OK(req.result); in TEST_IMPL()
1993 uv_fs_req_cleanup(&req); in TEST_IMPL()
1996 r = uv_fs_lchown(NULL, &req, "test_file_link", -1, -1, NULL); in TEST_IMPL()
1998 ASSERT_OK(req.result); in TEST_IMPL()
1999 uv_fs_req_cleanup(&req); in TEST_IMPL()
2002 r = uv_fs_lchown(loop, &req, "test_file_link", -1, -1, lchown_cb); in TEST_IMPL()
2009 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
2011 ASSERT_OK(req.result); in TEST_IMPL()
2012 uv_fs_req_cleanup(&req); in TEST_IMPL()
2031 uv_fs_t req; in TEST_IMPL() local
2042 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2045 ASSERT_GE(req.result, 0); in TEST_IMPL()
2046 file = req.result; in TEST_IMPL()
2047 uv_fs_req_cleanup(&req); in TEST_IMPL()
2050 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
2052 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
2053 uv_fs_req_cleanup(&req); in TEST_IMPL()
2055 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
2058 r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); in TEST_IMPL()
2060 ASSERT_OK(req.result); in TEST_IMPL()
2061 uv_fs_req_cleanup(&req); in TEST_IMPL()
2063 r = uv_fs_open(NULL, &req, "test_file_link", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2065 ASSERT_GE(req.result, 0); in TEST_IMPL()
2066 link = req.result; in TEST_IMPL()
2067 uv_fs_req_cleanup(&req); in TEST_IMPL()
2071 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2073 ASSERT_GE(req.result, 0); in TEST_IMPL()
2079 r = uv_fs_link(loop, &req, "test_file", "test_file_link2", link_cb); in TEST_IMPL()
2084 r = uv_fs_open(NULL, &req, "test_file_link2", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2086 ASSERT_GE(req.result, 0); in TEST_IMPL()
2087 link = req.result; in TEST_IMPL()
2088 uv_fs_req_cleanup(&req); in TEST_IMPL()
2092 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2094 ASSERT_GE(req.result, 0); in TEST_IMPL()
2097 uv_fs_close(loop, &req, link, NULL); in TEST_IMPL()
2118 uv_fs_t req; in TEST_IMPL() local
2121 ASSERT_OK(uv_fs_readlink(loop, &req, "no_such_file", dummy_cb)); in TEST_IMPL()
2124 ASSERT_NULL(req.ptr); in TEST_IMPL()
2125 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2126 uv_fs_req_cleanup(&req); in TEST_IMPL()
2128 ASSERT_EQ(UV_ENOENT, uv_fs_readlink(NULL, &req, "no_such_file", NULL)); in TEST_IMPL()
2129 ASSERT_NULL(req.ptr); in TEST_IMPL()
2130 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2131 uv_fs_req_cleanup(&req); in TEST_IMPL()
2137 uv_fs_t req; in TEST_IMPL() local
2143 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2146 ASSERT_GE(req.result, 0); in TEST_IMPL()
2147 file = req.result; in TEST_IMPL()
2148 uv_fs_req_cleanup(&req); in TEST_IMPL()
2150 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
2152 ASSERT_OK(req.result); in TEST_IMPL()
2153 uv_fs_req_cleanup(&req); in TEST_IMPL()
2156 r = uv_fs_readlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
2158 uv_fs_req_cleanup(&req); in TEST_IMPL()
2170 uv_fs_t req; in TEST_IMPL() local
2173 ASSERT_OK(uv_fs_realpath(loop, &req, "no_such_file", dummy_cb)); in TEST_IMPL()
2176 ASSERT_NULL(req.ptr); in TEST_IMPL()
2177 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2178 uv_fs_req_cleanup(&req); in TEST_IMPL()
2180 ASSERT_EQ(UV_ENOENT, uv_fs_realpath(NULL, &req, "no_such_file", NULL)); in TEST_IMPL()
2181 ASSERT_NULL(req.ptr); in TEST_IMPL()
2182 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2183 uv_fs_req_cleanup(&req); in TEST_IMPL()
2192 uv_fs_t req; in TEST_IMPL() local
2215 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2218 ASSERT_GE(req.result, 0); in TEST_IMPL()
2219 file = req.result; in TEST_IMPL()
2220 uv_fs_req_cleanup(&req); in TEST_IMPL()
2223 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
2225 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
2226 uv_fs_req_cleanup(&req); in TEST_IMPL()
2228 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
2231 r = uv_fs_symlink(NULL, &req, "test_file", "test_file_symlink", 0, NULL); in TEST_IMPL()
2250 ASSERT_OK(req.result); in TEST_IMPL()
2251 uv_fs_req_cleanup(&req); in TEST_IMPL()
2253 r = uv_fs_open(NULL, &req, "test_file_symlink", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2255 ASSERT_GE(req.result, 0); in TEST_IMPL()
2256 link = req.result; in TEST_IMPL()
2257 uv_fs_req_cleanup(&req); in TEST_IMPL()
2261 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2263 ASSERT_GE(req.result, 0); in TEST_IMPL()
2266 uv_fs_close(loop, &req, link, NULL); in TEST_IMPL()
2269 &req, in TEST_IMPL()
2275 uv_fs_req_cleanup(&req); in TEST_IMPL()
2281 r = uv_fs_readlink(NULL, &req, "test_file_symlink_symlink", NULL); in TEST_IMPL()
2283 ASSERT_OK(strcmp(req.ptr, "test_file_symlink")); in TEST_IMPL()
2284 uv_fs_req_cleanup(&req); in TEST_IMPL()
2286 r = uv_fs_realpath(NULL, &req, "test_file_symlink_symlink", NULL); in TEST_IMPL()
2289 ASSERT_OK(_stricmp(req.ptr, test_file_abs_buf)); in TEST_IMPL()
2291 ASSERT_OK(strcmp(req.ptr, test_file_abs_buf)); in TEST_IMPL()
2293 uv_fs_req_cleanup(&req); in TEST_IMPL()
2297 &req, in TEST_IMPL()
2306 r = uv_fs_open(NULL, &req, "test_file_symlink2", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2308 ASSERT_GE(req.result, 0); in TEST_IMPL()
2309 link = req.result; in TEST_IMPL()
2310 uv_fs_req_cleanup(&req); in TEST_IMPL()
2314 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2316 ASSERT_GE(req.result, 0); in TEST_IMPL()
2319 uv_fs_close(loop, &req, link, NULL); in TEST_IMPL()
2322 &req, in TEST_IMPL()
2328 uv_fs_req_cleanup(&req); in TEST_IMPL()
2330 r = uv_fs_readlink(loop, &req, "test_file_symlink2_symlink", readlink_cb); in TEST_IMPL()
2335 r = uv_fs_realpath(loop, &req, "test_file", realpath_cb); in TEST_IMPL()
2359 uv_fs_t req; in test_symlink_dir_impl() local
2375 uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); in test_symlink_dir_impl()
2376 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2392 r = uv_fs_symlink(NULL, &req, test_dir, "test_dir_symlink", type, NULL); in test_symlink_dir_impl()
2394 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2400 ASSERT_OK(req.result); in test_symlink_dir_impl()
2401 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2403 r = uv_fs_stat(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2405 ASSERT(((uv_stat_t*)req.ptr)->st_mode & S_IFDIR); in test_symlink_dir_impl()
2406 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2408 r = uv_fs_lstat(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2413 ASSERT(((uv_stat_t*)req.ptr)->st_mode & S_IFLNK); in test_symlink_dir_impl()
2415 ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen(test_dir + 4)); in test_symlink_dir_impl()
2419 ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen("test_dir_symlink")); in test_symlink_dir_impl()
2421 ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen(test_dir)); in test_symlink_dir_impl()
2424 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2426 r = uv_fs_readlink(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2429 ASSERT_OK(strcmp(req.ptr, test_dir + 4)); in test_symlink_dir_impl()
2431 ASSERT_OK(strcmp(req.ptr, test_dir)); in test_symlink_dir_impl()
2433 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2435 r = uv_fs_realpath(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2438 ASSERT_EQ(strlen(req.ptr), test_dir_abs_size - 4); in test_symlink_dir_impl()
2439 ASSERT_OK(_strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 4)); in test_symlink_dir_impl()
2441 ASSERT_OK(strcmp(req.ptr, test_dir_abs_buf)); in test_symlink_dir_impl()
2443 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2475 r = uv_fs_unlink(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2477 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2514 uv_fs_t req; in TEST_IMPL() local
2527 uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); in TEST_IMPL()
2528 uv_fs_req_cleanup(&req); in TEST_IMPL()
2557 r = uv_fs_readlink(NULL, &req, "test_dir/test_file", NULL); in TEST_IMPL()
2559 uv_fs_req_cleanup(&req); in TEST_IMPL()
2620 uv_fs_t req; in TEST_IMPL() local
2638 if (uv_fs_opendir(loop, &req, windowsapps_path, NULL) != 0) { in TEST_IMPL()
2643 if (uv_fs_scandir(loop, &req, windowsapps_path, 0, NULL) <= 0) { in TEST_IMPL()
2647 while (uv_fs_scandir_next(&req, &dirent) != UV_EOF) { in TEST_IMPL()
2671 uv_fs_t req; in TEST_IMPL() local
2677 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2681 ASSERT_GE(req.result, 0); in TEST_IMPL()
2682 uv_fs_req_cleanup(&req); in TEST_IMPL()
2683 uv_fs_close(loop, &req, r, NULL); in TEST_IMPL()
2687 r = uv_fs_utime(NULL, &req, path, atime, mtime, NULL); in TEST_IMPL()
2689 ASSERT_OK(req.result); in TEST_IMPL()
2690 uv_fs_req_cleanup(&req); in TEST_IMPL()
2718 uv_fs_t req; in TEST_IMPL() local
2723 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2727 ASSERT_GE(req.result, 0); in TEST_IMPL()
2728 uv_fs_req_cleanup(&req); in TEST_IMPL()
2729 ASSERT_OK(uv_fs_close(loop, &req, r, NULL)); in TEST_IMPL()
2733 r = uv_fs_utime(NULL, &req, path, atime, mtime, NULL); in TEST_IMPL()
2745 ASSERT_OK(req.result); in TEST_IMPL()
2746 uv_fs_req_cleanup(&req); in TEST_IMPL()
2793 uv_fs_t req; in TEST_IMPL() local
2802 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2806 ASSERT_GE(req.result, 0); in TEST_IMPL()
2807 uv_fs_req_cleanup(&req); in TEST_IMPL()
2808 uv_fs_close(loop, &req, r, NULL); in TEST_IMPL()
2812 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2814 ASSERT_GE(req.result, 0); in TEST_IMPL()
2815 file = req.result; /* FIXME probably not how it's supposed to be used */ in TEST_IMPL()
2816 uv_fs_req_cleanup(&req); in TEST_IMPL()
2818 r = uv_fs_futime(NULL, &req, file, atime, mtime, NULL); in TEST_IMPL()
2824 ASSERT_OK(req.result); in TEST_IMPL()
2826 uv_fs_req_cleanup(&req); in TEST_IMPL()
2857 uv_fs_t req; in TEST_IMPL() local
2864 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2868 ASSERT_GE(req.result, 0); in TEST_IMPL()
2869 uv_fs_req_cleanup(&req); in TEST_IMPL()
2870 uv_fs_close(loop, &req, r, NULL); in TEST_IMPL()
2873 s = uv_fs_symlink(NULL, &req, path, symlink_path, 0, NULL); in TEST_IMPL()
2885 ASSERT_OK(req.result); in TEST_IMPL()
2886 uv_fs_req_cleanup(&req); in TEST_IMPL()
2894 req.data = &checkme; in TEST_IMPL()
2896 r = uv_fs_lutime(NULL, &req, symlink_path, atime, mtime, NULL); in TEST_IMPL()
2903 lutime_cb(&req); in TEST_IMPL()
2913 r = uv_fs_lutime(loop, &req, symlink_path, atime, mtime, lutime_cb); in TEST_IMPL()
2928 uv_fs_t req; in TEST_IMPL() local
2933 r = uv_fs_stat(NULL, &req, "non_existent_file", NULL); in TEST_IMPL()
2935 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2936 uv_fs_req_cleanup(&req); in TEST_IMPL()
2945 uv_fs_t req; in TEST_IMPL() local
2952 uv_fs_mkdir(NULL, &req, path, 0777, NULL); in TEST_IMPL()
2953 uv_fs_req_cleanup(&req); in TEST_IMPL()
2956 memset(&req, 0xdb, sizeof(req)); in TEST_IMPL()
2958 r = uv_fs_scandir(NULL, &req, path, 0, NULL); in TEST_IMPL()
2960 ASSERT_OK(req.result); in TEST_IMPL()
2961 ASSERT_NULL(req.ptr); in TEST_IMPL()
2962 ASSERT_EQ(UV_EOF, uv_fs_scandir_next(&req, &dent)); in TEST_IMPL()
2963 uv_fs_req_cleanup(&req); in TEST_IMPL()
2972 uv_fs_rmdir(NULL, &req, path, NULL); in TEST_IMPL()
2973 uv_fs_req_cleanup(&req); in TEST_IMPL()
2982 uv_fs_t req; in TEST_IMPL() local
2989 uv_fs_rmdir(NULL, &req, path, NULL); in TEST_IMPL()
2990 uv_fs_req_cleanup(&req); in TEST_IMPL()
2993 memset(&req, 0xdb, sizeof(req)); in TEST_IMPL()
2995 r = uv_fs_scandir(NULL, &req, path, 0, NULL); in TEST_IMPL()
2997 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2998 ASSERT_NULL(req.ptr); in TEST_IMPL()
2999 ASSERT_EQ(UV_ENOENT, uv_fs_scandir_next(&req, &dent)); in TEST_IMPL()
3000 uv_fs_req_cleanup(&req); in TEST_IMPL()
3039 uv_fs_t req; in TEST_IMPL() local
3041 ASSERT_LT(0, uv_fs_scandir(NULL, &req, "test/fixtures/one_file", 0, NULL)); in TEST_IMPL()
3042 ASSERT_NE(UV_EOF, uv_fs_scandir_next(&req, &d)); in TEST_IMPL()
3043 uv_fs_req_cleanup(&req); in TEST_IMPL()
3045 ASSERT_LT(0, uv_fs_scandir(NULL, &req, "test/fixtures", 0, NULL)); in TEST_IMPL()
3046 ASSERT_NE(UV_EOF, uv_fs_scandir_next(&req, &d)); in TEST_IMPL()
3047 uv_fs_req_cleanup(&req); in TEST_IMPL()
3056 uv_fs_t req; in TEST_IMPL() local
3062 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
3064 ASSERT_GE(req.result, 0); in TEST_IMPL()
3065 ASSERT_NULL(req.ptr); in TEST_IMPL()
3067 uv_fs_req_cleanup(&req); in TEST_IMPL()
3069 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
3072 r = uv_fs_open(loop, &req, path, UV_FS_O_RDONLY, 0, open_cb_simple); in TEST_IMPL()
4438 uv_fs_t req; in TEST_IMPL() local
4458 uv_fs_chmod(loop, &req, "test_file_icacls", S_IWUSR, NULL); in TEST_IMPL()
4514 uv_fs_t req; in TEST_IMPL() local
4522 &req, "test_file", UV_FS_O_WRONLY | UV_FS_O_CREAT, in TEST_IMPL()
4526 ASSERT_GE(req.result, 0); in TEST_IMPL()
4527 file = req.result; in TEST_IMPL()
4528 uv_fs_req_cleanup(&req); in TEST_IMPL()
4529 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
4531 uv_fs_req_cleanup(&req); in TEST_IMPL()
4537 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
4539 ASSERT_GE(req.result, 0); in TEST_IMPL()
4540 file = req.result; in TEST_IMPL()
4541 uv_fs_req_cleanup(&req); in TEST_IMPL()
4542 r = uv_fs_fchmod(NULL, &req, file, S_IWUSR, NULL); in TEST_IMPL()
4544 ASSERT_OK(req.result); in TEST_IMPL()
4545 uv_fs_req_cleanup(&req); in TEST_IMPL()
4546 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
4548 uv_fs_req_cleanup(&req); in TEST_IMPL()
4560 uv_fs_t req; in TEST_IMPL() local
4564 r = uv_fs_mkdir(loop, &req, "invalid>", 0, NULL); in TEST_IMPL()
4566 ASSERT_EQ(UV_EINVAL, uv_fs_mkdir(loop, &req, "test:lol", 0, NULL)); in TEST_IMPL()
4573 uv_fs_t req; in TEST_IMPL() local
4579 r = uv_fs_statfs(NULL, &req, ".", NULL); in TEST_IMPL()
4581 statfs_cb(&req); in TEST_IMPL()
4585 r = uv_fs_statfs(loop, &req, ".", statfs_cb); in TEST_IMPL()
4595 uv_fs_t req; in TEST_IMPL() local
4599 r = uv_fs_statfs(NULL, &req, "non_existing_file", NULL); in TEST_IMPL()
4602 system_error = uv_fs_get_system_error(&req); in TEST_IMPL()
4614 uv_fs_t req[300]; in TEST_IMPL() local
4625 for (i = 0; i < (int) ARRAY_SIZE(req); ++i) { in TEST_IMPL()
4626 r = uv_fs_stat(loop, &req[i], "test_dir", stat_batch_cb); in TEST_IMPL()
4631 ASSERT_EQ(stat_cb_count, ARRAY_SIZE(req)); in TEST_IMPL()