Move APF memory clear into its own function
Every test that uses counters should make use of this function.
Test: TH
Change-Id: I0b7e9597df889365dce98f45c7107dbf27457c4f
diff --git a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
index 1a535b4..a93e954 100644
--- a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
+++ b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
@@ -419,14 +419,15 @@
packetReader.expectPingDropped()
}
+ fun clearApfMemory() = installProgram(ByteArray(caps.maximumApfProgramSize))
+
// APF integration is mostly broken before V
@IgnoreUpTo(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
@Test
fun testPrefilledMemorySlotsV4() {
// Test v4 memory slots on both v4 and v6 interpreters.
assumeApfVersionSupportAtLeast(4)
- // Clear the entire memory before starting this test
- installProgram(ByteArray(caps.maximumApfProgramSize))
+ clearApfMemory()
val gen = ApfV4Generator(4)
// If not ICMPv6 Echo Reply -> PASS