Skip to content

Commit

Permalink
IOKit: Make assumptions of test explicit, so that test is skipped and…
Browse files Browse the repository at this point in the history
… not marked as failed
  • Loading branch information
matthiasblaesing committed Mar 12, 2022
1 parent 583d3b8 commit 7684cc8
Showing 1 changed file with 6 additions and 1 deletion.
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,12 @@ public void testIteratorParentChild() {

// Get device name
String controllerName = controllerDevice.getName();
assertNotNull(controllerName);
// Root controllers always begin with "AppleUSB"
assertEquals("AppleUSB", controllerName.substring(0, 8));
assumeTrue(
"Expected USB controller not found (controllerName should start with AppleUSB)",
controllerName.startsWith("AppleUSB")
);

// Get the first child, to test vs. iterator
boolean testFirstChild = true;
Expand Down

0 comments on commit 7684cc8

Please sign in to comment.