Bug 543101: (Test-only change) When comparing filesystem timestamps to zip-file timestamps in zipwriter tests, truncate both values to second precision. r=dtownsend. CLOSED TREE

This commit is contained in:
Zack Weinberg 2010-02-05 11:22:39 -08:00
parent c33231cbcf
commit 0b0a7fe0c9
3 changed files with 6 additions and 4 deletions

View File

@ -58,6 +58,8 @@ const ZIP_METHOD_DEFLATE = 8
const ZIP_EXTENDED_TIMESTAMP_SIZE = 9;
const PR_USEC_PER_MSEC = 1000;
const PR_USEC_PER_SEC = 1000000;
const PR_MSEC_PER_SEC = 1000;
const DATA_DIR = "data/";

View File

@ -77,8 +77,8 @@ var observer = {
do_check_eq(entry.realSize, TESTS[i].size);
do_check_eq(entry.size, TESTS[i].size);
do_check_eq(entry.CRC32, TESTS[i].crc);
do_check_eq(entry.lastModifiedTime / PR_USEC_PER_MSEC,
source.lastModifiedTime);
do_check_eq(Math.floor(entry.lastModifiedTime / PR_USEC_PER_SEC),
Math.floor(source.lastModifiedTime / PR_MSEC_PER_SEC));
zipR.test(TESTS[i].name);
}

View File

@ -80,8 +80,8 @@ function run_test()
do_check_eq(entry.realSize, TESTS[i].size);
do_check_eq(entry.size, TESTS[i].size);
do_check_eq(entry.CRC32, TESTS[i].crc);
do_check_eq(entry.lastModifiedTime / PR_USEC_PER_MSEC,
source.lastModifiedTime);
do_check_eq(Math.floor(entry.lastModifiedTime / PR_USEC_PER_SEC),
Math.floor(source.lastModifiedTime / PR_MSEC_PER_SEC));
zipR.test(TESTS[i].name);
}