From e04065a96c526f8cd178683c1622f70a4da61ab5 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Fri, 5 Apr 2024 11:28:26 +0900 Subject: [PATCH] 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 --- tests/capi/unittest_capi_inference.cc | 5 +++++ tests/capi/unittest_capi_inference_single.cc | 22 +++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) 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: -- 2.7.4