diff --git a/startup_lite/syspara_hal/src/parameter_func_test.c b/startup_lite/syspara_hal/src/parameter_func_test.c index 617f878f228f72765ff58262804d80d896fc9ab7..4536785d01f4e150eb023979a254d4345a8748bc 100755 --- a/startup_lite/syspara_hal/src/parameter_func_test.c +++ b/startup_lite/syspara_hal/src/parameter_func_test.c @@ -55,13 +55,13 @@ static BOOL ParameterFuncTestSuiteTearDown(void) /** * @tc.number : SUB_UTILS_PARAMETER_0100 - * @tc.name : Obtaining system parameter ProductType + * @tc.name : Obtaining system parameter DeviceType * @tc.desc : [C- SOFTWARE -0200] */ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara001, Function | MediumTest | Level1) { const char* value = GetDeviceType(); - printf("Product Type=%s\n", value); + printf("Device Type=%s\n", value); IsEmpty(value); }; @@ -158,12 +158,7 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara009, Function | MediumTe { const char* value = GetSerial(); printf("Serial=%s\n", value); - if (value == NULL) { - printf("The serial number needs to be written\n"); - TEST_IGNORE(); - } else { - TEST_ASSERT_EQUAL_INT(1, 1); - } + IsEmpty(value); }; /** @@ -235,7 +230,8 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara015, Function | MediumTe { int value = GetFirstApiVersion(); printf("First Api Level=%d\n", value); - IsEmpty(value); + TEST_ASSERT_NOT_NULL(value); + TEST_ASSERT_TRUE((int)value == value); }; /** @@ -343,7 +339,8 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara024, Function | MediumTe { int value = GetSdkApiVersion(); printf("Sdk Api Level=%d\n", value); - IsEmpty(value); + TEST_ASSERT_NOT_NULL(value); + TEST_ASSERT_TRUE((int)value == value); }; /** diff --git a/startup_lite/syspara_hal/src/parameter_reli_test.c b/startup_lite/syspara_hal/src/parameter_reli_test.c index 7de35e169679aaf3e5f6765af326078cf5d667eb..1a263144e96399e5b0f1e28471774dd4d47a05db 100755 --- a/startup_lite/syspara_hal/src/parameter_reli_test.c +++ b/startup_lite/syspara_hal/src/parameter_reli_test.c @@ -297,7 +297,8 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli014, Function | Medi LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli015, Function | MediumTest | Level1) { int value1 = GetFirstApiVersion(); - IsEmpty(value1); + TEST_ASSERT_NOT_NULL(value1); + TEST_ASSERT_TRUE((int)value1 == value1); for (int i = 0; i < QUERY_TIMES; i++) { int value = GetFirstApiVersion(); @@ -450,7 +451,8 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli023, Function | Medi LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli024, Function | MediumTest | Level1) { int value1 = GetSdkApiVersion(); - IsEmpty(value1); + TEST_ASSERT_NOT_NULL(value1); + TEST_ASSERT_TRUE((int)value1 == value1); for (int i = 0; i < QUERY_TIMES; i++) { int value = GetSdkApiVersion(); diff --git a/startup_lite/syspara_hal/src/parameter_utils.c b/startup_lite/syspara_hal/src/parameter_utils.c index d34c72f47f3afeab185446045b8caac10e0d8bb8..6e962dcdcb2c6c4c366a7fad8314ee76a28b39a8 100755 --- a/startup_lite/syspara_hal/src/parameter_utils.c +++ b/startup_lite/syspara_hal/src/parameter_utils.c @@ -19,8 +19,8 @@ void IsEmpty(const char* sysPara) { if (sysPara != NULL) { - TEST_ASSERT_EQUAL_INT(1, 1); - } else { - TEST_FAIL(); - } + if (strlen(sysPara) != 0) { + TEST_ASSERT_NOT_NULL(sysPara); + } + } } \ No newline at end of file