remove comments; clarify test message
This commit is contained in:
parent
53e6293494
commit
7dc0ef6ccb
|
@ -1037,7 +1037,6 @@ define(function(require) {
|
||||||
path = normalize(path);
|
path = normalize(path);
|
||||||
|
|
||||||
function update_times (error, node) {
|
function update_times (error, node) {
|
||||||
//Note: Going by node.js' implementation, utimes works on directories
|
|
||||||
if (error) {
|
if (error) {
|
||||||
callback(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') {
|
if (typeof atime != 'number' || typeof mtime != 'number') {
|
||||||
callback(new EInvalid('atime and mtime must be 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') {
|
if (typeof atime != 'number' || typeof mtime != 'number') {
|
||||||
callback(new EInvalid('atime and mtime must be a number'));
|
callback(new EInvalid('atime and mtime must be a number'));
|
||||||
}
|
}
|
||||||
|
@ -1585,7 +1582,7 @@ define(function(require) {
|
||||||
else {
|
else {
|
||||||
callback(null);
|
callback(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
utimes_file(context, path, atime, mtime, check_result)
|
utimes_file(context, path, atime, mtime, check_result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1611,7 +1608,7 @@ define(function(require) {
|
||||||
callback(new EBadFileDescriptor('descriptor does not permit writing'));
|
callback(new EBadFileDescriptor('descriptor does not permit writing'));
|
||||||
} else {
|
} else {
|
||||||
futimes_file(context, ofd, atime, mtime, check_result);
|
futimes_file(context, ofd, atime, mtime, check_result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _rename(context, oldpath, newpath, callback) {
|
function _rename(context, oldpath, newpath, callback) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
waitsFor(function () {
|
waitsFor(function () {
|
||||||
return complete;
|
return complete;
|
||||||
}, 'test to complete', DEFAULT_TIMEOUT);
|
}, 'test to complete', DEFAULT_TIMEOUT);
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
waitsFor(function () {
|
waitsFor(function () {
|
||||||
return complete;
|
return complete;
|
||||||
}, 'test to complete', DEFAULT_TIMEOUT);
|
}, 'test to complete', DEFAULT_TIMEOUT);
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
waitsFor(function () {
|
waitsFor(function () {
|
||||||
return complete;
|
return complete;
|
||||||
}, 'test to complete', DEFAULT_TIMEOUT);
|
}, 'test to complete', DEFAULT_TIMEOUT);
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
|
|
||||||
var atime = Date.parse('1 Oct 2000 15:33:22');
|
var atime = Date.parse('1 Oct 2000 15:33:22');
|
||||||
var mtime = Date.parse('30 Sep 2000 06:43:54');
|
var mtime = Date.parse('30 Sep 2000 06:43:54');
|
||||||
|
|
||||||
that.fs.utimes('/pathdoesnotexist', atime, mtime, function (error) {
|
that.fs.utimes('/pathdoesnotexist', atime, mtime, function (error) {
|
||||||
_error = error;
|
_error = error;
|
||||||
complete = true;
|
complete = true;
|
||||||
|
@ -127,7 +127,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
waitsFor(function () {
|
waitsFor(function () {
|
||||||
return complete;
|
return complete;
|
||||||
}, 'test to complete', DEFAULT_TIMEOUT);
|
}, 'test to complete', DEFAULT_TIMEOUT);
|
||||||
|
|
||||||
|
@ -214,13 +214,13 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
|
|
||||||
that.fs.futimes(ofd, atime, mtime, function (error) {
|
that.fs.futimes(ofd, atime, mtime, function (error) {
|
||||||
_error = error;
|
_error = error;
|
||||||
|
|
||||||
that.fs.fstat(ofd, function (error, stat) {
|
that.fs.fstat(ofd, function (error, stat) {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
||||||
_stat = stat;
|
_stat = stat;
|
||||||
complete = true;
|
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 complete = false;
|
||||||
var _error;
|
var _error;
|
||||||
var that = this;
|
var that = this;
|
||||||
|
@ -293,7 +293,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
|
|
||||||
that.fs.stat('/myfile', function (error, stat) {
|
that.fs.stat('/myfile', function (error, stat) {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
||||||
atimeEst = now - stat.atime;
|
atimeEst = now - stat.atime;
|
||||||
mtimeEst = now - stat.mtime;
|
mtimeEst = now - stat.mtime;
|
||||||
complete = true;
|
complete = true;
|
||||||
|
|
Loading…
Reference in New Issue