提交 d61258bd 编写于 作者: O openharmony_ci 提交者: Gitee

!156 启动恢复子系统--系统属性API整改

Merge pull request !156 from lanxueyuan/lanxueyuan-change-param-api
......@@ -60,10 +60,9 @@ static BOOL ParameterFuncTestSuiteTearDown(void)
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara001, Function | MediumTest | Level1)
{
char* value = GetProductType();
const char* value = GetDeviceType();
printf("Product Type=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -73,10 +72,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara001, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara002, Function | MediumTest | Level1)
{
char* value = GetManufacture();
const char* value = GetManufacture();
printf("Manufacture=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -86,10 +84,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara002, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara003, Function | MediumTest | Level1)
{
char* value = GetBrand();
const char* value = GetBrand();
printf("Brand=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -99,10 +96,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara003, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara004, Function | MediumTest | Level1)
{
char* value = GetMarketName();
const char* value = GetMarketName();
printf("Market Name=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -112,10 +108,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara004, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara005, Function | MediumTest | Level1)
{
char* value = GetProductSeries();
const char* value = GetProductSeries();
printf("Product Series=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -125,10 +120,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara005, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara006, Function | MediumTest | Level1)
{
char* value = GetProductModel();
const char* value = GetProductModel();
printf("Product Model=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -138,10 +132,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara006, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara007, Function | MediumTest | Level1)
{
char* value = GetHardwareModel();
const char* value = GetHardwareModel();
printf("Hardware Model=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -151,10 +144,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara007, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara008, Function | MediumTest | Level1)
{
char* value = GetHardwareProfile();
const char* value = GetHardwareProfile();
printf("Hardware Profile=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -164,7 +156,7 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara008, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara009, Function | MediumTest | Level1)
{
char* value = GetSerial();
const char* value = GetSerial();
printf("Serial=%s\n", value);
if (value == NULL) {
printf("The serial number needs to be written\n");
......@@ -172,7 +164,6 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara009, Function | MediumTe
} else {
TEST_ASSERT_EQUAL_INT(1, 1);
}
free(value);
};
/**
......@@ -182,10 +173,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara009, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara010, Function | MediumTest | Level1)
{
char* value = GetOsName();
const char* value = GetOSFullName();
printf("Os Name=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -195,10 +185,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara010, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara011, Function | MediumTest | Level1)
{
char* value = GetDisplayVersion();
const char* value = GetDisplayVersion();
printf("Display Version=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -208,10 +197,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara011, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara012, Function | MediumTest | Level1)
{
char* value = GetBootloaderVersion();
const char* value = GetBootloaderVersion();
printf("Bootloader Version=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -221,10 +209,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara012, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara013, Function | MediumTest | Level1)
{
char* value = GetSecurityPatchTag();
const char* value = GetSecurityPatchTag();
printf("Secure Patch Level=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -234,10 +221,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara013, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara014, Function | MediumTest | Level1)
{
char* value = GetAbiList();
const char* value = GetAbiList();
printf("Abi List=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -247,10 +233,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara014, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara015, Function | MediumTest | Level1)
{
char* value = GetFirstApiLevel();
printf("First Api Level=%s\n", value);
int value = GetFirstApiVersion();
printf("First Api Level=%d\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -260,10 +245,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara015, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara016, Function | MediumTest | Level1)
{
char* value = GetIncrementalVersion();
const char* value = GetIncrementalVersion();
printf("Incremental Version=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -273,10 +257,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara016, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara017, Function | MediumTest | Level1)
{
char* value = GetVersionId();
const char* value = GetVersionId();
printf("Version Id=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -286,10 +269,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara017, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara018, Function | MediumTest | Level1)
{
char* value = GetBuildType();
const char* value = GetBuildType();
printf("Build Type=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -299,10 +281,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara018, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara019, Function | MediumTest | Level1)
{
char* value = GetBuildUser();
const char* value = GetBuildUser();
printf("Build User=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -312,10 +293,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara019, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara020, Function | MediumTest | Level1)
{
char* value = GetBuildHost();
const char* value = GetBuildHost();
printf("Build Host=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -325,10 +305,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara020, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara021, Function | MediumTest | Level1)
{
char* value = GetBuildTime();
const char* value = GetBuildTime();
printf("Build Time=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -338,10 +317,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara021, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara022, Function | MediumTest | Level1)
{
char* value = GetBuildRootHash();
const char* value = GetBuildRootHash();
printf("Build Root Hash=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -351,10 +329,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara022, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara023, Function | MediumTest | Level1)
{
char* value = GetSoftwareModel();
const char* value = GetSoftwareModel();
printf("Software Model=%s\n", value);
IsEmpty(value);
free(value);
};
/**
......@@ -364,10 +341,9 @@ LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara023, Function | MediumTe
*/
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara024, Function | MediumTest | Level1)
{
char* value = GetSdkApiLevel();
printf("Sdk Api Level=%s\n", value);
int value = GetSdkApiVersion();
printf("Sdk Api Level=%d\n", value);
IsEmpty(value);
free(value);
};
/**
......
......@@ -55,17 +55,14 @@ static BOOL ParameterReliTestSuiteTearDown(void)
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli001, Function | MediumTest | Level1)
{
char* value1 = GetProductType();
const char* value1 = GetDeviceType();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetProductType();
free(value);
const char* value = GetDeviceType();
}
char* value2 = GetProductType();
const char* value2 = GetDeviceType();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -75,17 +72,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli001, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli002, Function | MediumTest | Level1)
{
char* value1 = GetManufacture();
const char* value1 = GetManufacture();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetManufacture();
free(value);
const char* value = GetManufacture();
}
char* value2 = GetManufacture();
const char* value2 = GetManufacture();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -95,17 +89,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli002, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli003, Function | MediumTest | Level1)
{
char* value1 = GetBrand();
const char* value1 = GetBrand();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetBrand();
free(value);
const char* value = GetBrand();
}
char* value2 = GetBrand();
const char* value2 = GetBrand();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -115,17 +106,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli003, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli004, Function | MediumTest | Level1)
{
char* value1 = GetMarketName();
const char* value1 = GetMarketName();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetMarketName();
free(value);
const char* value = GetMarketName();
}
char* value2 = GetMarketName();
const char* value2 = GetMarketName();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -135,17 +123,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli004, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli005, Function | MediumTest | Level1)
{
char* value1 = GetProductSeries();
const char* value1 = GetProductSeries();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetProductSeries();
free(value);
const char* value = GetProductSeries();
}
char* value2 = GetProductSeries();
const char* value2 = GetProductSeries();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -155,17 +140,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli005, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli006, Function | MediumTest | Level1)
{
char* value1 = GetProductModel();
const char* value1 = GetProductModel();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetProductModel();
free(value);
const char* value = GetProductModel();
}
char* value2 = GetProductModel();
const char* value2 = GetProductModel();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -175,17 +157,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli006, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli007, Function | MediumTest | Level1)
{
char* value1 = GetHardwareModel();
const char* value1 = GetHardwareModel();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetHardwareModel();
free(value);
const char* value = GetHardwareModel();
}
char* value2 = GetHardwareModel();
const char* value2 = GetHardwareModel();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -195,17 +174,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli007, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli008, Function | MediumTest | Level1)
{
char* value1 = GetHardwareProfile();
const char* value1 = GetHardwareProfile();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetHardwareProfile();
free(value);
const char* value = GetHardwareProfile();
}
char* value2 = GetHardwareProfile();
const char* value2 = GetHardwareProfile();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -215,20 +191,17 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli008, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli009, Function | MediumTest | Level1)
{
char* value1 = GetSerial();
const char* value1 = GetSerial();
if (value1 == NULL) {
printf("The serial number needs to be written\n");
TEST_IGNORE();
}
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetSerial();
free(value);
const char* value = GetSerial();
}
char* value2 = GetSerial();
const char* value2 = GetSerial();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -238,17 +211,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli009, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli010, Function | MediumTest | Level1)
{
char* value1 = GetOsName();
const char* value1 = GetOSFullName();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetOsName();
free(value);
const char* value = GetOSFullName();
}
char* value2 = GetOsName();
const char* value2 = GetOSFullName();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -258,17 +228,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli010, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli011, Function | MediumTest | Level1)
{
char* value1 = GetDisplayVersion();
const char* value1 = GetDisplayVersion();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetDisplayVersion();
free(value);
const char* value = GetDisplayVersion();
}
char* value2 = GetDisplayVersion();
const char* value2 = GetDisplayVersion();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -278,17 +245,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli011, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli012, Function | MediumTest | Level1)
{
char* value1 = GetBootloaderVersion();
const char* value1 = GetBootloaderVersion();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetBootloaderVersion();
free(value);
const char* value = GetBootloaderVersion();
}
char* value2 = GetBootloaderVersion();
const char* value2 = GetBootloaderVersion();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -298,17 +262,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli012, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli013, Function | MediumTest | Level1)
{
char* value1 = GetSecurityPatchTag();
const char* value1 = GetSecurityPatchTag();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetSecurityPatchTag();
free(value);
const char* value = GetSecurityPatchTag();
}
char* value2 = GetSecurityPatchTag();
const char* value2 = GetSecurityPatchTag();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -318,17 +279,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli013, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli014, Function | MediumTest | Level1)
{
char* value1 = GetAbiList();
const char* value1 = GetAbiList();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetAbiList();
free(value);
const char* value = GetAbiList();
}
char* value2 = GetAbiList();
const char* value2 = GetAbiList();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -338,17 +296,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli014, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli015, Function | MediumTest | Level1)
{
char* value1 = GetFirstApiLevel();
int value1 = GetFirstApiVersion();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetFirstApiLevel();
free(value);
int value = GetFirstApiVersion();
}
char* value2 = GetFirstApiLevel();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
int value2 = GetFirstApiVersion();
TEST_ASSERT_EQUAL_INT(value1, value2);
};
/**
......@@ -358,17 +313,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli015, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli016, Function | MediumTest | Level1)
{
char* value1 = GetIncrementalVersion();
const char* value1 = GetIncrementalVersion();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetIncrementalVersion();
free(value);
const char* value = GetIncrementalVersion();
}
char* value2 = GetIncrementalVersion();
const char* value2 = GetIncrementalVersion();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -378,17 +330,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli016, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli017, Function | MediumTest | Level1)
{
char* value1 = GetVersionId();
const char* value1 = GetVersionId();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetVersionId();
free(value);
const char* value = GetVersionId();
}
char* value2 = GetVersionId();
const char* value2 = GetVersionId();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -398,17 +347,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli017, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli018, Function | MediumTest | Level1)
{
char* value1 = GetBuildType();
const char* value1 = GetBuildType();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetBuildType();
free(value);
const char* value = GetBuildType();
}
char* value2 = GetBuildType();
const char* value2 = GetBuildType();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -418,17 +364,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli018, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli019, Function | MediumTest | Level1)
{
char* value1 = GetBuildUser();
const char* value1 = GetBuildUser();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetBuildUser();
free(value);
const char* value = GetBuildUser();
}
char* value2 = GetBuildUser();
const char* value2 = GetBuildUser();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -438,17 +381,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli019, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli020, Function | MediumTest | Level1)
{
char* value1 = GetBuildHost();
const char* value1 = GetBuildHost();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetBuildHost();
free(value);
const char* value = GetBuildHost();
}
char* value2 = GetBuildHost();
const char* value2 = GetBuildHost();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -458,17 +398,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli020, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli021, Function | MediumTest | Level1)
{
char* value1 = GetBuildTime();
const char* value1 = GetBuildTime();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetBuildTime();
free(value);
const char* value = GetBuildTime();
}
char* value2 = GetBuildTime();
const char* value2 = GetBuildTime();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -478,17 +415,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli021, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli022, Function | MediumTest | Level1)
{
char* value1 = GetBuildRootHash();
const char* value1 = GetBuildRootHash();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetBuildRootHash();
free(value);
const char* value = GetBuildRootHash();
}
char* value2 = GetBuildRootHash();
const char* value2 = GetBuildRootHash();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -498,17 +432,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli022, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli023, Function | MediumTest | Level1)
{
char* value1 = GetSoftwareModel();
const char* value1 = GetSoftwareModel();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetSoftwareModel();
free(value);
const char* value = GetSoftwareModel();
}
char* value2 = GetSoftwareModel();
const char* value2 = GetSoftwareModel();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
};
/**
......@@ -518,17 +449,14 @@ LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli023, Function | Medi
*/
LITE_TEST_CASE(ParameterReliTestSuite, testObtainSysParaReli024, Function | MediumTest | Level1)
{
char* value1 = GetSdkApiLevel();
int value1 = GetSdkApiVersion();
IsEmpty(value1);
for (int i = 0; i < QUERY_TIMES; i++)
{
char* value = GetSdkApiLevel();
free(value);
int value = GetSdkApiVersion();
}
char* value2 = GetSdkApiLevel();
TEST_ASSERT_EQUAL_STRING(value1, value2);
free(value1);
free(value2);
int value2 = GetSdkApiVersion();
TEST_ASSERT_EQUAL_INT(value1, value2);
};
RUN_TEST_SUITE(ParameterReliTestSuite);
......@@ -36,13 +36,13 @@ protected:
virtual void SetUp() {}
virtual void TearDown() {}
string defSysParam = "data of sys param ***...";
using GetRdonlyPara = char* (*)();
using GetRdonlyPara = const char* (*)();
using GetDefParaNode = struct TagGetDefParaNode {
char const *funName;
GetRdonlyPara fun;
};
GetDefParaNode getDefPara[StartUpLite::GET_DEF_PARA_FUN_MAX] = {
{"GetProductType", GetProductType},
{"GetDeviceType", GetDeviceType},
{"GetManufacture", GetManufacture},
{"GetBrand", GetBrand},
{"GetMarketName", GetMarketName},
......@@ -51,13 +51,11 @@ protected:
{"GetSoftwareModel", GetSoftwareModel},
{"GetHardwareModel", GetHardwareModel},
{"GetHardwareProfile", GetHardwareProfile},
{"GetOsName", GetOsName},
{"GetOSFullName", GetOSFullName},
{"GetDisplayVersion", GetDisplayVersion},
{"GetBootloaderVersion", GetBootloaderVersion},
{"GetSecurityPatchTag", GetSecurityPatchTag},
{"GetAbiList", GetAbiList},
{"GetFirstApiLevel", GetFirstApiLevel},
{"GetSdkApiLevel", GetSdkApiLevel},
{"GetIncrementalVersion", GetIncrementalVersion},
{"GetVersionId", GetVersionId},
{"GetBuildType", GetBuildType},
......@@ -355,14 +353,13 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_ilLegal_0060, Function | MediumTe
*/
HWTEST_F(ParameterTest, SUB_START_Para_Getting_ReadOnly_0010, Function | MediumTest | Level0)
{
char *value = nullptr;
const char *value = nullptr;
for (int loop = 0; loop < StartUpLite::GET_DEF_PARA_FUN_MAX; loop++) {
value = getDefPara[loop].fun();
EXPECT_STRNE(value, (char *)nullptr);
if (value != nullptr) {
free(value);
}
}
EXPECT_GT(GetFirstApiVersion(), 0);
EXPECT_GT(GetSdkApiVersion(), 0);
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册