Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
fix fs_utime & fs_futime tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Zinkovsky committed Oct 6, 2011
1 parent f60cf1d commit 0364809
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions test/test-fs.c
Expand Up @@ -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 */

Expand All @@ -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 */
Expand Down Expand Up @@ -1243,6 +1262,9 @@ TEST_IMPL(fs_futime) {
uv_run(loop);
ASSERT(futime_cb_count == 1);

/* Cleanup. */
unlink(path);

return 0;
}

Expand Down

0 comments on commit 0364809

Please sign in to comment.