fix fs_utime & fs_futime tests on windows
This commit is contained in:
parent
f60cf1d233
commit
0364809fb5
@ -1163,13 +1163,21 @@ TEST_IMPL(fs_symlink) {
|
||||
|
||||
TEST_IMPL(fs_utime) {
|
||||
utime_check_t checkme;
|
||||
const char* path = ".";
|
||||
const char* path = "test_file";
|
||||
double atime;
|
||||
double mtime;
|
||||
uv_fs_t req;
|
||||
int r;
|
||||
|
||||
/* Setup. */
|
||||
loop = uv_default_loop();
|
||||
unlink(path);
|
||||
r = uv_fs_open(loop, &req, path, O_RDWR | O_CREAT,
|
||||
S_IWRITE | S_IREAD, NULL);
|
||||
ASSERT(r != -1);
|
||||
ASSERT(req.result != -1);
|
||||
uv_fs_req_cleanup(&req);
|
||||
close(r);
|
||||
|
||||
atime = mtime = 400497753; /* 1982-09-10 11:22:33 */
|
||||
|
||||
@ -1196,24 +1204,35 @@ TEST_IMPL(fs_utime) {
|
||||
uv_run(loop);
|
||||
ASSERT(utime_cb_count == 1);
|
||||
|
||||
/* Cleanup. */
|
||||
unlink(path);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
TEST_IMPL(fs_futime) {
|
||||
utime_check_t checkme;
|
||||
const char* path = ".";
|
||||
const char* path = "test_file";
|
||||
double atime;
|
||||
double mtime;
|
||||
uv_file file;
|
||||
uv_fs_t req;
|
||||
int r;
|
||||
|
||||
/* Setup. */
|
||||
loop = uv_default_loop();
|
||||
unlink(path);
|
||||
r = uv_fs_open(loop, &req, path, O_RDWR | O_CREAT,
|
||||
S_IWRITE | S_IREAD, NULL);
|
||||
ASSERT(r != -1);
|
||||
ASSERT(req.result != -1);
|
||||
uv_fs_req_cleanup(&req);
|
||||
close(r);
|
||||
|
||||
atime = mtime = 400497753; /* 1982-09-10 11:22:33 */
|
||||
|
||||
r = uv_fs_open(loop, &req, path, O_RDONLY, 0, NULL);
|
||||
r = uv_fs_open(loop, &req, path, O_RDWR, 0, NULL);
|
||||
ASSERT(r != -1);
|
||||
ASSERT(req.result != -1);
|
||||
file = req.result; /* FIXME probably not how it's supposed to be used */
|
||||
@ -1243,6 +1262,9 @@ TEST_IMPL(fs_futime) {
|
||||
uv_run(loop);
|
||||
ASSERT(futime_cb_count == 1);
|
||||
|
||||
/* Cleanup. */
|
||||
unlink(path);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user