Skip to content

Commit

Permalink
Extending other test classes doesn't play nice with Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwiddis committed May 11, 2020
1 parent 0eff2db commit 6426abc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
*/
package com.sun.jna.platform;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import com.sun.jna.ByReferenceToStringTest;
import com.sun.jna.Pointer;
import com.sun.jna.platform.unix.X11.AtomByReference;
import com.sun.jna.platform.unix.X11.WindowByReference;
Expand Down Expand Up @@ -76,7 +78,7 @@
import com.sun.jna.platform.win32.WinReg.HKEY;
import com.sun.jna.platform.win32.WinReg.HKEYByReference;

public class ByReferencePlatformToStringTest extends ByReferenceToStringTest {
public class ByReferencePlatformToStringTest {
@Test
public void testPlatformToStrings() {
BOOLByReference boolbr = new BOOLByReference(new BOOL(true));
Expand Down Expand Up @@ -176,4 +178,23 @@ public void testPlatformToStrings() {
assertTrue(windowStr.contains("=0x"));
}
}

/**
* Parses a string "foo@0x123=bar" testing equality of fixed parts of the string
*
* @param s
* The string to test
* @param beforeAt
* The string which should match the portion before the first
* {@code @}
* @param afterEquals
* The string which should match the portion after the {@code =}
* sign, before any additional {@code @}
*/
protected void parseAndTest(String s, String beforeAt, String afterEquals) {
String[] atSplit = s.split("@");
assertEquals("Incorrect type prefix", beforeAt, atSplit[0]);
String[] equalsSplit = atSplit[1].split("=");
assertEquals("Incorrect value string", afterEquals, equalsSplit[1]);
}
}
2 changes: 1 addition & 1 deletion test/com/sun/jna/ByReferenceToStringTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void testToStrings() {
* The string which should match the portion after the {@code =}
* sign, before any additional {@code @}
*/
protected void parseAndTest(String s, String beforeAt, String afterEquals) {
private void parseAndTest(String s, String beforeAt, String afterEquals) {
String[] atSplit = s.split("@");
assertEquals("Incorrect type prefix", beforeAt, atSplit[0]);
String[] equalsSplit = atSplit[1].split("=");
Expand Down

0 comments on commit 6426abc

Please sign in to comment.