Remove some @IgnoreInvokes in favor of specific ignores
Test: tools/test.py --dex_vm all --no-internal -v *Backport*Test*
Change-Id: I4fdf9c39e350ea0001df392ee519c0b99f4e24e8
diff --git a/src/test/java/com/android/tools/r8/desugar/backports/MathBackportTest.java b/src/test/java/com/android/tools/r8/desugar/backports/MathBackportTest.java
index 8edfa56..cbde5a7 100644
--- a/src/test/java/com/android/tools/r8/desugar/backports/MathBackportTest.java
+++ b/src/test/java/com/android/tools/r8/desugar/backports/MathBackportTest.java
@@ -20,6 +20,7 @@
public MathBackportTest(TestParameters parameters) {
super(parameters, Math.class, Main.class);
registerTarget(AndroidApiLevel.N, 97);
+ ignoreInvokes("nextAfter"); // Available in API 9, used to test nextDown.
}
static final class Main extends MiniAssert {
@@ -240,7 +241,7 @@
-0.1d, 0.1d,
};
for (double interestingValue : interestingValues) {
- assertEquals(nextAfter(interestingValue, Double.NEGATIVE_INFINITY),
+ assertEquals(Math.nextAfter(interestingValue, Double.NEGATIVE_INFINITY),
Math.nextDown(interestingValue));
}
}
@@ -258,7 +259,7 @@
-0.1f, 0.1f,
};
for (float interestingValue : interestingValues) {
- assertEquals(nextAfter(interestingValue, Float.NEGATIVE_INFINITY),
+ assertEquals(Math.nextAfter(interestingValue, Float.NEGATIVE_INFINITY),
Math.nextDown(interestingValue));
}
}
@@ -311,15 +312,5 @@
} catch (ArithmeticException expected) {
}
}
-
- @IgnoreInvokes
- private static double nextAfter(double value, double direction) {
- return Math.nextAfter(value, direction);
- }
-
- @IgnoreInvokes
- private static double nextAfter(float value, float direction) {
- return Math.nextAfter(value, direction);
- }
}
}
diff --git a/src/test/java/com/android/tools/r8/desugar/backports/StrictMathBackportTest.java b/src/test/java/com/android/tools/r8/desugar/backports/StrictMathBackportTest.java
index 5805764..915a6fb 100644
--- a/src/test/java/com/android/tools/r8/desugar/backports/StrictMathBackportTest.java
+++ b/src/test/java/com/android/tools/r8/desugar/backports/StrictMathBackportTest.java
@@ -20,6 +20,7 @@
public StrictMathBackportTest(TestParameters parameters) {
super(parameters, StrictMath.class, Main.class);
registerTarget(AndroidApiLevel.N, 75);
+ ignoreInvokes("nextAfter"); // Available in API 9, used to test nextDown.
}
static final class Main extends MiniAssert {
@@ -170,7 +171,7 @@
-0.1d, 0.1d,
};
for (double interestingValue : interestingValues) {
- assertEquals(nextAfter(interestingValue, Double.NEGATIVE_INFINITY),
+ assertEquals(StrictMath.nextAfter(interestingValue, Double.NEGATIVE_INFINITY),
StrictMath.nextDown(interestingValue));
}
}
@@ -188,7 +189,7 @@
-0.1f, 0.1f,
};
for (float interestingValue : interestingValues) {
- assertEquals(nextAfter(interestingValue, Float.NEGATIVE_INFINITY),
+ assertEquals(StrictMath.nextAfter(interestingValue, Float.NEGATIVE_INFINITY),
StrictMath.nextDown(interestingValue));
}
}
@@ -241,15 +242,5 @@
} catch (ArithmeticException expected) {
}
}
-
- @IgnoreInvokes
- private static double nextAfter(double value, double direction) {
- return StrictMath.nextAfter(value, direction);
- }
-
- @IgnoreInvokes
- private static double nextAfter(float value, float direction) {
- return StrictMath.nextAfter(value, direction);
- }
}
}