Fix ApfTest and apf_jni to make it match the latest design of ApfV6
* design doc: go/apf-v6-proposal
Bug: Bug: 293811969
Test: TH
Change-Id: Ib1395e6d11c49f4286ff2fc197da40c8dc8b30ba
diff --git a/tests/unit/jni/apf_jni.cpp b/tests/unit/jni/apf_jni.cpp
index 5ae3ada..84c5c1a 100644
--- a/tests/unit/jni/apf_jni.cpp
+++ b/tests/unit/jni/apf_jni.cpp
@@ -41,7 +41,7 @@
filter_age);
} else {
return apf_run(program, program_len, ram_len, packet, packet_len,
- filter_age);
+ filter_age << 14);
}
}
diff --git a/tests/unit/src/android/net/apf/ApfTest.java b/tests/unit/src/android/net/apf/ApfTest.java
index 4d22219..6a54e1c 100644
--- a/tests/unit/src/android/net/apf/ApfTest.java
+++ b/tests/unit/src/android/net/apf/ApfTest.java
@@ -552,8 +552,8 @@
// Test filter age pre-filled memory.
gen = new ApfGenerator(MIN_APF_VERSION);
gen.addLoadFromMemory(R0, gen.FILTER_AGE_MEMORY_SLOT);
- gen.addJumpIfR0Equals(1234567890, gen.DROP_LABEL);
- assertDrop(gen, new byte[MIN_PKT_SIZE], 1234567890);
+ gen.addJumpIfR0Equals(123, gen.DROP_LABEL);
+ assertDrop(gen, new byte[MIN_PKT_SIZE], 123);
// Test packet size pre-filled memory.
gen = new ApfGenerator(MIN_APF_VERSION);