From: Tim Kientzle Date: Sun, 6 Sep 2009 06:55:10 +0000 (-0400) Subject: Fix Windows time tests. X-Git-Tag: v2.8.0~376 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70a3b4ef73c12e9d3fc2c0f26c0f3c0d9486968d;p=thirdparty%2Flibarchive.git Fix Windows time tests. SVN-Revision: 1432 --- diff --git a/libarchive/test/main.c b/libarchive/test/main.c index beb6cadfc..155d2c53c 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -819,6 +819,7 @@ assertion_file_time(const char *file, int line, int r; #if defined(_WIN32) && !defined(__CYGWIN__) +#define EPOC_TIME (116444736000000000ULL) FILETIME ftime, fbirthtime, fatime, fmtime; ULARGE_INTEGER wintm; HANDLE h; @@ -834,8 +835,8 @@ assertion_file_time(const char *file, int line, r = GetFileTime(h, &fbirthtime, &fatime, &fmtime); switch (type) { case 'a': ftime = fatime; break; - case 'm': ftime = fmtime; break; case 'b': ftime = fbirthtime; break; + case 'm': ftime = fmtime; break; } CloseHandle(h); if (r == 0) { @@ -843,8 +844,8 @@ assertion_file_time(const char *file, int line, failure_finish(NULL); return (0); } - wintm.LowPart = fmtime.dwLowDateTime; - wintm.HighPart = fmtime.dwHighDateTime; + wintm.LowPart = ftime.dwLowDateTime; + wintm.HighPart = ftime.dwHighDateTime; filet = (wintm.QuadPart - EPOC_TIME) / 10000000; filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100; nsec = (nsec / 100) * 100; /* Round the request */