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()
1248 uv_fs_t req; in test_sendfile() local
1307 r = uv_fs_read(NULL, &req, open_req1.result, &iov, 1, -1, NULL); in test_sendfile()
1309 ASSERT_GE(req.result, 0); in test_sendfile()
1311 uv_fs_req_cleanup(&req); in test_sendfile()
1377 uv_fs_t req; in TEST_IMPL() local
1405 r = uv_fs_write(NULL, &req, mkstemp_req1.result, &iov, 1, -1, NULL); in TEST_IMPL()
1407 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1408 uv_fs_req_cleanup(&req); in TEST_IMPL()
1411 uv_fs_close(NULL, &req, mkstemp_req1.result, NULL); in TEST_IMPL()
1412 uv_fs_req_cleanup(&req); in TEST_IMPL()
1413 uv_fs_close(NULL, &req, mkstemp_req2.result, NULL); in TEST_IMPL()
1414 uv_fs_req_cleanup(&req); in TEST_IMPL()
1416 fd = uv_fs_open(NULL, &req, mkstemp_req1.path, UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
1418 uv_fs_req_cleanup(&req); in TEST_IMPL()
1422 r = uv_fs_read(NULL, &req, fd, &iov, 1, -1, NULL); in TEST_IMPL()
1424 ASSERT_GE(req.result, 0); in TEST_IMPL()
1426 uv_fs_req_cleanup(&req); in TEST_IMPL()
1428 uv_fs_close(NULL, &req, fd, NULL); in TEST_IMPL()
1429 uv_fs_req_cleanup(&req); in TEST_IMPL()
1443 uv_fs_t req; in TEST_IMPL() local
1462 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1465 ASSERT_GE(req.result, 0); in TEST_IMPL()
1466 file = req.result; in TEST_IMPL()
1467 uv_fs_req_cleanup(&req); in TEST_IMPL()
1472 ASSERT_OK(uv_fs_fstat(NULL, &req, file, NULL)); in TEST_IMPL()
1473 ASSERT_OK(req.result); in TEST_IMPL()
1474 s = req.ptr; in TEST_IMPL()
1490 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1492 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1493 uv_fs_req_cleanup(&req); in TEST_IMPL()
1495 memset(&req.statbuf, 0xaa, sizeof(req.statbuf)); in TEST_IMPL()
1496 r = uv_fs_fstat(NULL, &req, file, NULL); in TEST_IMPL()
1498 ASSERT_OK(req.result); in TEST_IMPL()
1499 s = req.ptr; in TEST_IMPL()
1577 uv_fs_req_cleanup(&req); in TEST_IMPL()
1580 r = uv_fs_fstat(loop, &req, file, fstat_cb); in TEST_IMPL()
1586 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
1588 ASSERT_OK(req.result); in TEST_IMPL()
1589 uv_fs_req_cleanup(&req); in TEST_IMPL()
1608 uv_fs_t req; in TEST_IMPL() local
1615 res = uv_fs_fstat(NULL, &req, fd, NULL); in TEST_IMPL()
1617 ASSERT_OK(req.result); in TEST_IMPL()
1620 st = req.ptr; in TEST_IMPL()
1636 uv_fs_req_cleanup(&req); in TEST_IMPL()
1646 uv_fs_t req; in TEST_IMPL() local
1656 r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); in TEST_IMPL()
1658 ASSERT_LT(req.result, 0); in TEST_IMPL()
1659 uv_fs_req_cleanup(&req); in TEST_IMPL()
1662 r = uv_fs_access(loop, &req, "test_file", F_OK, access_cb); in TEST_IMPL()
1669 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1672 ASSERT_GE(req.result, 0); in TEST_IMPL()
1673 file = req.result; in TEST_IMPL()
1674 uv_fs_req_cleanup(&req); in TEST_IMPL()
1677 r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); in TEST_IMPL()
1679 ASSERT_OK(req.result); in TEST_IMPL()
1680 uv_fs_req_cleanup(&req); in TEST_IMPL()
1683 r = uv_fs_access(loop, &req, "test_file", F_OK, access_cb); in TEST_IMPL()
1690 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
1692 ASSERT_OK(req.result); in TEST_IMPL()
1693 uv_fs_req_cleanup(&req); in TEST_IMPL()
1696 r = uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); in TEST_IMPL()
1698 uv_fs_req_cleanup(&req); in TEST_IMPL()
1700 r = uv_fs_access(NULL, &req, "test_dir", W_OK, NULL); in TEST_IMPL()
1702 ASSERT_OK(req.result); in TEST_IMPL()
1703 uv_fs_req_cleanup(&req); in TEST_IMPL()
1722 uv_fs_t req; in TEST_IMPL() local
1730 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1733 ASSERT_GE(req.result, 0); in TEST_IMPL()
1734 file = req.result; in TEST_IMPL()
1735 uv_fs_req_cleanup(&req); in TEST_IMPL()
1738 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1740 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1741 uv_fs_req_cleanup(&req); in TEST_IMPL()
1745 r = uv_fs_chmod(NULL, &req, "test_file", 0200, NULL); in TEST_IMPL()
1747 ASSERT_OK(req.result); in TEST_IMPL()
1748 uv_fs_req_cleanup(&req); in TEST_IMPL()
1754 r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); in TEST_IMPL()
1756 ASSERT_OK(req.result); in TEST_IMPL()
1757 uv_fs_req_cleanup(&req); in TEST_IMPL()
1762 r = uv_fs_fchmod(NULL, &req, file, 0600, NULL); in TEST_IMPL()
1764 ASSERT_OK(req.result); in TEST_IMPL()
1765 uv_fs_req_cleanup(&req); in TEST_IMPL()
1773 req.data = &mode; in TEST_IMPL()
1775 r = uv_fs_chmod(loop, &req, "test_file", 0200, chmod_cb); in TEST_IMPL()
1785 req.data = &mode; in TEST_IMPL()
1787 r = uv_fs_chmod(loop, &req, "test_file", 0400, chmod_cb); in TEST_IMPL()
1795 req.data = &mode; in TEST_IMPL()
1797 r = uv_fs_fchmod(loop, &req, file, 0600, fchmod_cb); in TEST_IMPL()
1802 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
1820 uv_fs_t req; in TEST_IMPL() local
1829 &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1833 ASSERT_GE(req.result, 0); in TEST_IMPL()
1834 file = req.result; in TEST_IMPL()
1835 uv_fs_req_cleanup(&req); in TEST_IMPL()
1838 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1840 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1841 uv_fs_req_cleanup(&req); in TEST_IMPL()
1843 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
1846 r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); in TEST_IMPL()
1848 ASSERT_OK(req.result); in TEST_IMPL()
1849 uv_fs_req_cleanup(&req); in TEST_IMPL()
1854 r = uv_fs_unlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
1856 ASSERT_OK(req.result); in TEST_IMPL()
1857 uv_fs_req_cleanup(&req); in TEST_IMPL()
1866 uv_fs_chmod(NULL, &req, "test_file", 0600, NULL); in TEST_IMPL()
1867 uv_fs_req_cleanup(&req); in TEST_IMPL()
1877 uv_fs_t req; in TEST_IMPL() local
1886 &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1890 ASSERT_GE(req.result, 0); in TEST_IMPL()
1891 file = req.result; in TEST_IMPL()
1892 uv_fs_req_cleanup(&req); in TEST_IMPL()
1895 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1897 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
1898 uv_fs_req_cleanup(&req); in TEST_IMPL()
1900 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
1905 uv_fs_req_cleanup(&req); in TEST_IMPL()
1910 r = uv_fs_unlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
1912 ASSERT_OK(req.result); in TEST_IMPL()
1913 uv_fs_req_cleanup(&req); in TEST_IMPL()
1922 uv_fs_chmod(NULL, &req, "test_file", 0600, NULL); in TEST_IMPL()
1923 uv_fs_req_cleanup(&req); in TEST_IMPL()
1933 uv_fs_t req; in TEST_IMPL() local
1942 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1945 ASSERT_GE(req.result, 0); in TEST_IMPL()
1946 file = req.result; in TEST_IMPL()
1947 uv_fs_req_cleanup(&req); in TEST_IMPL()
1950 r = uv_fs_chown(NULL, &req, "test_file", -1, -1, NULL); in TEST_IMPL()
1952 ASSERT_OK(req.result); in TEST_IMPL()
1953 uv_fs_req_cleanup(&req); in TEST_IMPL()
1956 r = uv_fs_fchown(NULL, &req, file, -1, -1, NULL); in TEST_IMPL()
1958 ASSERT_OK(req.result); in TEST_IMPL()
1959 uv_fs_req_cleanup(&req); in TEST_IMPL()
1962 r = uv_fs_chown(loop, &req, "test_file", -1, -1, chown_cb); in TEST_IMPL()
1970 r = uv_fs_chown(loop, &req, "test_file", 0, 0, chown_root_cb); in TEST_IMPL()
1977 r = uv_fs_fchown(loop, &req, file, -1, -1, fchown_cb); in TEST_IMPL()
1985 r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); in TEST_IMPL()
1987 ASSERT_OK(req.result); in TEST_IMPL()
1988 uv_fs_req_cleanup(&req); in TEST_IMPL()
1991 r = uv_fs_lchown(NULL, &req, "test_file_link", -1, -1, NULL); in TEST_IMPL()
1993 ASSERT_OK(req.result); in TEST_IMPL()
1994 uv_fs_req_cleanup(&req); in TEST_IMPL()
1997 r = uv_fs_lchown(loop, &req, "test_file_link", -1, -1, lchown_cb); in TEST_IMPL()
2004 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
2006 ASSERT_OK(req.result); in TEST_IMPL()
2007 uv_fs_req_cleanup(&req); in TEST_IMPL()
2026 uv_fs_t req; in TEST_IMPL() local
2037 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2040 ASSERT_GE(req.result, 0); in TEST_IMPL()
2041 file = req.result; in TEST_IMPL()
2042 uv_fs_req_cleanup(&req); in TEST_IMPL()
2045 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
2047 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
2048 uv_fs_req_cleanup(&req); in TEST_IMPL()
2050 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
2053 r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); in TEST_IMPL()
2055 ASSERT_OK(req.result); in TEST_IMPL()
2056 uv_fs_req_cleanup(&req); in TEST_IMPL()
2058 r = uv_fs_open(NULL, &req, "test_file_link", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2060 ASSERT_GE(req.result, 0); in TEST_IMPL()
2061 link = req.result; in TEST_IMPL()
2062 uv_fs_req_cleanup(&req); in TEST_IMPL()
2066 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2068 ASSERT_GE(req.result, 0); in TEST_IMPL()
2074 r = uv_fs_link(loop, &req, "test_file", "test_file_link2", link_cb); in TEST_IMPL()
2079 r = uv_fs_open(NULL, &req, "test_file_link2", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2081 ASSERT_GE(req.result, 0); in TEST_IMPL()
2082 link = req.result; in TEST_IMPL()
2083 uv_fs_req_cleanup(&req); in TEST_IMPL()
2087 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2089 ASSERT_GE(req.result, 0); in TEST_IMPL()
2092 uv_fs_close(loop, &req, link, NULL); in TEST_IMPL()
2113 uv_fs_t req; in TEST_IMPL() local
2116 ASSERT_OK(uv_fs_readlink(loop, &req, "no_such_file", dummy_cb)); in TEST_IMPL()
2119 ASSERT_NULL(req.ptr); in TEST_IMPL()
2120 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2121 uv_fs_req_cleanup(&req); in TEST_IMPL()
2123 ASSERT_EQ(UV_ENOENT, uv_fs_readlink(NULL, &req, "no_such_file", NULL)); 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()
2132 uv_fs_t req; in TEST_IMPL() local
2138 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2141 ASSERT_GE(req.result, 0); in TEST_IMPL()
2142 file = req.result; in TEST_IMPL()
2143 uv_fs_req_cleanup(&req); in TEST_IMPL()
2145 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
2147 ASSERT_OK(req.result); in TEST_IMPL()
2148 uv_fs_req_cleanup(&req); in TEST_IMPL()
2151 r = uv_fs_readlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
2153 uv_fs_req_cleanup(&req); in TEST_IMPL()
2165 uv_fs_t req; in TEST_IMPL() local
2168 ASSERT_OK(uv_fs_realpath(loop, &req, "no_such_file", dummy_cb)); in TEST_IMPL()
2171 ASSERT_NULL(req.ptr); in TEST_IMPL()
2172 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2173 uv_fs_req_cleanup(&req); in TEST_IMPL()
2175 ASSERT_EQ(UV_ENOENT, uv_fs_realpath(NULL, &req, "no_such_file", NULL)); 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()
2187 uv_fs_t req; in TEST_IMPL() local
2210 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2213 ASSERT_GE(req.result, 0); in TEST_IMPL()
2214 file = req.result; in TEST_IMPL()
2215 uv_fs_req_cleanup(&req); in TEST_IMPL()
2218 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
2220 ASSERT_EQ(req.result, sizeof(test_buf)); in TEST_IMPL()
2221 uv_fs_req_cleanup(&req); in TEST_IMPL()
2223 uv_fs_close(loop, &req, file, NULL); in TEST_IMPL()
2226 r = uv_fs_symlink(NULL, &req, "test_file", "test_file_symlink", 0, NULL); in TEST_IMPL()
2245 ASSERT_OK(req.result); in TEST_IMPL()
2246 uv_fs_req_cleanup(&req); in TEST_IMPL()
2248 r = uv_fs_open(NULL, &req, "test_file_symlink", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2250 ASSERT_GE(req.result, 0); in TEST_IMPL()
2251 link = req.result; in TEST_IMPL()
2252 uv_fs_req_cleanup(&req); in TEST_IMPL()
2256 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2258 ASSERT_GE(req.result, 0); in TEST_IMPL()
2261 uv_fs_close(loop, &req, link, NULL); in TEST_IMPL()
2264 &req, in TEST_IMPL()
2270 uv_fs_req_cleanup(&req); in TEST_IMPL()
2276 r = uv_fs_readlink(NULL, &req, "test_file_symlink_symlink", NULL); in TEST_IMPL()
2278 ASSERT_OK(strcmp(req.ptr, "test_file_symlink")); in TEST_IMPL()
2279 uv_fs_req_cleanup(&req); in TEST_IMPL()
2281 r = uv_fs_realpath(NULL, &req, "test_file_symlink_symlink", NULL); in TEST_IMPL()
2284 ASSERT_OK(_stricmp(req.ptr, test_file_abs_buf)); in TEST_IMPL()
2286 ASSERT_OK(strcmp(req.ptr, test_file_abs_buf)); in TEST_IMPL()
2288 uv_fs_req_cleanup(&req); in TEST_IMPL()
2292 &req, in TEST_IMPL()
2301 r = uv_fs_open(NULL, &req, "test_file_symlink2", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2303 ASSERT_GE(req.result, 0); in TEST_IMPL()
2304 link = req.result; in TEST_IMPL()
2305 uv_fs_req_cleanup(&req); in TEST_IMPL()
2309 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2311 ASSERT_GE(req.result, 0); in TEST_IMPL()
2314 uv_fs_close(loop, &req, link, NULL); in TEST_IMPL()
2317 &req, in TEST_IMPL()
2323 uv_fs_req_cleanup(&req); in TEST_IMPL()
2325 r = uv_fs_readlink(loop, &req, "test_file_symlink2_symlink", readlink_cb); in TEST_IMPL()
2330 r = uv_fs_realpath(loop, &req, "test_file", realpath_cb); in TEST_IMPL()
2354 uv_fs_t req; in test_symlink_dir_impl() local
2370 uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); in test_symlink_dir_impl()
2371 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2387 r = uv_fs_symlink(NULL, &req, test_dir, "test_dir_symlink", type, NULL); in test_symlink_dir_impl()
2389 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2395 ASSERT_OK(req.result); in test_symlink_dir_impl()
2396 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2398 r = uv_fs_stat(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2400 ASSERT(((uv_stat_t*)req.ptr)->st_mode & S_IFDIR); in test_symlink_dir_impl()
2401 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2403 r = uv_fs_lstat(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2408 ASSERT(((uv_stat_t*)req.ptr)->st_mode & S_IFLNK); in test_symlink_dir_impl()
2410 ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen(test_dir + 4)); in test_symlink_dir_impl()
2414 ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen("test_dir_symlink")); in test_symlink_dir_impl()
2416 ASSERT_EQ(((uv_stat_t*)req.ptr)->st_size, strlen(test_dir)); in test_symlink_dir_impl()
2419 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2421 r = uv_fs_readlink(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2424 ASSERT_OK(strcmp(req.ptr, test_dir + 4)); in test_symlink_dir_impl()
2426 ASSERT_OK(strcmp(req.ptr, test_dir)); in test_symlink_dir_impl()
2428 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2430 r = uv_fs_realpath(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2433 ASSERT_EQ(strlen(req.ptr), test_dir_abs_size - 5); in test_symlink_dir_impl()
2434 ASSERT_OK(_strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 5)); in test_symlink_dir_impl()
2436 ASSERT_OK(strcmp(req.ptr, test_dir_abs_buf)); in test_symlink_dir_impl()
2438 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2470 r = uv_fs_unlink(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2472 uv_fs_req_cleanup(&req); in test_symlink_dir_impl()
2509 uv_fs_t req; in TEST_IMPL() local
2522 uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); in TEST_IMPL()
2523 uv_fs_req_cleanup(&req); in TEST_IMPL()
2552 r = uv_fs_readlink(NULL, &req, "test_dir/test_file", NULL); in TEST_IMPL()
2554 uv_fs_req_cleanup(&req); in TEST_IMPL()
2615 uv_fs_t req; in TEST_IMPL() local
2633 if (uv_fs_opendir(loop, &req, windowsapps_path, NULL) != 0) { in TEST_IMPL()
2638 if (uv_fs_scandir(loop, &req, windowsapps_path, 0, NULL) <= 0) { in TEST_IMPL()
2642 while (uv_fs_scandir_next(&req, &dirent) != UV_EOF) { in TEST_IMPL()
2666 uv_fs_t req; in TEST_IMPL() local
2672 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2676 ASSERT_GE(req.result, 0); in TEST_IMPL()
2677 uv_fs_req_cleanup(&req); in TEST_IMPL()
2678 uv_fs_close(loop, &req, r, NULL); in TEST_IMPL()
2682 r = uv_fs_utime(NULL, &req, path, atime, mtime, NULL); in TEST_IMPL()
2684 ASSERT_OK(req.result); in TEST_IMPL()
2685 uv_fs_req_cleanup(&req); in TEST_IMPL()
2713 uv_fs_t req; in TEST_IMPL() local
2718 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2722 ASSERT_GE(req.result, 0); in TEST_IMPL()
2723 uv_fs_req_cleanup(&req); in TEST_IMPL()
2724 ASSERT_OK(uv_fs_close(loop, &req, r, NULL)); in TEST_IMPL()
2728 r = uv_fs_utime(NULL, &req, path, atime, mtime, NULL); in TEST_IMPL()
2740 ASSERT_OK(req.result); in TEST_IMPL()
2741 uv_fs_req_cleanup(&req); in TEST_IMPL()
2788 uv_fs_t req; in TEST_IMPL() local
2797 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2801 ASSERT_GE(req.result, 0); in TEST_IMPL()
2802 uv_fs_req_cleanup(&req); in TEST_IMPL()
2803 uv_fs_close(loop, &req, r, NULL); in TEST_IMPL()
2807 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2809 ASSERT_GE(req.result, 0); in TEST_IMPL()
2810 file = req.result; /* FIXME probably not how it's supposed to be used */ in TEST_IMPL()
2811 uv_fs_req_cleanup(&req); in TEST_IMPL()
2813 r = uv_fs_futime(NULL, &req, file, atime, mtime, NULL); in TEST_IMPL()
2819 ASSERT_OK(req.result); in TEST_IMPL()
2821 uv_fs_req_cleanup(&req); in TEST_IMPL()
2852 uv_fs_t req; in TEST_IMPL() local
2859 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2863 ASSERT_GE(req.result, 0); in TEST_IMPL()
2864 uv_fs_req_cleanup(&req); in TEST_IMPL()
2865 uv_fs_close(loop, &req, r, NULL); in TEST_IMPL()
2868 s = uv_fs_symlink(NULL, &req, path, symlink_path, 0, NULL); in TEST_IMPL()
2880 ASSERT_OK(req.result); in TEST_IMPL()
2881 uv_fs_req_cleanup(&req); in TEST_IMPL()
2889 req.data = &checkme; in TEST_IMPL()
2891 r = uv_fs_lutime(NULL, &req, symlink_path, atime, mtime, NULL); in TEST_IMPL()
2898 lutime_cb(&req); in TEST_IMPL()
2908 r = uv_fs_lutime(loop, &req, symlink_path, atime, mtime, lutime_cb); in TEST_IMPL()
2923 uv_fs_t req; in TEST_IMPL() local
2928 r = uv_fs_stat(NULL, &req, "non_existent_file", NULL); in TEST_IMPL()
2930 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2931 uv_fs_req_cleanup(&req); in TEST_IMPL()
2940 uv_fs_t req; in TEST_IMPL() local
2947 uv_fs_mkdir(NULL, &req, path, 0777, NULL); in TEST_IMPL()
2948 uv_fs_req_cleanup(&req); in TEST_IMPL()
2951 memset(&req, 0xdb, sizeof(req)); in TEST_IMPL()
2953 r = uv_fs_scandir(NULL, &req, path, 0, NULL); in TEST_IMPL()
2955 ASSERT_OK(req.result); in TEST_IMPL()
2956 ASSERT_NULL(req.ptr); in TEST_IMPL()
2957 ASSERT_EQ(UV_EOF, uv_fs_scandir_next(&req, &dent)); in TEST_IMPL()
2958 uv_fs_req_cleanup(&req); in TEST_IMPL()
2967 uv_fs_rmdir(NULL, &req, path, NULL); in TEST_IMPL()
2968 uv_fs_req_cleanup(&req); in TEST_IMPL()
2977 uv_fs_t req; in TEST_IMPL() local
2984 uv_fs_rmdir(NULL, &req, path, NULL); in TEST_IMPL()
2985 uv_fs_req_cleanup(&req); in TEST_IMPL()
2988 memset(&req, 0xdb, sizeof(req)); in TEST_IMPL()
2990 r = uv_fs_scandir(NULL, &req, path, 0, NULL); in TEST_IMPL()
2992 ASSERT_EQ(req.result, UV_ENOENT); in TEST_IMPL()
2993 ASSERT_NULL(req.ptr); in TEST_IMPL()
2994 ASSERT_EQ(UV_ENOENT, uv_fs_scandir_next(&req, &dent)); in TEST_IMPL()
2995 uv_fs_req_cleanup(&req); in TEST_IMPL()
3034 uv_fs_t req; in TEST_IMPL() local
3036 ASSERT_LT(0, uv_fs_scandir(NULL, &req, "test/fixtures/one_file", 0, NULL)); in TEST_IMPL()
3037 ASSERT_NE(UV_EOF, uv_fs_scandir_next(&req, &d)); in TEST_IMPL()
3038 uv_fs_req_cleanup(&req); in TEST_IMPL()
3040 ASSERT_LT(0, uv_fs_scandir(NULL, &req, "test/fixtures", 0, NULL)); in TEST_IMPL()
3041 ASSERT_NE(UV_EOF, uv_fs_scandir_next(&req, &d)); in TEST_IMPL()
3042 uv_fs_req_cleanup(&req); in TEST_IMPL()
3051 uv_fs_t req; in TEST_IMPL() local
3057 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
3059 ASSERT_GE(req.result, 0); in TEST_IMPL()
3060 ASSERT_NULL(req.ptr); in TEST_IMPL()
3062 uv_fs_req_cleanup(&req); in TEST_IMPL()
3064 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
3067 r = uv_fs_open(loop, &req, path, UV_FS_O_RDONLY, 0, open_cb_simple); in TEST_IMPL()
4433 uv_fs_t req; in TEST_IMPL() local
4453 uv_fs_chmod(loop, &req, "test_file_icacls", S_IWUSR, NULL); in TEST_IMPL()
4509 uv_fs_t req; in TEST_IMPL() local
4517 &req, "test_file", UV_FS_O_WRONLY | UV_FS_O_CREAT, in TEST_IMPL()
4521 ASSERT_GE(req.result, 0); in TEST_IMPL()
4522 file = req.result; in TEST_IMPL()
4523 uv_fs_req_cleanup(&req); in TEST_IMPL()
4524 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
4526 uv_fs_req_cleanup(&req); in TEST_IMPL()
4532 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
4534 ASSERT_GE(req.result, 0); in TEST_IMPL()
4535 file = req.result; in TEST_IMPL()
4536 uv_fs_req_cleanup(&req); in TEST_IMPL()
4537 r = uv_fs_fchmod(NULL, &req, file, S_IWUSR, NULL); in TEST_IMPL()
4539 ASSERT_OK(req.result); in TEST_IMPL()
4540 uv_fs_req_cleanup(&req); in TEST_IMPL()
4541 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
4543 uv_fs_req_cleanup(&req); in TEST_IMPL()
4555 uv_fs_t req; in TEST_IMPL() local
4559 r = uv_fs_mkdir(loop, &req, "invalid>", 0, NULL); in TEST_IMPL()
4561 ASSERT_EQ(UV_EINVAL, uv_fs_mkdir(loop, &req, "test:lol", 0, NULL)); in TEST_IMPL()
4568 uv_fs_t req; in TEST_IMPL() local
4574 r = uv_fs_statfs(NULL, &req, ".", NULL); in TEST_IMPL()
4576 statfs_cb(&req); in TEST_IMPL()
4580 r = uv_fs_statfs(loop, &req, ".", statfs_cb); in TEST_IMPL()
4590 uv_fs_t req; in TEST_IMPL() local
4594 r = uv_fs_statfs(NULL, &req, "non_existing_file", NULL); in TEST_IMPL()
4597 system_error = uv_fs_get_system_error(&req); in TEST_IMPL()
4609 uv_fs_t req[300]; in TEST_IMPL() local
4620 for (i = 0; i < (int) ARRAY_SIZE(req); ++i) { in TEST_IMPL()
4621 r = uv_fs_stat(loop, &req[i], "test_dir", stat_batch_cb); in TEST_IMPL()
4626 ASSERT_EQ(stat_cb_count, ARRAY_SIZE(req)); in TEST_IMPL()