summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>2024-09-04 14:41:16 +0900
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>2024-09-05 10:12:14 +0900
commitac1e0eb7cb09d7f985befebf7f034730b6a76309 (patch)
tree933465539606930a17e9e5dcc97bd1b20db253af
parent99186f44bf43d15c84edd74df3d2100ffb5d2411 (diff)
downloadmachine-learning-ac1e0eb7cb09d7f985befebf7f034730b6a76309.tar.gz
machine-learning-ac1e0eb7cb09d7f985befebf7f034730b6a76309.tar.bz2
machine-learning-ac1e0eb7cb09d7f985befebf7f034730b6a76309.zip
[android] Use `getRootDirectory` in android test
- Use `getRootDirectory` instead of `getExternalStorageDirectory` for android tests. Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
-rw-r--r--java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestCommon.java2
-rw-r--r--java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestPipeline.java4
-rw-r--r--java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java2
3 files changed, 4 insertions, 4 deletions
diff --git a/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestCommon.java b/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestCommon.java
index 604dd26..6e361f4 100644
--- a/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestCommon.java
+++ b/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestCommon.java
@@ -34,7 +34,7 @@ public class APITestCommon {
private static boolean mInitialized = false;
private static String mRootDirectory = null;
- private static String getRootDirectory() {
+ public static String getRootDirectory() {
return mInitialized ? mRootDirectory : null;
}
diff --git a/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestPipeline.java b/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestPipeline.java
index 02c95b1..c61cc80 100644
--- a/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestPipeline.java
+++ b/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestPipeline.java
@@ -1407,7 +1407,7 @@ public class APITestPipeline {
@Test
public void testAMCsrc() {
- String root = Environment.getExternalStorageDirectory().getAbsolutePath();
+ String root = APITestCommon.getRootDirectory();
String media = root + "/nnstreamer/test/test_video.mp4";
String desc = "amcsrc location=" + media + " ! " +
@@ -2318,7 +2318,7 @@ public class APITestPipeline {
return;
}
- String root = Environment.getExternalStorageDirectory().getAbsolutePath();
+ String root = APITestCommon.getRootDirectory();
String png_path = root + "/nnstreamer/test/orange.png";
String pipeline_desc = "appsrc name=srcx caps=image/png ! pngdec ! videoconvert ! videoscale ! video/x-raw,format=RGB,width=224,height=224,framerate=0/1 ! " +
diff --git a/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java b/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java
index cd2e724..fda93d8 100644
--- a/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java
+++ b/java/android/nnstreamer/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java
@@ -367,7 +367,7 @@ public class APITestSingleShot {
@Test
public void testInvalidFile_n() {
- String root = Environment.getExternalStorageDirectory().getAbsolutePath();
+ String root = APITestCommon.getRootDirectory();
File model = new File(root + "/invalid_path/invalid.tflite");
try {