From 1012d7a4b1d3a919d31f39dced4952a8f607493a Mon Sep 17 00:00:00 2001 From: Albert Ho <82767499+albho@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:22:22 -0800 Subject: [PATCH] fix android tests (#229) fix android tests --- .../java/ai/picovoice/cobra/testapp/CobraTest.java | 7 +------ .../java/ai/picovoice/cobra/testapp/PerformanceTest.java | 8 ++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/CobraTest.java b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/CobraTest.java index 4065877..da8babc 100644 --- a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/CobraTest.java +++ b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/CobraTest.java @@ -1,5 +1,5 @@ /* - Copyright 2021-2023 Picovoice Inc. + Copyright 2021-2024 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -16,10 +16,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.platform.app.InstrumentationRegistry; -import org.junit.After; -import org.junit.Assume; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -45,7 +42,6 @@ @RunWith(AndroidJUnit4.class) public class CobraTest { - @Rule Context testContext; Context appContext; AssetManager assetManager; @@ -69,7 +65,6 @@ public void testProcess() throws CobraException { Cobra cobra = new Cobra(accessKey); File testAudio = new File(testResourcesPath, "audio/sample.wav"); - ArrayList detectionResults = new ArrayList<>(); List probs = new ArrayList<>(); diff --git a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/PerformanceTest.java b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/PerformanceTest.java index 77ab39b..eadb140 100644 --- a/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/PerformanceTest.java +++ b/binding/android/CobraTestApp/cobra-test-app/src/androidTest/java/ai/picovoice/cobra/testapp/PerformanceTest.java @@ -8,10 +8,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.platform.app.InstrumentationRegistry; -import org.junit.After; import org.junit.Assume; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -31,11 +29,11 @@ @RunWith(AndroidJUnit4.class) public class PerformanceTest { - @Rule - public Context testContext; + Context testContext; Context appContext; AssetManager assetManager; String testResourcesPath; + String accessKey; @Before @@ -49,8 +47,6 @@ public void Setup() throws IOException { accessKey = appContext.getString(R.string.pvTestingAccessKey); } - - @Test public void testPerformance() throws Exception { String iterationString = appContext.getString(R.string.numTestIterations);