From 7dc0ef6ccb70830584f8182497f28d3b1819d3ab Mon Sep 17 00:00:00 2001 From: Alan Kligman Date: Fri, 20 Dec 2013 00:45:11 -0500 Subject: [PATCH] remove comments; clarify test message --- src/fs.js | 7 ++----- tests/spec/fs.utimes.spec.js | 18 +++++++++--------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/fs.js b/src/fs.js index a6060b7..dfb4ac6 100644 --- a/src/fs.js +++ b/src/fs.js @@ -1037,7 +1037,6 @@ define(function(require) { path = normalize(path); function update_times (error, node) { - //Note: Going by node.js' implementation, utimes works on directories if (error) { callback(error); } @@ -1048,7 +1047,6 @@ define(function(require) { } } - //check if atime and mtime are integers and >= 0 if (typeof atime != 'number' || typeof mtime != 'number') { callback(new EInvalid('atime and mtime must be number')); } @@ -1073,7 +1071,6 @@ define(function(require) { } } - //check if atime and mtime are integers and >= 0 if (typeof atime != 'number' || typeof mtime != 'number') { callback(new EInvalid('atime and mtime must be a number')); } @@ -1585,7 +1582,7 @@ define(function(require) { else { callback(null); } - } + } utimes_file(context, path, atime, mtime, check_result) } @@ -1611,7 +1608,7 @@ define(function(require) { callback(new EBadFileDescriptor('descriptor does not permit writing')); } else { futimes_file(context, ofd, atime, mtime, check_result); - } + } } function _rename(context, oldpath, newpath, callback) { diff --git a/tests/spec/fs.utimes.spec.js b/tests/spec/fs.utimes.spec.js index ed3cd9b..6e085e0 100644 --- a/tests/spec/fs.utimes.spec.js +++ b/tests/spec/fs.utimes.spec.js @@ -32,7 +32,7 @@ define(["IDBFS"], function(IDBFS) { }); }); - waitsFor(function () { + waitsFor(function () { return complete; }, 'test to complete', DEFAULT_TIMEOUT); @@ -56,7 +56,7 @@ define(["IDBFS"], function(IDBFS) { }); }); - waitsFor(function () { + waitsFor(function () { return complete; }, 'test to complete', DEFAULT_TIMEOUT); @@ -80,7 +80,7 @@ define(["IDBFS"], function(IDBFS) { }); }); - waitsFor(function () { + waitsFor(function () { return complete; }, 'test to complete', DEFAULT_TIMEOUT); @@ -97,7 +97,7 @@ define(["IDBFS"], function(IDBFS) { var atime = Date.parse('1 Oct 2000 15:33:22'); var mtime = Date.parse('30 Sep 2000 06:43:54'); - + that.fs.utimes('/pathdoesnotexist', atime, mtime, function (error) { _error = error; complete = true; @@ -127,7 +127,7 @@ define(["IDBFS"], function(IDBFS) { }); }); - waitsFor(function () { + waitsFor(function () { return complete; }, 'test to complete', DEFAULT_TIMEOUT); @@ -214,13 +214,13 @@ define(["IDBFS"], function(IDBFS) { that.fs.futimes(ofd, atime, mtime, function (error) { _error = error; - + that.fs.fstat(ofd, function (error, stat) { if (error) throw error; _stat = stat; complete = true; - }); + }); }); }); @@ -274,7 +274,7 @@ define(["IDBFS"], function(IDBFS) { }); }); - it ('should update atime and mtime if they are null', function () { + it ('should update atime and mtime using current time if arguments are null', function () { var complete = false; var _error; var that = this; @@ -293,7 +293,7 @@ define(["IDBFS"], function(IDBFS) { that.fs.stat('/myfile', function (error, stat) { if (error) throw error; - + atimeEst = now - stat.atime; mtimeEst = now - stat.mtime; complete = true;