From: Jaeyun Date: Mon, 27 Jul 2020 04:40:27 +0000 (+0900) Subject: [Android/Single] allow 0 timeout X-Git-Tag: accepted/tizen/unified/20200802.223717~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2abd044d8cc7986dadcb00b2400959bb8d2048cf;p=platform%2Fupstream%2Fnnstreamer.git [Android/Single] allow 0 timeout Now C-API allows setting 0 timeout val, change condition to set timeout value. Signed-off-by: Jaeyun --- diff --git a/api/android/api/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java b/api/android/api/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java index 1f1d6d2..7f9b6ae 100644 --- a/api/android/api/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java +++ b/api/android/api/src/androidTest/java/org/nnsuite/nnstreamer/APITestSingleShot.java @@ -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 */ diff --git a/api/android/api/src/main/java/org/nnsuite/nnstreamer/SingleShot.java b/api/android/api/src/main/java/org/nnsuite/nnstreamer/SingleShot.java index 6806b6b..ab760f2 100644 --- a/api/android/api/src/main/java/org/nnsuite/nnstreamer/SingleShot.java +++ b/api/android/api/src/main/java/org/nnsuite/nnstreamer/SingleShot.java @@ -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"); }