summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKai Shi <kaishi@google.com>2020-05-01 06:47:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-05-01 06:47:55 +0000
commit8d59b04a9dae467d5307f6ce7c71a3c1be8e9850 (patch)
treebc6ed1ff17ca0e24ac8a9d09f832a326e1c52d3c /tests
parentbe1d76775b438a5316611a77dbf0989e73037cf9 (diff)
parentbf9a17dace62c748a139754953e54534b2789225 (diff)
Merge "Add dump() for WifiHealthMonitor" into rvc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java b/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java
index 3342f93a1..5ba8dbadb 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java
@@ -514,6 +514,23 @@ public class WifiHealthMonitorTest extends WifiBaseTest {
}
/**
+ * Test FailureStats class
+ */
+ @Test
+ public void testFailureStats() throws Exception {
+ WifiHealthMonitor.FailureStats failureStats = new WifiHealthMonitor.FailureStats();
+ failureStats.setCount(WifiHealthMonitor.REASON_AUTH_FAILURE, 10);
+ failureStats.incrementCount(WifiHealthMonitor.REASON_AUTH_FAILURE);
+
+ String expectedString = "authentication failure: 11 ";
+ String unexpectedString =
+ WifiHealthMonitor.FAILURE_REASON_NAME[WifiHealthMonitor.REASON_ASSOC_REJECTION];
+ assertEquals(11, failureStats.getCount(WifiHealthMonitor.REASON_AUTH_FAILURE));
+ assertEquals(true, failureStats.toString().contains(expectedString));
+ assertEquals(false, failureStats.toString().contains(unexpectedString));
+ }
+
+ /**
* Check WestWorld logging after one daily detection with high non-local disconnection rate
*/
@Test