[Test:Tizen/API] Add pipeline failure test
authorSangjung Woo <sangjung.woo@samsung.com>
Mon, 8 Apr 2019 04:44:08 +0000 (13:44 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 9 Apr 2019 01:00:04 +0000 (10:00 +0900)
This patch newly adds the pipeline failure tests when passing the wrong
pipeline command such as non-existent element or erroneous pipeline.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
tests/tizen_capi/unittest_tizen_capi.cpp

index 8aba9ee..5bc0bd2 100644 (file)
@@ -55,6 +55,29 @@ TEST (nnstreamer_capi_construct_destruct, dummy_03)
 }
 
 /**
+ * @brief Test NNStreamer pipeline construct with non-existent filter
+ */
+TEST (nnstreamer_capi_construct_destruct, failed_01)
+{
+  const char *pipeline = "nonexistsrc ! fakesink";
+  nns_pipeline_h handle;
+  int status = nns_pipeline_construct (pipeline, &handle);
+  EXPECT_EQ (status, NNS_ERROR_PIPELINE_FAIL);
+}
+
+/**
+ * @brief Test NNStreamer pipeline construct with erroneous pipeline
+ */
+TEST (nnstreamer_capi_construct_destruct, failed_02)
+{
+  const char *pipeline = "videotestsrc num_buffers=2 ! audioconvert ! fakesink";
+  nns_pipeline_h handle;
+  int status = nns_pipeline_construct (pipeline, &handle);
+  EXPECT_EQ (status, NNS_ERROR_PIPELINE_FAIL);
+}
+
+
+/**
  * @brief Test NNStreamer pipeline construct & destruct
  */
 TEST (nnstreamer_capi_playstop, dummy_01)