Backport Math/StrictMath.multiplyFull
Test: tools/test.py --dex_vm all --no-internal -v *Backport*Test*
Test: tools/test.py --no-internal -v *GenerateBackportMethods*
Change-Id: I0adb69edc2eca3ebbf20db8adea531626a941227
diff --git a/src/test/examplesJava9/backport/StrictMathBackportJava9Main.java b/src/test/examplesJava9/backport/StrictMathBackportJava9Main.java
index b711539..e0e45fb 100644
--- a/src/test/examplesJava9/backport/StrictMathBackportJava9Main.java
+++ b/src/test/examplesJava9/backport/StrictMathBackportJava9Main.java
@@ -8,6 +8,7 @@
public static void main(String[] args) {
testMultiplyExactLongInt();
+ testMultiplyFull();
testFloorDivLongInt();
testFloorModLongInt();
}
@@ -26,6 +27,16 @@
}
}
+ public static void testMultiplyFull() {
+ assertEquals(8L, StrictMath.multiplyFull(2, 4));
+ assertEquals(4611686014132420609L,
+ StrictMath.multiplyFull(Integer.MAX_VALUE, Integer.MAX_VALUE));
+ assertEquals(-4611686016279904256L,
+ StrictMath.multiplyFull(Integer.MAX_VALUE, Integer.MIN_VALUE));
+ assertEquals(4611686018427387904L,
+ StrictMath.multiplyFull(Integer.MIN_VALUE, Integer.MIN_VALUE));
+ }
+
public static void testFloorDivLongInt() {
assertEquals(1L, StrictMath.floorDiv(4L, 4));
assertEquals(1L, StrictMath.floorDiv(-4L, -4));