diff --git a/CHANGES.md b/CHANGES.md index ebd95259a8..4879a27086 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,8 +17,8 @@ Features * [#535](https://github.com/java-native-access/jna/pull/535): Added `SHEmptyRecycleBin`, `ShellExecuteEx` to `com.sun.jna.platform.win32.Shell32` - [@mlfreeman2](https://github.com/mlfreeman2). * [#535](https://github.com/java-native-access/jna/pull/535): Added `GetDesktopWindow` to `com.sun.jna.platform.win32.User32` - [@mlfreeman2](https://github.com/mlfreeman2). * [#543](https://github.com/java-native-access/jna/pull/543): Added `ProcessIdToSessionId`, `LoadLibraryEx`, `FreeLibrary` and `Find/Load/Lock/SizeofResource` to `com.sun.jna.platform.win32.Kernel32` - [@mlfreeman2](https://github.com/mlfreeman2). -* [#547](https://github.com/java-native-access/jna/pull/547): Added `GetSystemTimes` to `com.sun.jna.platform.win32.Kernel32` - [@dbwiddis](https://github.com/dbwiddis). * [#545](https://github.com/java-native-access/jna/pull/545): Added `EnumResourceTypes` and `EnumResourceNames` to `com.sun.jna.platform.win32.Kernel32` - [@mlfreeman2](https://github.com/mlfreeman2). +* [#547](https://github.com/java-native-access/jna/pull/547): Added `GetSystemTimes` to `com.sun.jna.platform.win32.Kernel32` - [@dbwiddis](https://github.com/dbwiddis). * [#548](https://github.com/java-native-access/jna/pull/548): Return 64-bit unsigned integer from `com.sun.jna.platform.win32.WinBase.FILETIME` - [@dbwiddis](https://github.com/dbwiddis). Bug Fixes diff --git a/contrib/platform/test/com/sun/jna/platform/win32/WinBaseTest.java b/contrib/platform/test/com/sun/jna/platform/win32/WinBaseTest.java index 42a1203ac6..a5f5c5ff56 100644 --- a/contrib/platform/test/com/sun/jna/platform/win32/WinBaseTest.java +++ b/contrib/platform/test/com/sun/jna/platform/win32/WinBaseTest.java @@ -31,13 +31,13 @@ public WinBaseTest(String name) { } public void testFiletime() { - // subtract to convert ms after 1/1/1970 to ms after 1/1/1601 - long epochDiff = 11644473600000L; - // Construct filetimes for ms after 1/1/1601, check for 100-ns after - assertEquals("Mismatched filetime for 2ms", (new FILETIME(new Date(2L - epochDiff))).toDWordLong().longValue(), 2L * 10000); - assertEquals("Mismatched filetime for 2^31ms", (new FILETIME(new Date((2L << 31) - epochDiff))).toDWordLong().longValue(), (2L << 31) * 10000); - assertEquals("Mismatched filetime for 2^32ms", (new FILETIME(new Date((2L << 32) - epochDiff))).toDWordLong().longValue(), (2L << 32) * 10000); - assertEquals("Mismatched filetime for 2^60ms", (new FILETIME(new Date((2L << 60) - epochDiff))).toDWordLong().longValue(), (2L << 60) * 10000); + // subtract to convert ms after 1/1/1970 to ms after 1/1/1601 + long epochDiff = 11644473600000L; + // Construct filetimes for ms after 1/1/1601, check for 100-ns after + assertEquals("Mismatched filetime for 2ms", (new FILETIME(new Date(2L - epochDiff))).toDWordLong().longValue(), 2L * 10000); + assertEquals("Mismatched filetime for 2^31ms", (new FILETIME(new Date((1L << 31) - epochDiff))).toDWordLong().longValue(), (1L << 31) * 10000); + assertEquals("Mismatched filetime for 2^32ms", (new FILETIME(new Date((1L << 32) - epochDiff))).toDWordLong().longValue(), (1L << 32) * 10000); + assertEquals("Mismatched filetime for 2^60ms", (new FILETIME(new Date((1L << 60) - epochDiff))).toDWordLong().longValue(), (1L << 60) * 10000); } public void testCalendarToSystemTimeConversion() {