Lines Matching refs:r

172   int r;  in check_permission()  local
176 r = uv_fs_stat(NULL, &req, filename, NULL); in check_permission()
177 ASSERT_OK(r); in check_permission()
372 int r; in close_cb() local
379 r = uv_fs_unlink(loop, &unlink_req, "test_file2", unlink_cb); in close_cb()
380 ASSERT_OK(r); in close_cb()
386 int r; in ftruncate_cb() local
392 r = uv_fs_close(loop, &close_req, open_req1.result, close_cb); in ftruncate_cb()
393 ASSERT_OK(r); in ftruncate_cb()
401 int r; in read_cb() local
409 r = uv_fs_ftruncate(loop, &ftruncate_req, open_req1.result, 7, in read_cb()
413 r = uv_fs_close(loop, &close_req, open_req1.result, close_cb); in read_cb()
415 ASSERT_OK(r); in read_cb()
420 int r; in open_cb() local
433 r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, in open_cb()
435 ASSERT_OK(r); in open_cb()
452 int r; in fsync_cb() local
458 r = uv_fs_close(loop, &close_req, open_req1.result, close_cb); in fsync_cb()
459 ASSERT_OK(r); in fsync_cb()
464 int r; in fdatasync_cb() local
470 r = uv_fs_fsync(loop, &fsync_req, open_req1.result, fsync_cb); in fdatasync_cb()
471 ASSERT_OK(r); in fdatasync_cb()
476 int r; in write_cb() local
482 r = uv_fs_fdatasync(loop, &fdatasync_req, open_req1.result, fdatasync_cb); in write_cb()
483 ASSERT_OK(r); in write_cb()
488 int r; in create_cb() local
495 r = uv_fs_write(loop, &write_req, req->result, &iov, 1, -1, write_cb); in create_cb()
496 ASSERT_OK(r); in create_cb()
521 int r; in check_mkdtemp_result() local
532 r = uv_fs_stat(NULL, &stat_req, req->path, NULL); in check_mkdtemp_result()
533 ASSERT_OK(r); in check_mkdtemp_result()
547 int r; in check_mkstemp_result() local
558 r = uv_fs_stat(NULL, &stat_req, req->path, NULL); in check_mkstemp_result()
559 ASSERT_OK(r); in check_mkstemp_result()
721 int r; in TEST_IMPL() local
725 r = uv_fs_open(NULL, &req, "does_not_exist", UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
726 ASSERT_EQ(r, UV_ENOENT); in TEST_IMPL()
730 r = uv_fs_open(loop, &req, "does_not_exist", UV_FS_O_RDONLY, 0, in TEST_IMPL()
732 ASSERT_OK(r); in TEST_IMPL()
746 int r; in TEST_IMPL() local
754 r = uv_fs_open(NULL, &req, name, UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
755 ASSERT_EQ(r, UV_ENAMETOOLONG); in TEST_IMPL()
759 r = uv_fs_open(loop, &req, name, UV_FS_O_RDONLY, 0, open_nametoolong_cb); in TEST_IMPL()
760 ASSERT_OK(r); in TEST_IMPL()
772 int r; in TEST_IMPL() local
777 r = uv_fs_symlink(NULL, &req, "test_symlink", "test_symlink", 0, NULL); in TEST_IMPL()
783 if (r == UV_EPERM) in TEST_IMPL()
788 if (r == UV_ENOENT) in TEST_IMPL()
791 ASSERT_OK(r); in TEST_IMPL()
794 r = uv_fs_open(NULL, &req, "test_symlink", UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
795 ASSERT_EQ(r, UV_ELOOP); in TEST_IMPL()
799 r = uv_fs_open(loop, &req, "test_symlink", UV_FS_O_RDONLY, 0, open_loop_cb); in TEST_IMPL()
800 ASSERT_OK(r); in TEST_IMPL()
818 int r; 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()
825 ASSERT_OK(r); in check_utime()
918 int r; in TEST_IMPL() local
926 r = uv_fs_open(loop, &open_req1, "test_file", UV_FS_O_WRONLY | UV_FS_O_CREAT, in TEST_IMPL()
928 ASSERT_OK(r); in TEST_IMPL()
937 r = uv_fs_rename(loop, &rename_req, "test_file", "test_file2", rename_cb); in TEST_IMPL()
938 ASSERT_OK(r); in TEST_IMPL()
946 r = uv_fs_open(loop, &open_req1, "test_file2", UV_FS_O_RDWR, 0, open_cb); in TEST_IMPL()
947 ASSERT_OK(r); in TEST_IMPL()
958 r = uv_fs_open(loop, &open_req1, "test_file2", UV_FS_O_RDONLY, 0, open_cb); in TEST_IMPL()
959 ASSERT_OK(r); in TEST_IMPL()
981 int r; in fs_file_sync() local
989 r = uv_fs_open(loop, &open_req1, "test_file", in fs_file_sync()
992 ASSERT_GE(r, 0); in fs_file_sync()
997 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_sync()
998 ASSERT_GE(r, 0); in fs_file_sync()
1002 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_sync()
1003 ASSERT_OK(r); in fs_file_sync()
1007 r = uv_fs_open(NULL, &open_req1, "test_file", UV_FS_O_RDWR | add_flags, 0, in fs_file_sync()
1009 ASSERT_GE(r, 0); in fs_file_sync()
1014 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_sync()
1015 ASSERT_GE(r, 0); in fs_file_sync()
1020 r = uv_fs_ftruncate(NULL, &ftruncate_req, open_req1.result, 7, NULL); in fs_file_sync()
1021 ASSERT_OK(r); in fs_file_sync()
1025 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_sync()
1026 ASSERT_OK(r); in fs_file_sync()
1030 r = uv_fs_rename(NULL, &rename_req, "test_file", "test_file2", NULL); in fs_file_sync()
1031 ASSERT_OK(r); in fs_file_sync()
1035 r = uv_fs_open(NULL, &open_req1, "test_file2", UV_FS_O_RDONLY | add_flags, 0, in fs_file_sync()
1037 ASSERT_GE(r, 0); in fs_file_sync()
1043 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_sync()
1044 ASSERT_GE(r, 0); in fs_file_sync()
1049 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_sync()
1050 ASSERT_OK(r); in fs_file_sync()
1054 r = uv_fs_unlink(NULL, &unlink_req, "test_file2", NULL); in fs_file_sync()
1055 ASSERT_OK(r); in fs_file_sync()
1072 int r; in TEST_IMPL() local
1078 r = uv_fs_mkdir(NULL, &mkdir_req, "test_dir", 0755, NULL); in TEST_IMPL()
1079 ASSERT_OK(r); in TEST_IMPL()
1081r = uv_fs_open(NULL, &open_req_noclose, "test_dir/file", UV_FS_O_WRONLY | UV_FS_O_CREAT, S_IWUSR |… in TEST_IMPL()
1082 ASSERT_GE(r, 0); in TEST_IMPL()
1086 r = uv_fs_rmdir(NULL, &rmdir_req, "test_dir", NULL); in TEST_IMPL()
1087 ASSERT((r == UV_ENOTEMPTY) || (r == UV_EEXIST)); in TEST_IMPL()
1088 ASSERT_EQ(r, rmdir_req.result); in TEST_IMPL()
1091 r = uv_fs_rmdir(NULL, &rmdir_req, "test_dir/file", NULL); in TEST_IMPL()
1092 ASSERT((r == UV_ENOTDIR) || (r == UV_ENOENT)); in TEST_IMPL()
1093 ASSERT_EQ(r, rmdir_req.result); in TEST_IMPL()
1096 r = uv_fs_unlink(NULL, &unlink_req, "test_dir/file", NULL); in TEST_IMPL()
1097 ASSERT_OK(r); in TEST_IMPL()
1102 r = uv_fs_rmdir(NULL, &rmdir_req, "test_dir", NULL); in TEST_IMPL()
1103 ASSERT_OK(r); in TEST_IMPL()
1108 r = uv_fs_close(NULL, &close_req, open_req_noclose.result, NULL); in TEST_IMPL()
1109 ASSERT_OK(r); in TEST_IMPL()
1117 int r; in fs_file_write_null_buffer() local
1124 r = uv_fs_open(NULL, &open_req1, "test_file", in fs_file_write_null_buffer()
1127 ASSERT_GE(r, 0); in fs_file_write_null_buffer()
1132 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_write_null_buffer()
1133 ASSERT_OK(r); in fs_file_write_null_buffer()
1137 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_write_null_buffer()
1138 ASSERT_OK(r); in fs_file_write_null_buffer()
1154 int r; in TEST_IMPL() local
1164 r = uv_fs_mkdir(loop, &mkdir_req, "test_dir", 0755, mkdir_cb); in TEST_IMPL()
1165 ASSERT_OK(r); in TEST_IMPL()
1171 r = uv_fs_open(NULL, &open_req1, "test_dir/file1", in TEST_IMPL()
1174 ASSERT_GE(r, 0); in TEST_IMPL()
1176 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
1177 ASSERT_OK(r); in TEST_IMPL()
1180 r = uv_fs_open(NULL, &open_req1, "test_dir/file2", in TEST_IMPL()
1183 ASSERT_GE(r, 0); in TEST_IMPL()
1185 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
1186 ASSERT_OK(r); in TEST_IMPL()
1189 r = uv_fs_scandir(loop, &scandir_req, "test_dir", 0, scandir_cb); in TEST_IMPL()
1190 ASSERT_OK(r); in TEST_IMPL()
1196 r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); in TEST_IMPL()
1197 ASSERT_EQ(2, r); in TEST_IMPL()
1207 r = uv_fs_stat(loop, &stat_req, "test_dir", stat_cb); in TEST_IMPL()
1208 ASSERT_OK(r); in TEST_IMPL()
1211 r = uv_fs_stat(loop, &stat_req, "test_dir/", stat_cb); in TEST_IMPL()
1212 ASSERT_OK(r); in TEST_IMPL()
1215 r = uv_fs_lstat(loop, &stat_req, "test_dir", stat_cb); in TEST_IMPL()
1216 ASSERT_OK(r); in TEST_IMPL()
1219 r = uv_fs_lstat(loop, &stat_req, "test_dir/", stat_cb); in TEST_IMPL()
1220 ASSERT_OK(r); in TEST_IMPL()
1225 r = uv_fs_unlink(loop, &unlink_req, "test_dir/file1", unlink_cb); in TEST_IMPL()
1226 ASSERT_OK(r); in TEST_IMPL()
1230 r = uv_fs_unlink(loop, &unlink_req, "test_dir/file2", unlink_cb); in TEST_IMPL()
1231 ASSERT_OK(r); in TEST_IMPL()
1235 r = uv_fs_rmdir(loop, &rmdir_req, "test_dir", rmdir_cb); in TEST_IMPL()
1236 ASSERT_OK(r); in TEST_IMPL()
1251 int f, r; in test_sendfile() local
1268 r = close(f); in test_sendfile()
1269 ASSERT_OK(r); in test_sendfile()
1272 r = uv_fs_open(NULL, &open_req1, "test_file", UV_FS_O_RDWR, 0, NULL); in test_sendfile()
1273 ASSERT_GE(r, 0); in test_sendfile()
1277 r = uv_fs_open(NULL, &open_req2, "test_file2", UV_FS_O_WRONLY | UV_FS_O_CREAT, in test_sendfile()
1279 ASSERT_GE(r, 0); in test_sendfile()
1283 r = uv_fs_sendfile(loop, &sendfile_req, open_req2.result, open_req1.result, in test_sendfile()
1285 ASSERT_OK(r); in test_sendfile()
1290 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in test_sendfile()
1291 ASSERT_OK(r); in test_sendfile()
1293 r = uv_fs_close(NULL, &close_req, open_req2.result, NULL); in test_sendfile()
1294 ASSERT_OK(r); in test_sendfile()
1305 r = uv_fs_open(NULL, &open_req1, "test_file2", UV_FS_O_RDWR, 0, NULL); in test_sendfile()
1306 ASSERT_GE(r, 0); in test_sendfile()
1312 r = uv_fs_read(NULL, &req, open_req1.result, &iov, 1, -1, NULL); in test_sendfile()
1313 ASSERT_GE(r, 0); in test_sendfile()
1348 int r; in TEST_IMPL() local
1353 r = uv_fs_mkdtemp(loop, &mkdtemp_req1, path_template, mkdtemp_cb); in TEST_IMPL()
1354 ASSERT_OK(r); in TEST_IMPL()
1360 r = uv_fs_mkdtemp(NULL, &mkdtemp_req2, path_template, NULL); in TEST_IMPL()
1361 ASSERT_OK(r); in TEST_IMPL()
1379 int r; in TEST_IMPL() local
1386 r = uv_fs_mkstemp(loop, &mkstemp_req1, path_template, mkstemp_cb); in TEST_IMPL()
1387 ASSERT_OK(r); in TEST_IMPL()
1393 r = uv_fs_mkstemp(NULL, &mkstemp_req2, path_template, NULL); in TEST_IMPL()
1394 ASSERT_GE(r, 0); in TEST_IMPL()
1410 r = uv_fs_write(NULL, &req, mkstemp_req1.result, &iov, 1, -1, NULL); in TEST_IMPL()
1411 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
1427 r = uv_fs_read(NULL, &req, fd, &iov, 1, -1, NULL); in TEST_IMPL()
1428 ASSERT_GE(r, 0); in TEST_IMPL()
1447 int r; in TEST_IMPL() local
1467 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1469 ASSERT_GE(r, 0); in TEST_IMPL()
1495 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1496 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
1501 r = uv_fs_fstat(NULL, &req, file, NULL); in TEST_IMPL()
1502 ASSERT_OK(r); in TEST_IMPL()
1508 r = fstat(file, &t); in TEST_IMPL()
1509 ASSERT_OK(r); in TEST_IMPL()
1585 r = uv_fs_fstat(loop, &req, file, fstat_cb); in TEST_IMPL()
1586 ASSERT_OK(r); in TEST_IMPL()
1591 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
1592 ASSERT_OK(r); in TEST_IMPL()
1650 int r; in TEST_IMPL() local
1661 r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); in TEST_IMPL()
1662 ASSERT_LT(r, 0); in TEST_IMPL()
1667 r = uv_fs_access(loop, &req, "test_file", F_OK, access_cb); in TEST_IMPL()
1668 ASSERT_OK(r); in TEST_IMPL()
1674 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1676 ASSERT_GE(r, 0); in TEST_IMPL()
1682 r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); in TEST_IMPL()
1683 ASSERT_OK(r); in TEST_IMPL()
1688 r = uv_fs_access(loop, &req, "test_file", F_OK, access_cb); in TEST_IMPL()
1689 ASSERT_OK(r); in TEST_IMPL()
1695 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
1696 ASSERT_OK(r); in TEST_IMPL()
1701 r = uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); in TEST_IMPL()
1702 ASSERT_OK(r); in TEST_IMPL()
1705 r = uv_fs_access(NULL, &req, "test_dir", W_OK, NULL); in TEST_IMPL()
1706 ASSERT_OK(r); in TEST_IMPL()
1726 int r; in TEST_IMPL() local
1735 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1737 ASSERT_GE(r, 0); in TEST_IMPL()
1743 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1744 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
1750 r = uv_fs_chmod(NULL, &req, "test_file", 0200, NULL); in TEST_IMPL()
1751 ASSERT_OK(r); in TEST_IMPL()
1759 r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); in TEST_IMPL()
1760 ASSERT_OK(r); in TEST_IMPL()
1767 r = uv_fs_fchmod(NULL, &req, file, 0600, NULL); in TEST_IMPL()
1768 ASSERT_OK(r); in TEST_IMPL()
1780 r = uv_fs_chmod(loop, &req, "test_file", 0200, chmod_cb); in TEST_IMPL()
1781 ASSERT_OK(r); in TEST_IMPL()
1792 r = uv_fs_chmod(loop, &req, "test_file", 0400, chmod_cb); in TEST_IMPL()
1793 ASSERT_OK(r); in TEST_IMPL()
1802 r = uv_fs_fchmod(loop, &req, file, 0600, fchmod_cb); in TEST_IMPL()
1803 ASSERT_OK(r); in TEST_IMPL()
1824 int r; in TEST_IMPL() local
1833 r = uv_fs_open(NULL, in TEST_IMPL()
1837 ASSERT_GE(r, 0); in TEST_IMPL()
1843 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1844 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
1851 r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); in TEST_IMPL()
1852 ASSERT_OK(r); in TEST_IMPL()
1859 r = uv_fs_unlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
1860 ASSERT_OK(r); in TEST_IMPL()
1881 int r; in TEST_IMPL() local
1890 r = uv_fs_open(NULL, in TEST_IMPL()
1894 ASSERT_GE(r, 0); in TEST_IMPL()
1900 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
1901 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
1908 r = SetFileAttributes("test_file", FILE_ATTRIBUTE_READONLY); in TEST_IMPL()
1909 ASSERT(r); in TEST_IMPL()
1915 r = uv_fs_unlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
1916 ASSERT_OK(r); in TEST_IMPL()
1937 int r; in TEST_IMPL() local
1947 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
1949 ASSERT_GE(r, 0); in TEST_IMPL()
1955 r = uv_fs_chown(NULL, &req, "test_file", -1, -1, NULL); in TEST_IMPL()
1956 ASSERT_OK(r); in TEST_IMPL()
1961 r = uv_fs_fchown(NULL, &req, file, -1, -1, NULL); in TEST_IMPL()
1962 ASSERT_OK(r); in TEST_IMPL()
1967 r = uv_fs_chown(loop, &req, "test_file", -1, -1, chown_cb); in TEST_IMPL()
1968 ASSERT_OK(r); in TEST_IMPL()
1975 r = uv_fs_chown(loop, &req, "test_file", 0, 0, chown_root_cb); in TEST_IMPL()
1976 ASSERT_OK(r); in TEST_IMPL()
1982 r = uv_fs_fchown(loop, &req, file, -1, -1, fchown_cb); in TEST_IMPL()
1983 ASSERT_OK(r); in TEST_IMPL()
1990 r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); in TEST_IMPL()
1991 ASSERT_OK(r); in TEST_IMPL()
1996 r = uv_fs_lchown(NULL, &req, "test_file_link", -1, -1, NULL); in TEST_IMPL()
1997 ASSERT_OK(r); in TEST_IMPL()
2002 r = uv_fs_lchown(loop, &req, "test_file_link", -1, -1, lchown_cb); in TEST_IMPL()
2003 ASSERT_OK(r); in TEST_IMPL()
2009 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
2010 ASSERT_OK(r); in TEST_IMPL()
2030 int r; in TEST_IMPL() local
2042 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2044 ASSERT_GE(r, 0); in TEST_IMPL()
2050 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
2051 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
2058 r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); in TEST_IMPL()
2059 ASSERT_OK(r); in TEST_IMPL()
2063 r = uv_fs_open(NULL, &req, "test_file_link", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2064 ASSERT_GE(r, 0); in TEST_IMPL()
2071 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2072 ASSERT_GE(r, 0); in TEST_IMPL()
2079 r = uv_fs_link(loop, &req, "test_file", "test_file_link2", link_cb); in TEST_IMPL()
2080 ASSERT_OK(r); in TEST_IMPL()
2084 r = uv_fs_open(NULL, &req, "test_file_link2", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2085 ASSERT_GE(r, 0); in TEST_IMPL()
2092 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2093 ASSERT_GE(r, 0); in TEST_IMPL()
2136 int r; in TEST_IMPL() local
2143 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2145 ASSERT_GE(r, 0); in TEST_IMPL()
2150 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
2151 ASSERT_OK(r); in TEST_IMPL()
2156 r = uv_fs_readlink(NULL, &req, "test_file", NULL); in TEST_IMPL()
2157 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
2191 int r; in TEST_IMPL() local
2215 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2217 ASSERT_GE(r, 0); in TEST_IMPL()
2223 r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); in TEST_IMPL()
2224 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
2231 r = uv_fs_symlink(NULL, &req, "test_file", "test_file_symlink", 0, NULL); in TEST_IMPL()
2233 if (r < 0) { in TEST_IMPL()
2234 if (r == UV_ENOTSUP) { in TEST_IMPL()
2240 } else if (r == UV_EPERM) { in TEST_IMPL()
2249 ASSERT_OK(r); in TEST_IMPL()
2253 r = uv_fs_open(NULL, &req, "test_file_symlink", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2254 ASSERT_GE(r, 0); in TEST_IMPL()
2261 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2262 ASSERT_GE(r, 0); in TEST_IMPL()
2268 r = uv_fs_symlink(NULL, in TEST_IMPL()
2274 ASSERT_OK(r); in TEST_IMPL()
2281 r = uv_fs_readlink(NULL, &req, "test_file_symlink_symlink", NULL); in TEST_IMPL()
2282 ASSERT_OK(r); in TEST_IMPL()
2286 r = uv_fs_realpath(NULL, &req, "test_file_symlink_symlink", NULL); in TEST_IMPL()
2287 ASSERT_OK(r); in TEST_IMPL()
2296 r = uv_fs_symlink(loop, in TEST_IMPL()
2302 ASSERT_OK(r); in TEST_IMPL()
2306 r = uv_fs_open(NULL, &req, "test_file_symlink2", UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
2307 ASSERT_GE(r, 0); in TEST_IMPL()
2314 r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); in TEST_IMPL()
2315 ASSERT_GE(r, 0); in TEST_IMPL()
2321 r = uv_fs_symlink(NULL, in TEST_IMPL()
2327 ASSERT_OK(r); in TEST_IMPL()
2330 r = uv_fs_readlink(loop, &req, "test_file_symlink2_symlink", readlink_cb); in TEST_IMPL()
2331 ASSERT_OK(r); in TEST_IMPL()
2335 r = uv_fs_realpath(loop, &req, "test_file", realpath_cb); in TEST_IMPL()
2336 ASSERT_OK(r); in TEST_IMPL()
2360 int r; in test_symlink_dir_impl() local
2392 r = uv_fs_symlink(NULL, &req, test_dir, "test_dir_symlink", type, NULL); in test_symlink_dir_impl()
2393 if (type == UV_FS_SYMLINK_DIR && (r == UV_ENOTSUP || r == UV_EPERM)) { in test_symlink_dir_impl()
2398 fprintf(stderr, "r == %i\n", r); in test_symlink_dir_impl()
2399 ASSERT_OK(r); in test_symlink_dir_impl()
2403 r = uv_fs_stat(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2404 ASSERT_OK(r); in test_symlink_dir_impl()
2408 r = uv_fs_lstat(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2409 ASSERT_OK(r); in test_symlink_dir_impl()
2426 r = uv_fs_readlink(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2427 ASSERT_OK(r); in test_symlink_dir_impl()
2435 r = uv_fs_realpath(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2436 ASSERT_OK(r); in test_symlink_dir_impl()
2445 r = uv_fs_open(NULL, &open_req1, "test_dir/file1", in test_symlink_dir_impl()
2448 ASSERT_GE(r, 0); in test_symlink_dir_impl()
2450 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in test_symlink_dir_impl()
2451 ASSERT_OK(r); in test_symlink_dir_impl()
2454 r = uv_fs_open(NULL, &open_req1, "test_dir/file2", in test_symlink_dir_impl()
2457 ASSERT_GE(r, 0); in test_symlink_dir_impl()
2459 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in test_symlink_dir_impl()
2460 ASSERT_OK(r); in test_symlink_dir_impl()
2463 r = uv_fs_scandir(NULL, &scandir_req, "test_dir_symlink", 0, NULL); in test_symlink_dir_impl()
2464 ASSERT_EQ(2, r); in test_symlink_dir_impl()
2475 r = uv_fs_unlink(NULL, &req, "test_dir_symlink", NULL); in test_symlink_dir_impl()
2476 ASSERT_OK(r); in test_symlink_dir_impl()
2479 r = uv_fs_scandir(NULL, &scandir_req, "test_dir_symlink", 0, NULL); in test_symlink_dir_impl()
2480 ASSERT_EQ(r, UV_ENOENT); in test_symlink_dir_impl()
2483 r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); in test_symlink_dir_impl()
2484 ASSERT_EQ(2, r); in test_symlink_dir_impl()
2515 int r; in TEST_IMPL() local
2545 r = DeviceIoControl(file_handle, in TEST_IMPL()
2553 ASSERT(r); in TEST_IMPL()
2557 r = uv_fs_readlink(NULL, &req, "test_dir/test_file", NULL); in TEST_IMPL()
2558 ASSERT(r == UV_EINVAL && GetLastError() == ERROR_SYMLINK_NOT_SUPPORTED); in TEST_IMPL()
2590 r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); in TEST_IMPL()
2591 ASSERT_EQ(1, r); in TEST_IMPL()
2619 int r; in TEST_IMPL() local
2627 r = uv_os_getenv("LOCALAPPDATA", localappdata, &len); in TEST_IMPL()
2628 if (r == UV_ENOENT) { in TEST_IMPL()
2632 ASSERT_OK(r); in TEST_IMPL()
2633 r = snprintf(windowsapps_path, in TEST_IMPL()
2637 ASSERT_GT(r, 0); in TEST_IMPL()
2672 int r; in TEST_IMPL() local
2677 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2680 ASSERT_GE(r, 0); 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()
2688 ASSERT_OK(r); in TEST_IMPL()
2701 r = uv_fs_utime(loop, &utime_req, path, atime, mtime, utime_cb); in TEST_IMPL()
2702 ASSERT_OK(r); in TEST_IMPL()
2719 int r; in TEST_IMPL() local
2723 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2726 ASSERT_GE(r, 0); 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()
2739 if (r != 0) { in TEST_IMPL()
2740 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
2744 ASSERT_OK(r); in TEST_IMPL()
2757 int r; in TEST_IMPL() local
2759 r = uv_fs_stat(NULL, &stat_req, "\\", NULL); in TEST_IMPL()
2760 ASSERT_OK(r); in TEST_IMPL()
2762 r = uv_fs_stat(NULL, &stat_req, "..\\..\\..\\..\\..\\..\\..", NULL); in TEST_IMPL()
2763 ASSERT_OK(r); in TEST_IMPL()
2765 r = uv_fs_stat(NULL, &stat_req, "..", NULL); in TEST_IMPL()
2766 ASSERT_OK(r); in TEST_IMPL()
2768 r = uv_fs_stat(NULL, &stat_req, "..\\", NULL); in TEST_IMPL()
2769 ASSERT_OK(r); in TEST_IMPL()
2772 r = uv_fs_stat(NULL, &stat_req, "c:", NULL); in TEST_IMPL()
2773 ASSERT_OK(r); in TEST_IMPL()
2775 r = uv_fs_stat(NULL, &stat_req, "c:\\", NULL); in TEST_IMPL()
2776 ASSERT_OK(r); in TEST_IMPL()
2778 r = uv_fs_stat(NULL, &stat_req, "\\\\?\\C:\\", NULL); in TEST_IMPL()
2779 ASSERT_OK(r); in TEST_IMPL()
2794 int r; in TEST_IMPL() local
2802 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2805 ASSERT_GE(r, 0); 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()
2813 ASSERT_GE(r, 0); in TEST_IMPL()
2818 r = uv_fs_futime(NULL, &req, file, atime, mtime, NULL); in TEST_IMPL()
2820 ASSERT_EQ(r, UV_ENOSYS); in TEST_IMPL()
2823 ASSERT_OK(r); in TEST_IMPL()
2838 r = uv_fs_futime(loop, &futime_req, file, atime, mtime, futime_cb); in TEST_IMPL()
2839 ASSERT_OK(r); in TEST_IMPL()
2858 int r, s; in TEST_IMPL() local
2864 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, in TEST_IMPL()
2867 ASSERT_GE(r, 0); in TEST_IMPL()
2870 uv_fs_close(loop, &req, r, NULL); in TEST_IMPL()
2896 r = uv_fs_lutime(NULL, &req, symlink_path, atime, mtime, NULL); in TEST_IMPL()
2899 ASSERT_EQ(r, UV_ENOSYS); in TEST_IMPL()
2902 ASSERT_OK(r); in TEST_IMPL()
2913 r = uv_fs_lutime(loop, &req, symlink_path, atime, mtime, lutime_cb); in TEST_IMPL()
2914 ASSERT_OK(r); in TEST_IMPL()
2929 int r; in TEST_IMPL() local
2933 r = uv_fs_stat(NULL, &req, "non_existent_file", NULL); in TEST_IMPL()
2934 ASSERT_EQ(r, UV_ENOENT); in TEST_IMPL()
2947 int r; in TEST_IMPL() local
2958 r = uv_fs_scandir(NULL, &req, path, 0, NULL); in TEST_IMPL()
2959 ASSERT_OK(r); in TEST_IMPL()
2965 r = uv_fs_scandir(loop, &scandir_req, path, 0, empty_scandir_cb); in TEST_IMPL()
2966 ASSERT_OK(r); in TEST_IMPL()
2984 int r; in TEST_IMPL() local
2995 r = uv_fs_scandir(NULL, &req, path, 0, NULL); in TEST_IMPL()
2996 ASSERT_EQ(r, UV_ENOENT); in TEST_IMPL()
3002 r = uv_fs_scandir(loop, &scandir_req, path, 0, non_existent_scandir_cb); in TEST_IMPL()
3003 ASSERT_OK(r); in TEST_IMPL()
3015 int r; in TEST_IMPL() local
3020 r = uv_fs_scandir(NULL, &scandir_req, path, 0, NULL); in TEST_IMPL()
3021 ASSERT_EQ(r, UV_ENOTDIR); in TEST_IMPL()
3024 r = uv_fs_scandir(loop, &scandir_req, path, 0, file_scandir_cb); in TEST_IMPL()
3025 ASSERT_OK(r); in TEST_IMPL()
3057 int r, file; in TEST_IMPL() local
3062 r = uv_fs_open(NULL, &req, path, UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
3063 ASSERT_GE(r, 0); in TEST_IMPL()
3066 file = r; in TEST_IMPL()
3069 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
3070 ASSERT_OK(r); in TEST_IMPL()
3072 r = uv_fs_open(loop, &req, path, UV_FS_O_RDONLY, 0, open_cb_simple); in TEST_IMPL()
3073 ASSERT_OK(r); in TEST_IMPL()
3085 int r; in fs_file_open_append() local
3092 r = uv_fs_open(NULL, &open_req1, "test_file", in fs_file_open_append()
3095 ASSERT_GE(r, 0); in fs_file_open_append()
3100 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_open_append()
3101 ASSERT_GE(r, 0); in fs_file_open_append()
3105 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_open_append()
3106 ASSERT_OK(r); in fs_file_open_append()
3110 r = uv_fs_open(NULL, &open_req1, "test_file", in fs_file_open_append()
3112 ASSERT_GE(r, 0); in fs_file_open_append()
3117 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_open_append()
3118 ASSERT_GE(r, 0); in fs_file_open_append()
3122 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_open_append()
3123 ASSERT_OK(r); in fs_file_open_append()
3127 r = uv_fs_open(NULL, &open_req1, "test_file", UV_FS_O_RDONLY | add_flags, in fs_file_open_append()
3129 ASSERT_GE(r, 0); in fs_file_open_append()
3134 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_open_append()
3135 printf("read = %d\n", r); in fs_file_open_append()
3136 ASSERT_EQ(26, r); in fs_file_open_append()
3143 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_open_append()
3144 ASSERT_OK(r); in fs_file_open_append()
3161 int r; in TEST_IMPL() local
3169 r = uv_fs_open(NULL, &open_req1, "test_file", UV_FS_O_WRONLY | UV_FS_O_CREAT, in TEST_IMPL()
3171 ASSERT_GE(r, 0); in TEST_IMPL()
3176 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in TEST_IMPL()
3177 ASSERT_GE(r, 0); in TEST_IMPL()
3181 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
3182 ASSERT_OK(r); in TEST_IMPL()
3186 r = uv_fs_open(NULL, &open_req1, "test_file2", UV_FS_O_WRONLY | UV_FS_O_CREAT, in TEST_IMPL()
3188 ASSERT_GE(r, 0); in TEST_IMPL()
3192 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
3193 ASSERT_OK(r); in TEST_IMPL()
3197 r = uv_fs_rename(NULL, &rename_req, "test_file", "test_file2", NULL); in TEST_IMPL()
3198 ASSERT_OK(r); in TEST_IMPL()
3202 r = uv_fs_open(NULL, &open_req1, "test_file2", UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
3203 ASSERT_GE(r, 0); in TEST_IMPL()
3209 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in TEST_IMPL()
3210 ASSERT_GE(r, 0); in TEST_IMPL()
3215 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
3216 ASSERT_OK(r); in TEST_IMPL()
3291 int r; in fs_read_file_eof() local
3298 r = uv_fs_open(NULL, &open_req1, "test_file", in fs_read_file_eof()
3301 ASSERT_GE(r, 0); in fs_read_file_eof()
3306 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in fs_read_file_eof()
3307 ASSERT_GE(r, 0); in fs_read_file_eof()
3311 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_read_file_eof()
3312 ASSERT_OK(r); in fs_read_file_eof()
3316 r = uv_fs_open(NULL, &open_req1, "test_file", UV_FS_O_RDONLY | add_flags, 0, in fs_read_file_eof()
3318 ASSERT_GE(r, 0); in fs_read_file_eof()
3324 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_read_file_eof()
3325 ASSERT_GE(r, 0); in fs_read_file_eof()
3331 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, in fs_read_file_eof()
3333 ASSERT_OK(r); in fs_read_file_eof()
3337 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_read_file_eof()
3338 ASSERT_OK(r); in fs_read_file_eof()
3356 int r; in fs_write_multiple_bufs() local
3363 r = uv_fs_open(NULL, &open_req1, "test_file", in fs_write_multiple_bufs()
3366 ASSERT_GE(r, 0); in fs_write_multiple_bufs()
3372 r = uv_fs_write(NULL, &write_req, open_req1.result, iovs, 2, 0, NULL); in fs_write_multiple_bufs()
3373 ASSERT_GE(r, 0); in fs_write_multiple_bufs()
3377 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_write_multiple_bufs()
3378 ASSERT_OK(r); in fs_write_multiple_bufs()
3382 r = uv_fs_open(NULL, &open_req1, "test_file", UV_FS_O_RDONLY | add_flags, 0, in fs_write_multiple_bufs()
3384 ASSERT_GE(r, 0); in fs_write_multiple_bufs()
3394 r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, 2, -1, NULL); in fs_write_multiple_bufs()
3395 ASSERT_GE(r, 0); in fs_write_multiple_bufs()
3402 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_write_multiple_bufs()
3403 ASSERT_OK(r); in fs_write_multiple_bufs()
3410 r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, 2, 0, NULL); in fs_write_multiple_bufs()
3411 ASSERT_GE(r, 0); in fs_write_multiple_bufs()
3415 r = uv_fs_read(NULL, &read_req, open_req1.result, &iovs[1], 1, read_req.result, NULL); in fs_write_multiple_bufs()
3416 ASSERT_GE(r, 0); in fs_write_multiple_bufs()
3426 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, in fs_write_multiple_bufs()
3428 ASSERT_OK(r); in fs_write_multiple_bufs()
3432 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_write_multiple_bufs()
3433 ASSERT_OK(r); in fs_write_multiple_bufs()
3455 int r; in fs_write_alotof_bufs() local
3468 r = uv_fs_open(NULL, in fs_write_alotof_bufs()
3474 ASSERT_GE(r, 0); in fs_write_alotof_bufs()
3481 r = uv_fs_write(NULL, in fs_write_alotof_bufs()
3488 ASSERT_GE(r, 0); in fs_write_alotof_bufs()
3500 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_write_alotof_bufs()
3501 ASSERT_OK(r); in fs_write_alotof_bufs()
3505 r = uv_fs_open(NULL, &open_req1, "test_file", UV_FS_O_RDONLY | add_flags, 0, in fs_write_alotof_bufs()
3507 ASSERT_GE(r, 0); in fs_write_alotof_bufs()
3511 r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, iovcount, -1, NULL); in fs_write_alotof_bufs()
3514 ASSERT_GE(r, 0); in fs_write_alotof_bufs()
3528 r = uv_fs_read(NULL, in fs_write_alotof_bufs()
3535 ASSERT_OK(r); in fs_write_alotof_bufs()
3539 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_write_alotof_bufs()
3540 ASSERT_OK(r); in fs_write_alotof_bufs()
3563 int r; in fs_write_alotof_bufs_with_offset() local
3581 r = uv_fs_open(NULL, in fs_write_alotof_bufs_with_offset()
3587 ASSERT_GE(r, 0); in fs_write_alotof_bufs_with_offset()
3592 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in fs_write_alotof_bufs_with_offset()
3593 ASSERT_EQ(r, filler_len); in fs_write_alotof_bufs_with_offset()
3596 offset = (int64_t)r; in fs_write_alotof_bufs_with_offset()
3601 r = uv_fs_write(NULL, in fs_write_alotof_bufs_with_offset()
3608 ASSERT_GE(r, 0); in fs_write_alotof_bufs_with_offset()
3620 r = uv_fs_read(NULL, &read_req, open_req1.result, in fs_write_alotof_bufs_with_offset()
3622 ASSERT_GE(r, 0); in fs_write_alotof_bufs_with_offset()
3623 if (r == sizeof(test_buf)) in fs_write_alotof_bufs_with_offset()
3637 r = uv_fs_stat(NULL, &stat_req, "test_file", NULL); in fs_write_alotof_bufs_with_offset()
3638 ASSERT_OK(r); in fs_write_alotof_bufs_with_offset()
3644 r = uv_fs_read(NULL, in fs_write_alotof_bufs_with_offset()
3651 ASSERT_OK(r); in fs_write_alotof_bufs_with_offset()
3655 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_write_alotof_bufs_with_offset()
3656 ASSERT_OK(r); in fs_write_alotof_bufs_with_offset()
3673 int r; in TEST_IMPL() local
3679 r = uv_fs_mkdir(loop, &mkdir_req, "test_dir", 0755, mkdir_cb); in TEST_IMPL()
3680 ASSERT_OK(r); in TEST_IMPL()
3686 r = uv_fs_open(loop, in TEST_IMPL()
3692 ASSERT_GE(r, 0); in TEST_IMPL()
3697 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, 0, NULL); in TEST_IMPL()
3710 ASSERT((r >= 0) || (r == UV_EISDIR)); in TEST_IMPL()
3712 ASSERT_EQ(r, UV_EISDIR); in TEST_IMPL()
3716 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
3717 ASSERT_OK(r); in TEST_IMPL()
3898 int r; in TEST_IMPL() local
3900 r = uv_fs_read(NULL, &read_req, 0, NULL, 0, -1, NULL); in TEST_IMPL()
3901 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
3904 r = uv_fs_write(NULL, &write_req, 0, NULL, 0, -1, NULL); in TEST_IMPL()
3907 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
3921 r = uv_fs_read(NULL, &read_req, 0, &iov, 0, -1, NULL); in TEST_IMPL()
3922 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
3926 r = uv_fs_write(NULL, &write_req, 0, &iov, 0, -1, NULL); in TEST_IMPL()
3927 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
3933 r = uv_fs_read(loop, &read_req, 0, NULL, 0, -1, fail_cb); in TEST_IMPL()
3934 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
3938 r = uv_fs_write(loop, &write_req, 0, NULL, 0, -1, fail_cb); in TEST_IMPL()
3939 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
3944 r = uv_fs_read(loop, &read_req, 0, &iov, 0, -1, fail_cb); in TEST_IMPL()
3945 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
3950 r = uv_fs_write(loop, &write_req, 0, &iov, 0, -1, fail_cb); in TEST_IMPL()
3951 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
3961 int r; in TEST_IMPL() local
3969 r = uv_fs_open(NULL, in TEST_IMPL()
3973 ASSERT_GE(r, 0); in TEST_IMPL()
3984 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
3985 ASSERT_OK(r); in TEST_IMPL()
3997 int r; in TEST_IMPL() local
4006 r = uv_fs_open(NULL, in TEST_IMPL()
4012 ASSERT_GE(r, 0); in TEST_IMPL()
4030 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
4031 ASSERT_OK(r); in TEST_IMPL()
4043 int r; in TEST_IMPL() local
4049 r = uv_fs_open(loop, in TEST_IMPL()
4053 ASSERT_GT(r, 0); in TEST_IMPL()
4057 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, 0, NULL); in TEST_IMPL()
4058 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
4063 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, 0, NULL); in TEST_IMPL()
4064 ASSERT_EQ(r, sizeof(test_buf)); in TEST_IMPL()
4069 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
4070 ASSERT_OK(r); in TEST_IMPL()
4082 int r; in fs_file_pos_common() local
4085 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_pos_common()
4086 ASSERT_EQ(3, r); in fs_file_pos_common()
4091 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, 1, NULL); in fs_file_pos_common()
4092 ASSERT_EQ(1, r); in fs_file_pos_common()
4097 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_pos_common()
4098 ASSERT_OK(r); in fs_file_pos_common()
4103 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_pos_common()
4104 ASSERT_EQ(1, r); in fs_file_pos_common()
4108 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_pos_common()
4109 ASSERT_OK(r); in fs_file_pos_common()
4114 int r; in fs_file_pos_close_check() local
4117 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_pos_close_check()
4118 ASSERT_OK(r); in fs_file_pos_close_check()
4122 r = uv_fs_open(NULL, &open_req1, "test_file", UV_FS_O_RDONLY, 0, NULL); in fs_file_pos_close_check()
4123 ASSERT_GE(r, 0); in fs_file_pos_close_check()
4128 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_pos_close_check()
4129 ASSERT_EQ(r, size); in fs_file_pos_close_check()
4133 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in fs_file_pos_close_check()
4134 ASSERT_OK(r); in fs_file_pos_close_check()
4142 int r; in fs_file_pos_write() local
4147 r = uv_fs_open(NULL, in fs_file_pos_write()
4153 ASSERT_GT(r, 0); in fs_file_pos_write()
4160 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, 1, NULL); in fs_file_pos_write()
4161 ASSERT_EQ(1, r); in fs_file_pos_write()
4165 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_pos_write()
4166 ASSERT_OK(r); in fs_file_pos_write()
4180 int r; in fs_file_pos_append() local
4185 r = uv_fs_open(NULL, in fs_file_pos_append()
4191 ASSERT_GT(r, 0); in fs_file_pos_append()
4199 r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, 1, NULL); in fs_file_pos_append()
4200 ASSERT_EQ(1, r); in fs_file_pos_append()
4204 r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); in fs_file_pos_append()
4205 ASSERT_EQ(1, r); in fs_file_pos_append()
4222 int r; in TEST_IMPL() local
4224 r = uv_fs_open(NULL, NULL, NULL, 0, 0, NULL); in TEST_IMPL()
4225 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4227 r = uv_fs_close(NULL, NULL, 0, NULL); in TEST_IMPL()
4228 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4230 r = uv_fs_read(NULL, NULL, 0, NULL, 0, -1, NULL); in TEST_IMPL()
4231 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4233 r = uv_fs_write(NULL, NULL, 0, NULL, 0, -1, NULL); in TEST_IMPL()
4234 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4236 r = uv_fs_unlink(NULL, NULL, NULL, NULL); in TEST_IMPL()
4237 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4239 r = uv_fs_mkdir(NULL, NULL, NULL, 0, NULL); in TEST_IMPL()
4240 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4242 r = uv_fs_mkdtemp(NULL, NULL, NULL, NULL); in TEST_IMPL()
4243 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4245 r = uv_fs_mkstemp(NULL, NULL, NULL, NULL); in TEST_IMPL()
4246 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4248 r = uv_fs_rmdir(NULL, NULL, NULL, NULL); in TEST_IMPL()
4249 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4251 r = uv_fs_scandir(NULL, NULL, NULL, 0, NULL); in TEST_IMPL()
4252 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4254 r = uv_fs_link(NULL, NULL, NULL, NULL, NULL); in TEST_IMPL()
4255 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4257 r = uv_fs_symlink(NULL, NULL, NULL, NULL, 0, NULL); in TEST_IMPL()
4258 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4260 r = uv_fs_readlink(NULL, NULL, NULL, NULL); in TEST_IMPL()
4261 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4263 r = uv_fs_realpath(NULL, NULL, NULL, NULL); in TEST_IMPL()
4264 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4266 r = uv_fs_chown(NULL, NULL, NULL, 0, 0, NULL); in TEST_IMPL()
4267 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4269 r = uv_fs_fchown(NULL, NULL, 0, 0, 0, NULL); in TEST_IMPL()
4270 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4272 r = uv_fs_stat(NULL, NULL, NULL, NULL); in TEST_IMPL()
4273 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4275 r = uv_fs_lstat(NULL, NULL, NULL, NULL); in TEST_IMPL()
4276 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4278 r = uv_fs_fstat(NULL, NULL, 0, NULL); in TEST_IMPL()
4279 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4281 r = uv_fs_rename(NULL, NULL, NULL, NULL, NULL); in TEST_IMPL()
4282 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4284 r = uv_fs_fsync(NULL, NULL, 0, NULL); in TEST_IMPL()
4285 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4287 r = uv_fs_fdatasync(NULL, NULL, 0, NULL); in TEST_IMPL()
4288 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4290 r = uv_fs_ftruncate(NULL, NULL, 0, 0, NULL); in TEST_IMPL()
4291 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4293 r = uv_fs_copyfile(NULL, NULL, NULL, NULL, 0, NULL); in TEST_IMPL()
4294 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4296 r = uv_fs_sendfile(NULL, NULL, 0, 0, 0, 0, NULL); in TEST_IMPL()
4297 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4299 r = uv_fs_access(NULL, NULL, NULL, 0, NULL); in TEST_IMPL()
4300 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4302 r = uv_fs_chmod(NULL, NULL, NULL, 0, NULL); in TEST_IMPL()
4303 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4305 r = uv_fs_fchmod(NULL, NULL, 0, 0, NULL); in TEST_IMPL()
4306 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4308 r = uv_fs_utime(NULL, NULL, NULL, 0.0, 0.0, NULL); in TEST_IMPL()
4309 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4311 r = uv_fs_futime(NULL, NULL, 0, 0.0, 0.0, NULL); in TEST_IMPL()
4312 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4314 r = uv_fs_statfs(NULL, NULL, NULL, NULL); in TEST_IMPL()
4315 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4325 int r; in TEST_IMPL() local
4332 r = uv_fs_open(NULL, in TEST_IMPL()
4338 ASSERT_GE(r, 0); in TEST_IMPL()
4342 r = uv_fs_open(NULL, in TEST_IMPL()
4347 ASSERT_LT(r, 0); in TEST_IMPL()
4351 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
4352 ASSERT_OK(r); in TEST_IMPL()
4356 r = uv_fs_open(NULL, in TEST_IMPL()
4361 ASSERT_GE(r, 0); in TEST_IMPL()
4365 r = uv_fs_close(NULL, &close_req, open_req2.result, NULL); in TEST_IMPL()
4366 ASSERT_OK(r); in TEST_IMPL()
4380 int r; in TEST_IMPL() local
4391 r = uv_fs_open(NULL, in TEST_IMPL()
4397 ASSERT_GE(r, 0); in TEST_IMPL()
4401 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
4402 ASSERT_OK(r); in TEST_IMPL()
4407 r = uv_fs_open(NULL, in TEST_IMPL()
4413 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4439 int r; in TEST_IMPL() local
4454 r = uv_os_get_passwd(&pwd); in TEST_IMPL()
4455 ASSERT_OK(r); in TEST_IMPL()
4462 r = uv_fs_open(loop, in TEST_IMPL()
4468 ASSERT_GE(r, 0); in TEST_IMPL()
4471 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
4472 ASSERT_OK(r); in TEST_IMPL()
4477 r = call_icacls("icacls test_file_icacls /inheritance:r /remove \"%s\"", in TEST_IMPL()
4479 if (r != 0) { in TEST_IMPL()
4482 r = call_icacls("icacls test_file_icacls /grant \"%s\":RX", pwd.username); in TEST_IMPL()
4483 if (r != 0) { in TEST_IMPL()
4488 r = uv_fs_open(NULL, &open_req1, "test_file_icacls", UV_FS_O_RDONLY, 0, in TEST_IMPL()
4490 if (r < 0) { in TEST_IMPL()
4494 r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); in TEST_IMPL()
4495 if (r != 0) { in TEST_IMPL()
4506 ASSERT_OK(r); in TEST_IMPL()
4516 int r; in TEST_IMPL() local
4521 r = uv_fs_open(NULL, in TEST_IMPL()
4525 ASSERT_GE(r, 0); in TEST_IMPL()
4529 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
4530 ASSERT_OK(r); in TEST_IMPL()
4533 r = SetFileAttributes("test_file", FILE_ATTRIBUTE_READONLY); in TEST_IMPL()
4534 ASSERT(r); in TEST_IMPL()
4537 r = uv_fs_open(NULL, &req, "test_file", UV_FS_O_RDONLY, 0, NULL); in TEST_IMPL()
4538 ASSERT_GE(r, 0); in TEST_IMPL()
4542 r = uv_fs_fchmod(NULL, &req, file, S_IWUSR, NULL); in TEST_IMPL()
4543 ASSERT_OK(r); in TEST_IMPL()
4546 r = uv_fs_close(NULL, &req, file, NULL); in TEST_IMPL()
4547 ASSERT_OK(r); in TEST_IMPL()
4552 r = SetFileAttributes("test_file", FILE_ATTRIBUTE_ARCHIVE); in TEST_IMPL()
4553 ASSERT(r); in TEST_IMPL()
4561 int r; in TEST_IMPL() local
4564 r = uv_fs_mkdir(loop, &req, "invalid>", 0, NULL); in TEST_IMPL()
4565 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
4574 int r; in TEST_IMPL() local
4579 r = uv_fs_statfs(NULL, &req, ".", NULL); in TEST_IMPL()
4580 ASSERT_OK(r); in TEST_IMPL()
4585 r = uv_fs_statfs(loop, &req, ".", statfs_cb); in TEST_IMPL()
4586 ASSERT_OK(r); in TEST_IMPL()
4596 int r; in TEST_IMPL() local
4599 r = uv_fs_statfs(NULL, &req, "non_existing_file", NULL); in TEST_IMPL()
4600 ASSERT(r); in TEST_IMPL()
4615 int r; in TEST_IMPL() local
4620 r = uv_fs_mkdir(NULL, &mkdir_req, "test_dir", 0755, NULL); in TEST_IMPL()
4621 ASSERT_OK(r); in TEST_IMPL()
4626 r = uv_fs_stat(loop, &req[i], "test_dir", stat_batch_cb); in TEST_IMPL()
4627 ASSERT_OK(r); in TEST_IMPL()
4640 int r; in TEST_IMPL() local
4651 r = uv_fs_mkdir(NULL, &mkdir_req, "test_dir", 0777, NULL); in TEST_IMPL()
4652 ASSERT_OK(r); in TEST_IMPL()
4667 r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); in TEST_IMPL()
4668 ASSERT_EQ(1, r); in TEST_IMPL()
4674 r = uv_fs_stat(NULL, &stat_req, test_file_buf, NULL); in TEST_IMPL()
4675 ASSERT_OK(r); in TEST_IMPL()