From abc4f56ff02a33ac318bcef4281c64b3167db1de Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 9 Mar 2012 04:32:24 +0100 Subject: [PATCH] Test chown_root: make it pass on windows --- test/test-fs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test-fs.c b/test/test-fs.c index 6d63ba97..8dc71473 100644 --- a/test/test-fs.c +++ b/test/test-fs.c @@ -186,8 +186,14 @@ static void chown_cb(uv_fs_t* req) { static void chown_root_cb(uv_fs_t* req) { ASSERT(req->fs_type == UV_FS_CHOWN); +#ifdef _WIN32 + /* On windows, chown is a no-op and always succeeds. */ + ASSERT(req->result == 0); +#else + /* On unix, chown'ing the root directory is not allowed. */ ASSERT(req->result == -1); ASSERT(req->errorno == UV_EPERM); +#endif chown_cb_count++; uv_fs_req_cleanup(req); }