Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added SetLocalTime definition to 'com.sun.jna.platform.win32.Kernel32' #432

Merged
merged 1 commit into from
Apr 28, 2015
Merged

Added SetLocalTime definition to 'com.sun.jna.platform.win32.Kernel32' #432

merged 1 commit into from
Apr 28, 2015

Conversation

lgoldstein
Copy link
Contributor

Added missing 'SetLocalTime' + updated the tests to take into account user privileges (stay tuned for the CHANGES.md commit...)

@lgoldstein
Copy link
Contributor Author

All ready...

@dblock
Copy link
Member

dblock commented Apr 27, 2015

Just missing CHANGES! :)

* privileges and it may be too much to ask to have them just for running
* this JNA API test...
*/
if (hr == WinError.ERROR_PRIVILEGE_NOT_HELD) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I suggest using assumeTrue, see https://github.com/twall/jna/blob/master/contrib/platform/test/com/sun/jna/platform/win32/Dxva2Test.java#L62 for an example. It will be a lot cleaner and much less code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the same thing - if the error code is ERROR_PRIVILEGE_NOT_HELD I don't want the test to fail, but for all other error codes I want the assertion failure. Therefore, using Assume.assumeTrue("SetSystemTime", INSTANCE.SetSystemTime(...)) would be incorrect since it would not make sure that the failure is due to the privilege issue and nothing else.

@lgoldstein
Copy link
Contributor Author

I have changed it and used git commit -amend + git push but for some reason it did not take - I will do a dummy "change" and push again to make sure

@dblock
Copy link
Member

dblock commented Apr 28, 2015

Merging, thanks.

dblock added a commit that referenced this pull request Apr 28, 2015
Added SetLocalTime definition to 'com.sun.jna.platform.win32.Kernel32'
@dblock dblock merged commit 68db993 into java-native-access:master Apr 28, 2015
mstyura pushed a commit to mstyura/jna that referenced this pull request Sep 9, 2024
Motivation:
New is always better.

Modification:
Upgrade to the latest JUnit 5 version.

Result:
Tests run with the latest JUnit version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants