Skip to content

Commit

Permalink
IOKit: For testing parent-child-operator validity don't assume contro…
Browse files Browse the repository at this point in the history
…ller names or types
  • Loading branch information
matthiasblaesing committed Mar 12, 2022
1 parent 583d3b8 commit ec1754d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions contrib/platform/test/com/sun/jna/platform/mac/IOKitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;

import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -166,8 +167,7 @@ public void testIteratorParentChild() {

// Get device name
String controllerName = controllerDevice.getName();
// Root controllers always begin with "AppleUSB"
assertEquals("AppleUSB", controllerName.substring(0, 8));
assertNotNull(controllerName);

// Get the first child, to test vs. iterator
boolean testFirstChild = true;
Expand All @@ -177,7 +177,6 @@ public void testIteratorParentChild() {
IOIterator childIter = controllerDevice.getChildIterator(IO_SERVICE);
IORegistryEntry childDevice = childIter.next();
while (childDevice != null) {
assertTrue(childDevice.conformsTo("IOUSBDevice"));
long childId = childDevice.getRegistryEntryID();
assertTrue(childId > 19);
assertFalse(uniqueEntryIdSet.contains(childId));
Expand Down

0 comments on commit ec1754d

Please sign in to comment.