From: Wook Song Date: Fri, 5 Apr 2024 02:28:26 +0000 (+0900) Subject: Tests/CAPI: Add more negative test cases X-Git-Tag: accepted/tizen/unified/20240408.160647~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e04065a96c526f8cd178683c1622f70a4da61ab5;p=platform%2Fcore%2Fapi%2Fmachine-learning.git Tests/CAPI: Add more negative test cases This is a trivial patch that adds more negative test cases for the inference C-APIs. Signed-off-by: Wook Song --- diff --git a/tests/capi/unittest_capi_inference.cc b/tests/capi/unittest_capi_inference.cc index 64216a6..ba0bf1f 100644 --- a/tests/capi/unittest_capi_inference.cc +++ b/tests/capi/unittest_capi_inference.cc @@ -2163,6 +2163,11 @@ TEST (nnstreamer_capi_util, availability_fail_01_n) ML_NNFW_TYPE_TENSORFLOW_LITE, ML_NNFW_HW_NPU_SR, &result); EXPECT_EQ (status, ML_ERROR_NONE); EXPECT_EQ (result, false); + + status = ml_check_nnfw_availability ( + ML_NNFW_TYPE_TENSORFLOW_LITE, ML_NNFW_HW_NPU_SLSI, &result); + EXPECT_EQ (status, ML_ERROR_NONE); + EXPECT_EQ (result, false); } #ifdef ENABLE_TENSORFLOW diff --git a/tests/capi/unittest_capi_inference_single.cc b/tests/capi/unittest_capi_inference_single.cc index 71e97d2..84ad6d6 100644 --- a/tests/capi/unittest_capi_inference_single.cc +++ b/tests/capi/unittest_capi_inference_single.cc @@ -4480,7 +4480,27 @@ TEST (nnstreamer_capi_internal, validate_model_file_01_n) status = _ml_validate_model_file (&test_model, 0, &nnfw); EXPECT_NE (status, ML_ERROR_NONE); - status = _ml_validate_model_file (&test_model, 1, NULL); + status = _ml_validate_model_file (&test_model, 1, &nnfw); + EXPECT_NE (status, ML_ERROR_NONE); + + nnfw = ML_NNFW_TYPE_MVNC; + status = _ml_validate_model_file (&test_model, 1, &nnfw); + EXPECT_NE (status, ML_ERROR_NONE); + + nnfw = ML_NNFW_TYPE_VD_AIFW; + status = _ml_validate_model_file (&test_model, 1, &nnfw); + EXPECT_NE (status, ML_ERROR_NONE); + + nnfw = ML_NNFW_TYPE_SNAP; + status = _ml_validate_model_file (&test_model, 1, &nnfw); + EXPECT_NE (status, ML_ERROR_NONE); + + nnfw = ML_NNFW_TYPE_ARMNN; + status = _ml_validate_model_file (&test_model, 1, &nnfw); + EXPECT_NE (status, ML_ERROR_NONE); + + nnfw = ML_NNFW_TYPE_MXNET; + status = _ml_validate_model_file (&test_model, 1, &nnfw); EXPECT_NE (status, ML_ERROR_NONE); skip_test: