Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6154d926
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6154d926
编写于
4月 20, 2021
作者:
L
lanxueyuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change param api
Change-Id: I9853929b0954f0a52dc13f292ed34e844c02ebf4
上级
cb3e98cc
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
106 addition
and
205 deletion
+106
-205
startup_lite/syspara_hal/src/parameter_func_test.c
startup_lite/syspara_hal/src/parameter_func_test.c
+26
-50
startup_lite/syspara_hal/src/parameter_reli_test.c
startup_lite/syspara_hal/src/parameter_reli_test.c
+74
-146
startup_lite/syspara_posix/src/ParameterTest.cpp
startup_lite/syspara_posix/src/ParameterTest.cpp
+6
-9
未找到文件。
startup_lite/syspara_hal/src/parameter_func_test.c
浏览文件 @
6154d926
...
...
@@ -60,10 +60,9 @@ static BOOL ParameterFuncTestSuiteTearDown(void)
*/
LITE_TEST_CASE
(
ParameterFuncTestSuite
,
testObtainSysPara001
,
Function
|
MediumTest
|
Level1
)
{
c
har
*
value
=
GetProduct
Type
();
c
onst
char
*
value
=
GetDevice
Type
();
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
)
{
c
har
*
value
=
GetOs
Name
();
c
onst
char
*
value
=
GetOSFull
Name
();
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
);
};
/**
...
...
startup_lite/syspara_hal/src/parameter_reli_test.c
浏览文件 @
6154d926
...
...
@@ -55,17 +55,14 @@ static BOOL ParameterReliTestSuiteTearDown(void)
*/
LITE_TEST_CASE
(
ParameterReliTestSuite
,
testObtainSysParaReli001
,
Function
|
MediumTest
|
Level1
)
{
c
har
*
value1
=
GetProduct
Type
();
c
onst
char
*
value1
=
GetDevice
Type
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetProductType
();
free
(
value
);
const
char
*
value
=
GetDeviceType
();
}
c
har
*
value2
=
GetProduct
Type
();
c
onst
char
*
value2
=
GetDevice
Type
();
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
();
c
onst
c
har
*
value1
=
GetManufacture
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetManufacture
();
free
(
value
);
const
char
*
value
=
GetManufacture
();
}
char
*
value2
=
GetManufacture
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetBrand
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetBrand
();
free
(
value
);
const
char
*
value
=
GetBrand
();
}
char
*
value2
=
GetBrand
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetMarketName
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetMarketName
();
free
(
value
);
const
char
*
value
=
GetMarketName
();
}
char
*
value2
=
GetMarketName
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetProductSeries
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetProductSeries
();
free
(
value
);
const
char
*
value
=
GetProductSeries
();
}
char
*
value2
=
GetProductSeries
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetProductModel
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetProductModel
();
free
(
value
);
const
char
*
value
=
GetProductModel
();
}
char
*
value2
=
GetProductModel
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetHardwareModel
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetHardwareModel
();
free
(
value
);
const
char
*
value
=
GetHardwareModel
();
}
char
*
value2
=
GetHardwareModel
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetHardwareProfile
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetHardwareProfile
();
free
(
value
);
const
char
*
value
=
GetHardwareProfile
();
}
char
*
value2
=
GetHardwareProfile
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
();
c
onst
c
har
*
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
)
{
c
har
*
value1
=
GetOs
Name
();
c
onst
char
*
value1
=
GetOSFull
Name
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetOsName
();
free
(
value
);
const
char
*
value
=
GetOSFullName
();
}
c
har
*
value2
=
GetOs
Name
();
c
onst
char
*
value2
=
GetOSFull
Name
();
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
();
c
onst
c
har
*
value1
=
GetDisplayVersion
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetDisplayVersion
();
free
(
value
);
const
char
*
value
=
GetDisplayVersion
();
}
char
*
value2
=
GetDisplayVersion
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetBootloaderVersion
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetBootloaderVersion
();
free
(
value
);
const
char
*
value
=
GetBootloaderVersion
();
}
char
*
value2
=
GetBootloaderVersion
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetSecurityPatchTag
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetSecurityPatchTag
();
free
(
value
);
const
char
*
value
=
GetSecurityPatchTag
();
}
char
*
value2
=
GetSecurityPatchTag
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetAbiList
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetAbiList
();
free
(
value
);
const
char
*
value
=
GetAbiList
();
}
char
*
value2
=
GetAbiList
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetIncrementalVersion
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetIncrementalVersion
();
free
(
value
);
const
char
*
value
=
GetIncrementalVersion
();
}
char
*
value2
=
GetIncrementalVersion
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetVersionId
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetVersionId
();
free
(
value
);
const
char
*
value
=
GetVersionId
();
}
char
*
value2
=
GetVersionId
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetBuildType
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetBuildType
();
free
(
value
);
const
char
*
value
=
GetBuildType
();
}
char
*
value2
=
GetBuildType
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetBuildUser
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetBuildUser
();
free
(
value
);
const
char
*
value
=
GetBuildUser
();
}
char
*
value2
=
GetBuildUser
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetBuildHost
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetBuildHost
();
free
(
value
);
const
char
*
value
=
GetBuildHost
();
}
char
*
value2
=
GetBuildHost
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetBuildTime
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetBuildTime
();
free
(
value
);
const
char
*
value
=
GetBuildTime
();
}
char
*
value2
=
GetBuildTime
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetBuildRootHash
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetBuildRootHash
();
free
(
value
);
const
char
*
value
=
GetBuildRootHash
();
}
char
*
value2
=
GetBuildRootHash
();
c
onst
c
har
*
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
();
c
onst
c
har
*
value1
=
GetSoftwareModel
();
IsEmpty
(
value1
);
for
(
int
i
=
0
;
i
<
QUERY_TIMES
;
i
++
)
{
char
*
value
=
GetSoftwareModel
();
free
(
value
);
const
char
*
value
=
GetSoftwareModel
();
}
char
*
value2
=
GetSoftwareModel
();
c
onst
c
har
*
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
);
startup_lite/syspara_posix/src/ParameterTest.cpp
浏览文件 @
6154d926
...
...
@@ -36,13 +36,13 @@ protected:
virtual
void
SetUp
()
{}
virtual
void
TearDown
()
{}
string
defSysParam
=
"data of sys param ***..."
;
using
GetRdonlyPara
=
char
*
(
*
)();
using
GetRdonlyPara
=
c
onst
c
har
*
(
*
)();
using
GetDefParaNode
=
struct
TagGetDefParaNode
{
char
const
*
funName
;
GetRdonlyPara
fun
;
};
GetDefParaNode
getDefPara
[
StartUpLite
::
GET_DEF_PARA_FUN_MAX
]
=
{
{
"Get
ProductType"
,
GetProduct
Type
},
{
"Get
DeviceType"
,
GetDevice
Type
},
{
"GetManufacture"
,
GetManufacture
},
{
"GetBrand"
,
GetBrand
},
{
"GetMarketName"
,
GetMarketName
},
...
...
@@ -51,13 +51,11 @@ protected:
{
"GetSoftwareModel"
,
GetSoftwareModel
},
{
"GetHardwareModel"
,
GetHardwareModel
},
{
"GetHardwareProfile"
,
GetHardwareProfile
},
{
"GetO
sName"
,
GetOs
Name
},
{
"GetO
SFullName"
,
GetOSFull
Name
},
{
"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
;
c
onst
c
har
*
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录