Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwiddis committed Dec 1, 2015
1 parent acea236 commit 1cedd97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 1cedd97

Please sign in to comment.