From f3b065fc3fbb61abc974eae4b1de839fb97ece5a Mon Sep 17 00:00:00 2001 From: Sangjung Woo Date: Mon, 8 Apr 2019 13:44:08 +0900 Subject: [PATCH] [Test:Tizen/API] Add pipeline failure test 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 --- tests/tizen_capi/unittest_tizen_capi.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/tizen_capi/unittest_tizen_capi.cpp b/tests/tizen_capi/unittest_tizen_capi.cpp index 8aba9ee..5bc0bd2 100644 --- a/tests/tizen_capi/unittest_tizen_capi.cpp +++ b/tests/tizen_capi/unittest_tizen_capi.cpp @@ -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) -- 2.7.4