Skip to content

Commit

Permalink
Merge pull request #1365 from dmytro-sheyko/bug/test_VMCrashProtectio…
Browse files Browse the repository at this point in the history
…nTest

checked properly that exception is thrown
  • Loading branch information
matthiasblaesing authored Aug 9, 2021
2 parents 3526e77 + b5b9780 commit 0f2f881
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/com/sun/jna/VMCrashProtectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
package com.sun.jna;

import junit.framework.TestCase;
import org.junit.Assume;

public class VMCrashProtectionTest extends TestCase {

Expand Down Expand Up @@ -52,12 +51,14 @@ public void testAccessViolation() {
else
m.setLong(0, 1);
Pointer p = m.getPointer(0);
Throwable actual = null;
try {
p.setInt(0, 0);
fail("Exception should be thrown");
}
catch(Throwable e) {
actual = e;
}
assertNotNull("Exception should be thrown", actual);
}

public static void main(String[] args) {
Expand Down

0 comments on commit 0f2f881

Please sign in to comment.