OSDN Git Service

Apf: Avoid constant overflow
authorAndreas Gampe <agampe@google.com>
Wed, 13 Jun 2018 18:35:16 +0000 (11:35 -0700)
committerAndreas Gampe <agampe@google.com>
Thu, 14 Jun 2018 15:43:07 +0000 (08:43 -0700)
The used constant overflows. This is irrelevant to the test, so
decrease test constant.

Bug: 110155920
Test: m javac-check RUN_ERROR_PRONE=true
Change-Id: Idfc7e987ba9c36389a20c7fc01b1161ef89483d8

tests/net/java/android/net/apf/ApfTest.java

index 0248e97..9838020 100644 (file)
@@ -314,9 +314,9 @@ public class ApfTest {
 
         // Test multiply.
         gen = new ApfGenerator(MIN_APF_VERSION);
-        gen.addLoadImmediate(Register.R0, 1234567890);
+        gen.addLoadImmediate(Register.R0, 123456789);
         gen.addMul(2);
-        gen.addJumpIfR0Equals(1234567890 * 2, gen.DROP_LABEL);
+        gen.addJumpIfR0Equals(123456789 * 2, gen.DROP_LABEL);
         assertDrop(gen);
 
         // Test divide.
@@ -379,10 +379,10 @@ public class ApfTest {
 
         // Test multiply.
         gen = new ApfGenerator(MIN_APF_VERSION);
-        gen.addLoadImmediate(Register.R0, 1234567890);
+        gen.addLoadImmediate(Register.R0, 123456789);
         gen.addLoadImmediate(Register.R1, 2);
         gen.addMulR1();
-        gen.addJumpIfR0Equals(1234567890 * 2, gen.DROP_LABEL);
+        gen.addJumpIfR0Equals(123456789 * 2, gen.DROP_LABEL);
         assertDrop(gen);
 
         // Test divide.