Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix fs_utime & fs_futime tests on windows

  • Loading branch information...
Igor Zinkovsky
Igor Zinkovsky committed Oct 6, 2011
1 parent f60cf1d commit 0364809fb5a321db1dd09aa8deb29fef2ae8bbe5
Showing with 25 additions and 3 deletions.
  1. +25 −3 test/test-fs.c
@@ -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;
}

0 comments on commit 0364809

Please sign in to comment.
You can’t perform that action at this time.