[Android/Single] allow 0 timeout
authorJaeyun <jy1210.jung@samsung.com>
Mon, 27 Jul 2020 04:40:27 +0000 (13:40 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 28 Jul 2020 06:32:46 +0000 (15:32 +0900)
Now C-API allows setting 0 timeout val, change condition to set timeout value.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
api/android/api/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java
api/android/api/src/main/java/org/nnsuite/nnstreamer/SingleShot.java

index 1f1d6d2..7f9b6ae 100644 (file)
@@ -411,23 +411,6 @@ public class APITestSingleShot {
     }
 
     @Test
-    public void testSetZeroTimeout_n() {
-        if (!NNStreamer.isAvailable(NNStreamer.NNFWType.TENSORFLOW_LITE)) {
-            /* cannot run the test */
-            return;
-        }
-
-        try {
-            SingleShot single = new SingleShot(APITestCommon.getTFLiteImgModel());
-
-            single.setTimeout(0);
-            fail();
-        } catch (Exception e) {
-            /* expected */
-        }
-    }
-
-    @Test
     public void testSetInvalidTimeout_n() {
         if (!NNStreamer.isAvailable(NNStreamer.NNFWType.TENSORFLOW_LITE)) {
             /* cannot run the test */
index 6806b6b..ab760f2 100644 (file)
@@ -261,7 +261,7 @@ public final class SingleShot implements AutoCloseable {
     public void setTimeout(int timeout) {
         checkPipelineHandle();
 
-        if (timeout <= 0) {
+        if (timeout < 0) {
             throw new IllegalArgumentException("Given timeout is invalid");
         }