diff options
author | Yongjoo Ahn <yongjoo1.ahn@samsung.com> | 2024-09-04 14:41:16 +0900 |
---|---|---|
committer | jaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com> | 2024-09-05 10:12:14 +0900 |
commit | ac1e0eb7cb09d7f985befebf7f034730b6a76309 (patch) | |
tree | 933465539606930a17e9e5dcc97bd1b20db253af | |
parent | 99186f44bf43d15c84edd74df3d2100ffb5d2411 (diff) | |
download | machine-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>
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 { |