Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
20c0bc25
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看板
未验证
提交
20c0bc25
编写于
6月 24, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3587 l1部分接口适配
Merge pull request !3587 from Mupceet/l1adp
上级
e7761e8d
2504fdb2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
22 deletion
+18
-22
startup_lite/syspara_posix/src/ParameterTest.cpp
startup_lite/syspara_posix/src/ParameterTest.cpp
+18
-22
未找到文件。
startup_lite/syspara_posix/src/ParameterTest.cpp
浏览文件 @
20c0bc25
...
@@ -21,7 +21,7 @@ using namespace testing::ext;
...
@@ -21,7 +21,7 @@ using namespace testing::ext;
namespace
StartUpLite
{
namespace
StartUpLite
{
static
const
int
GET_DEF_PARA_FUN_MAX
=
22
;
static
const
int
GET_DEF_PARA_FUN_MAX
=
22
;
static
const
int
MAX_LEN
=
128
;
static
const
int
MAX_LEN
=
96
;
static
const
int
WRONG_LEN
=
2
;
static
const
int
WRONG_LEN
=
2
;
class
ParameterTest
:
public
testing
::
Test
{
class
ParameterTest
:
public
testing
::
Test
{
...
@@ -92,14 +92,13 @@ HWTEST_F(ParameterTest, SUB_START_Para_Setting_Legal_0020, Function | MediumTest
...
@@ -92,14 +92,13 @@ HWTEST_F(ParameterTest, SUB_START_Para_Setting_Legal_0020, Function | MediumTest
{
{
int
ret
;
int
ret
;
char
key1
[]
=
"rw.sys.version.version.version
.
"
;
char
key1
[]
=
"rw.sys.version.version.version"
;
char
value1
[]
=
"set with key = 31"
;
char
value1
[]
=
"set with key = 31"
;
ret
=
SetParameter
(
key1
,
value1
);
ret
=
SetParameter
(
key1
,
value1
);
EXPECT_EQ
(
ret
,
0
);
EXPECT_EQ
(
ret
,
0
);
char
key2
[]
=
"rw.sys.version.version"
;
char
key2
[]
=
"rw.sys.version.version"
;
char
value2
[]
=
"abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890\
char
value2
[]
=
"abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuv"
;
abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrs"
;
ret
=
SetParameter
(
key2
,
value2
);
ret
=
SetParameter
(
key2
,
value2
);
EXPECT_EQ
(
ret
,
0
);
EXPECT_EQ
(
ret
,
0
);
}
}
...
@@ -135,20 +134,20 @@ HWTEST_F(ParameterTest, SUB_START_Para_Setting_ilLegal_0020, Function | MediumTe
...
@@ -135,20 +134,20 @@ HWTEST_F(ParameterTest, SUB_START_Para_Setting_ilLegal_0020, Function | MediumTe
/**
/**
* @tc.number : SUB_START_Para_Setting_ilLegal_key_0010
* @tc.number : SUB_START_Para_Setting_ilLegal_key_0010
* @tc.name : SetParameter legal test with key
32 or more than 32
bytes
* @tc.name : SetParameter legal test with key
96 or more than 96
bytes
* @tc.desc : [C- SOFTWARE -0200]
* @tc.desc : [C- SOFTWARE -0200]
*/
*/
HWTEST_F
(
ParameterTest
,
SUB_START_Para_Setting_ilLegal_key_0010
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ParameterTest
,
SUB_START_Para_Setting_ilLegal_key_0010
,
Function
|
MediumTest
|
Level2
)
{
{
int
ret
;
int
ret
;
char
key1
[]
=
"rw.sys.version.version.version.v"
;
char
key1
[]
=
"rw.sys.version.version.version.v
ersion.version.version.version.version.version.version.version.v
"
;
char
value1
[]
=
"set with key =
32
"
;
char
value1
[]
=
"set with key =
96
"
;
ret
=
SetParameter
(
key1
,
value1
);
ret
=
SetParameter
(
key1
,
value1
);
EXPECT_EQ
(
ret
,
-
9
);
EXPECT_EQ
(
ret
,
-
9
);
char
key2
[]
=
"rw.sys.version.version.version.version"
;
char
key2
[]
=
"rw.sys.version.version.version.version
.version.version.version.version.version.version.version.v1
"
;
char
value2
[]
=
"set with key >
32
"
;
char
value2
[]
=
"set with key >
96
"
;
ret
=
SetParameter
(
key2
,
value2
);
ret
=
SetParameter
(
key2
,
value2
);
EXPECT_EQ
(
ret
,
-
9
);
EXPECT_EQ
(
ret
,
-
9
);
}
}
...
@@ -170,7 +169,7 @@ HWTEST_F(ParameterTest, SUB_START_Para_Setting_ilLegal_key_0030, Function | Medi
...
@@ -170,7 +169,7 @@ HWTEST_F(ParameterTest, SUB_START_Para_Setting_ilLegal_key_0030, Function | Medi
/**
/**
* @tc.number : SUB_START_Para_Setting_ilLegal_value_0010
* @tc.number : SUB_START_Para_Setting_ilLegal_value_0010
* @tc.name : SetParameter legal test with value is
128 or more than 128
bytes
* @tc.name : SetParameter legal test with value is
96 or more than 96
bytes
* @tc.desc : [C- SOFTWARE -0200]
* @tc.desc : [C- SOFTWARE -0200]
*/
*/
HWTEST_F
(
ParameterTest
,
SUB_START_Para_Setting_ilLegal_value_0010
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ParameterTest
,
SUB_START_Para_Setting_ilLegal_value_0010
,
Function
|
MediumTest
|
Level2
)
...
@@ -178,14 +177,12 @@ HWTEST_F(ParameterTest, SUB_START_Para_Setting_ilLegal_value_0010, Function | Me
...
@@ -178,14 +177,12 @@ HWTEST_F(ParameterTest, SUB_START_Para_Setting_ilLegal_value_0010, Function | Me
int
ret
;
int
ret
;
char
key1
[]
=
"rw.sys.version.version"
;
char
key1
[]
=
"rw.sys.version.version"
;
char
value1
[]
=
"abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890\
char
value1
[]
=
"abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuv11"
;
abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrst"
;
ret
=
SetParameter
(
key1
,
value1
);
ret
=
SetParameter
(
key1
,
value1
);
EXPECT_EQ
(
ret
,
-
9
);
EXPECT_EQ
(
ret
,
-
9
);
char
key2
[]
=
"rw.sys.version.version"
;
char
key2
[]
=
"rw.sys.version.version"
;
char
value2
[]
=
"abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890\
char
value2
[]
=
"abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuv222"
;
abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890"
;
ret
=
SetParameter
(
key2
,
value2
);
ret
=
SetParameter
(
key2
,
value2
);
EXPECT_EQ
(
ret
,
-
9
);
EXPECT_EQ
(
ret
,
-
9
);
}
}
...
@@ -228,14 +225,14 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_Legal_0020, Function | MediumTest
...
@@ -228,14 +225,14 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_Legal_0020, Function | MediumTest
/**
/**
* @tc.number : SUB_START_Para_Getting_Legal_0030
* @tc.number : SUB_START_Para_Getting_Legal_0030
* @tc.name : GetParameter legal test with length is
31 bytes, value is 127
bytes
* @tc.name : GetParameter legal test with length is
95 bytes, value is 95
bytes
* @tc.desc : [C- SOFTWARE -0200]
* @tc.desc : [C- SOFTWARE -0200]
*/
*/
HWTEST_F
(
ParameterTest
,
SUB_START_Para_Getting_Legal_0030
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ParameterTest
,
SUB_START_Para_Getting_Legal_0030
,
Function
|
MediumTest
|
Level0
)
{
{
int
ret
;
int
ret
;
char
key1
[]
=
"rw.sys.version.version.version
.
"
;
char
key1
[]
=
"rw.sys.version.version.version"
;
char
rightVal1
[]
=
"set with key = 31"
;
char
rightVal1
[]
=
"set with key = 31"
;
char
value1
[
StartUpLite
::
MAX_LEN
]
=
{
0
};
char
value1
[
StartUpLite
::
MAX_LEN
]
=
{
0
};
ret
=
GetParameter
(
key1
,
defSysParam
.
c_str
(),
value1
,
StartUpLite
::
MAX_LEN
);
ret
=
GetParameter
(
key1
,
defSysParam
.
c_str
(),
value1
,
StartUpLite
::
MAX_LEN
);
...
@@ -244,8 +241,7 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_Legal_0030, Function | MediumTest
...
@@ -244,8 +241,7 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_Legal_0030, Function | MediumTest
EXPECT_STREQ
(
value1
,
rightVal1
);
EXPECT_STREQ
(
value1
,
rightVal1
);
char
key2
[]
=
"rw.sys.version.version"
;
char
key2
[]
=
"rw.sys.version.version"
;
char
rightVal2
[]
=
"abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890\
char
rightVal2
[]
=
"abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuv"
;
abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrs"
;
char
value2
[
StartUpLite
::
MAX_LEN
]
=
{
0
};
char
value2
[
StartUpLite
::
MAX_LEN
]
=
{
0
};
ret
=
GetParameter
(
key2
,
defSysParam
.
c_str
(),
value2
,
StartUpLite
::
MAX_LEN
);
ret
=
GetParameter
(
key2
,
defSysParam
.
c_str
(),
value2
,
StartUpLite
::
MAX_LEN
);
value2
[
MAX_LEN
-
1
]
=
'\0'
;
value2
[
MAX_LEN
-
1
]
=
'\0'
;
...
@@ -300,12 +296,12 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_ilLegal_0030, Function | MediumTe
...
@@ -300,12 +296,12 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_ilLegal_0030, Function | MediumTe
char
value2
[
StartUpLite
::
WRONG_LEN
]
=
{
0
};
char
value2
[
StartUpLite
::
WRONG_LEN
]
=
{
0
};
ret
=
GetParameter
(
key1
,
defSysParam
.
c_str
(),
value2
,
StartUpLite
::
WRONG_LEN
);
ret
=
GetParameter
(
key1
,
defSysParam
.
c_str
(),
value2
,
StartUpLite
::
WRONG_LEN
);
EXPECT_EQ
(
ret
,
-
1
);
EXPECT_EQ
(
ret
,
-
9
);
}
}
/**
/**
* @tc.number : SUB_START_Para_Getting_ilLegal_0040
* @tc.number : SUB_START_Para_Getting_ilLegal_0040
* @tc.name : GetParameter legal test with key is
32
bytes
* @tc.name : GetParameter legal test with key is
96
bytes
* @tc.desc : [C- SOFTWARE -0200]
* @tc.desc : [C- SOFTWARE -0200]
*/
*/
HWTEST_F
(
ParameterTest
,
SUB_START_Para_Getting_ilLegal_0040
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ParameterTest
,
SUB_START_Para_Getting_ilLegal_0040
,
Function
|
MediumTest
|
Level2
)
...
@@ -315,7 +311,7 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_ilLegal_0040, Function | MediumTe
...
@@ -315,7 +311,7 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_ilLegal_0040, Function | MediumTe
char
key
[]
=
"rw.sys.version.version.version.v"
;
char
key
[]
=
"rw.sys.version.version.version.v"
;
char
value
[
StartUpLite
::
MAX_LEN
]
=
{
0
};
char
value
[
StartUpLite
::
MAX_LEN
]
=
{
0
};
ret
=
GetParameter
(
key
,
defSysParam
.
c_str
(),
value
,
StartUpLite
::
MAX_LEN
);
ret
=
GetParameter
(
key
,
defSysParam
.
c_str
(),
value
,
StartUpLite
::
MAX_LEN
);
EXPECT_
EQ
(
ret
,
-
9
);
EXPECT_
STREQ
(
value
,
defSysParam
.
c_str
()
);
}
}
/**
/**
...
@@ -344,7 +340,7 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_ilLegal_0060, Function | MediumTe
...
@@ -344,7 +340,7 @@ HWTEST_F(ParameterTest, SUB_START_Para_Getting_ilLegal_0060, Function | MediumTe
char
key
[]
=
"rw.sys.version*%version"
;
char
key
[]
=
"rw.sys.version*%version"
;
char
value
[
StartUpLite
::
MAX_LEN
]
=
{
0
};
char
value
[
StartUpLite
::
MAX_LEN
]
=
{
0
};
ret
=
GetParameter
(
key
,
defSysParam
.
c_str
(),
value
,
StartUpLite
::
MAX_LEN
);
ret
=
GetParameter
(
key
,
defSysParam
.
c_str
(),
value
,
StartUpLite
::
MAX_LEN
);
EXPECT_
EQ
(
ret
,
-
9
);
EXPECT_
STREQ
(
value
,
defSysParam
.
c_str
()
);
}
}
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录