Same fix for write.test.js.

This commit is contained in:
Young Hahn
2012-03-07 04:41:01 -05:00
parent aa63292fdc
commit 10f41ef2d1

View File

@@ -30,20 +30,17 @@ exports['test mbtiles file creation'] = function(beforeExit) {
// Flip Y coordinate because file names are TMS, but .putTile() expects XYZ. // Flip Y coordinate because file names are TMS, but .putTile() expects XYZ.
coords[2] = Math.pow(2, coords[3]) - 1 - coords[2]; coords[2] = Math.pow(2, coords[3]) - 1 - coords[2];
fs.readFile(__dirname + '/fixtures/images/' + file, function(err, tile) { var tile = fs.readFileSync(__dirname + '/fixtures/images/' + file);
mbtiles.putTile(coords[3] | 0, coords[1] | 0, coords[2] | 0, tile, function(err) {
if (err) throw err; if (err) throw err;
completed.written++;
mbtiles.putTile(coords[3] | 0, coords[1] | 0, coords[2] | 0, tile, function(err) { if (completed.written === 285) {
if (err) throw err; mbtiles.stopWriting(function(err) {
completed.written++; completed.stopped = true;
if (completed.written === 285) { if (err) throw err;
mbtiles.stopWriting(function(err) { verifyWritten();
completed.stopped = true; });
if (err) throw err; }
verifyWritten();
});
}
});
}); });
} }