From: Sangjung Woo Date: Thu, 11 Jun 2020 02:12:11 +0000 (+0900) Subject: [Tests/Filter] Add test case for NNS_custom_easy_unregister() X-Git-Tag: accepted/tizen/unified/20200629.143505~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec2d09a0ea46af3d79ffd5e1949c887920e00cb4;p=platform%2Fupstream%2Fnnstreamer.git [Tests/Filter] Add test case for NNS_custom_easy_unregister() This patch newl adds test cases for NNS_custom_easy_unregister(). Signed-off-by: Sangjung Woo --- diff --git a/tests/nnstreamer_sink/unittest_sink.cc b/tests/nnstreamer_sink/unittest_sink.cc index 84a99f2..d8dad34 100644 --- a/tests/nnstreamer_sink/unittest_sink.cc +++ b/tests/nnstreamer_sink/unittest_sink.cc @@ -5658,11 +5658,51 @@ TEST (tensor_filter_custom_easy, in_code_func_01) EXPECT_FALSE (g_test_data.test_failed); _free_test_data (); + /** cleanup registered custom_easy filter */ + ret = NNS_custom_easy_unregister("safe_memcpy_10x10"); + ASSERT_EQ(ret, 0); + /** @todo: Check the data at sink */ } /** + * @brief Test unregister custom_easy filter + */ +TEST (tensor_filter_custom_easy, unregister_1_p) +{ + int ret; + const GstTensorsInfo info_in = { + .num_tensors = 1U, + .info = {{ .name = NULL, .type = _NNS_UINT8, .dimension = { 1, 10, 1, 1}}}, + }; + const GstTensorsInfo info_out = { + .num_tensors = 1U, + .info = {{ .name = NULL, .type = _NNS_UINT8, .dimension = { 1, 10, 1, 1}}}, + }; + + ret = NNS_custom_easy_register ("safe_memcpy_10x10", cef_func_safe_memcpy, + NULL, &info_in, &info_out); + ASSERT_EQ(ret, 0); + + /** check unregister custom_easy filter */ + ret = NNS_custom_easy_unregister("safe_memcpy_10x10"); + ASSERT_EQ(ret, 0); +} + +/** + * @brief Test non-registered custom_easy filter + */ +TEST (tensor_filter_custom_easy, unregister_1_n) +{ + int ret; + + /** check non-registered custom_easy filter */ + ret = NNS_custom_easy_unregister("not_registered"); + ASSERT_NE(ret, 0); +} + +/** * @brief Main function for unit test. */ int