mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-16 01:00:17 +01:00
test: cover the local network classifier and gate state machine
Extract the on-link decision into a pure function, test it with the Android 17 SDK through Robolectric's connectivity shadows, and exercise the gate's grant, denial, cancellation and stale-check paths with a fake checker. The SDK 37 shadow needs jdk.internal.access exported to the test JVM.
This commit is contained in:
@@ -91,6 +91,11 @@ android {
|
||||
testOptions {
|
||||
unitTests {
|
||||
isIncludeAndroidResources = true
|
||||
all {
|
||||
// Robolectric's SDK 37 ApplicationSharedMemory reaches into jdk.internal.access via
|
||||
// its FileDescriptor interceptor, which JDK 17+ does not export by default.
|
||||
it.jvmArgs("--add-exports=java.base/jdk.internal.access=ALL-UNNAMED")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user