Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
60d3f6d5
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
464
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
60d3f6d5
编写于
11月 04, 2021
作者:
O
openharmony_ci
提交者:
Gitee
11月 04, 2021
浏览文件
操作
浏览文件
下载
差异文件
!689 PR666 关于sys用例修复挑单到3.0TLS
Merge pull request !689 from pef/OpenHarmony-3.0-LTS_sys_test
上级
44279b25
f249db75
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
398 addition
and
248 deletion
+398
-248
testsuites/unittest/common/include/osTest.h
testsuites/unittest/common/include/osTest.h
+2
-17
testsuites/unittest/common/osTest.cpp
testsuites/unittest/common/osTest.cpp
+64
-0
testsuites/unittest/sys/It_test_sys.h
testsuites/unittest/sys/It_test_sys.h
+3
-1
testsuites/unittest/sys/full/sys_test_018.cpp
testsuites/unittest/sys/full/sys_test_018.cpp
+42
-27
testsuites/unittest/sys/full/sys_test_019.cpp
testsuites/unittest/sys/full/sys_test_019.cpp
+55
-41
testsuites/unittest/sys/full/sys_test_020.cpp
testsuites/unittest/sys/full/sys_test_020.cpp
+44
-29
testsuites/unittest/sys/full/sys_test_021.cpp
testsuites/unittest/sys/full/sys_test_021.cpp
+64
-50
testsuites/unittest/sys/full/sys_test_022.cpp
testsuites/unittest/sys/full/sys_test_022.cpp
+44
-27
testsuites/unittest/sys/full/sys_test_023.cpp
testsuites/unittest/sys/full/sys_test_023.cpp
+31
-15
testsuites/unittest/sys/full/sys_test_025.cpp
testsuites/unittest/sys/full/sys_test_025.cpp
+27
-33
testsuites/unittest/sys/full/sys_test_028.cpp
testsuites/unittest/sys/full/sys_test_028.cpp
+15
-5
testsuites/unittest/sys/sys_unit_test.cpp
testsuites/unittest/sys/sys_unit_test.cpp
+7
-3
未找到文件。
testsuites/unittest/common/include/osTest.h
浏览文件 @
60d3f6d5
...
...
@@ -107,6 +107,8 @@
#define HWI_NUM_INTVALID OS_HWI_MAX_NUM
#define writel(value, address) WRITE_UINT32(value, address)
extern
UINT32
PrepareFileEnv
(
CHAR
*
pathList
[],
CHAR
*
streamList
[],
INT32
streamLen
[],
INT32
listCnt
);
extern
UINT32
RecoveryFileEnv
(
CHAR
*
pathList
[],
INT32
listCnt
);
extern
UINT32
PosixPthreadInit
(
pthread_attr_t
*
attr
,
int
pri
);
extern
UINT32
PosixPthreadDestroy
(
pthread_attr_t
*
attr
,
pthread_t
thread
);
...
...
@@ -233,18 +235,6 @@ UINT32 LosTaskDelay(UINT32 tick);
#define TEST_TASKDELAY_20TICK 20
#define TEST_TASKDELAY_50TICK 50
#ifdef TEST3731
#define TestTimer2ValueGet(temp) READ_UINT32(temp, TIMER1_REG_BASE + TIMER_VALUE)
#elif defined TEST3559
#define TestTimer2ValueGet(temp) READ_UINT32(temp, TIMER3_REG_BASE + TIMER_VALUE)
#else
#define TestTimer2ValueGet(temp) READ_UINT32(temp, TIMER2_REG_BASE + TIMER_VALUE)
#endif
extern
void
TestTimer2Config
(
void
);
#define REALTIME(time) (UINT32)((UINT64)(0xffffffff - time) * 1000 / OS_SYS_CLOCK)
/* accuracy:ms */
#define HW_TMI(time) (UINT32)((UINT64)(0xffffffff - time) * 1000 / (OS_SYS_CLOCK / 1000000))
/* accuracy:ns */
#define uart_printf_func printf
#ifndef VFS_STAT_PRINTF
...
...
@@ -268,7 +258,6 @@ extern void TestTimer2Config(void);
#endif
extern
UINT32
g_shellTestQueueID
;
extern
int
g_min_mempool_size
;
extern
UINT32
g_testCount
;
extern
UINT32
g_testCount1
;
extern
UINT32
g_testCount2
;
...
...
@@ -400,10 +389,6 @@ void Test_usb_shellcmd(controller_type ctype, device_type dtype, usb_test_type t
extern
int
Gettid
(
void
);
#define COLOR(c) "\033[" c "m"
#define COLOR_RED(text) COLOR("1;31") text COLOR("0")
#define COLOR_GREEN(text) COLOR("1;32") text COLOR("0")
/* like the ctime/asctime api, use static buffer, though not thread-safe. */
static
inline
const
char
*
Curtime
()
{
...
...
testsuites/unittest/common/osTest.cpp
浏览文件 @
60d3f6d5
...
...
@@ -129,6 +129,70 @@ VOID test_init_spinor(VOID);
VOID
test_deinit_jffs
(
VOID
);
VOID
test_mtd_jffs
(
VOID
);
UINT32
PrepareFileEnv
(
CHAR
*
pathList
[],
CHAR
*
streamList
[],
INT32
streamLen
[],
INT32
listCnt
)
{
CHAR
nameBuf
[
256
]
=
{
0
};
for
(
UINT32
i
=
0
;
i
<
listCnt
;
i
++
)
{
UINT32
ret
=
access
(
pathList
[
i
],
0
);
if
(
ret
==
0
)
{
ret
=
memcpy_s
(
nameBuf
,
sizeof
(
nameBuf
),
pathList
[
i
],
strlen
(
pathList
[
i
])
+
1
);
if
(
ret
!=
0
)
{
return
-
1
;
}
ret
=
strcat_s
(
nameBuf
,
sizeof
(
nameBuf
),
"_bak_for_test"
);
if
(
ret
!=
0
)
{
return
-
1
;
}
ret
=
rename
(
pathList
[
i
],
nameBuf
);
if
(
ret
!=
0
)
{
return
-
1
;
}
}
FILE
*
fp
=
fopen
(
pathList
[
i
],
"w"
);
if
(
fp
==
NULL
)
{
return
-
1
;
}
ret
=
fwrite
(
streamList
[
i
],
1
,
streamLen
[
i
],
fp
);
if
(
ret
!=
streamLen
[
i
])
{
(
VOID
)
fclose
(
fp
);
return
-
1
;
}
ret
=
fclose
(
fp
);
if
(
ret
!=
0
)
{
printf
(
"%d
\n
"
,
errno
);
}
}
return
0
;
}
UINT32
RecoveryFileEnv
(
CHAR
*
pathList
[],
INT32
listCnt
)
{
UINT32
ret
;
CHAR
nameBuf
[
256
]
=
{
0
};
for
(
UINT32
i
=
0
;
i
<
listCnt
;
i
++
)
{
ret
=
remove
(
pathList
[
i
]);
if
(
ret
!=
0
)
{
printf
(
"ret = %d, err = %d
\n
"
,
ret
,
errno
);
}
ret
=
memcpy_s
(
nameBuf
,
sizeof
(
nameBuf
),
pathList
[
i
],
strlen
(
pathList
[
i
])
+
1
);
if
(
ret
!=
0
)
{
return
-
1
;
}
ret
=
strcat_s
(
nameBuf
,
sizeof
(
nameBuf
),
"_bak_for_test"
);
if
(
ret
!=
0
)
{
return
-
1
;
}
ret
=
access
(
nameBuf
,
0
);
if
(
ret
==
0
)
{
ret
=
rename
(
nameBuf
,
pathList
[
i
]);
if
(
ret
!=
0
)
{
return
-
1
;
}
}
}
return
0
;
}
VOID
Wfi
(
VOID
)
{
__asm__
__volatile__
(
"wfi"
:
:
:
"memory"
);
...
...
testsuites/unittest/sys/It_test_sys.h
浏览文件 @
60d3f6d5
...
...
@@ -51,6 +51,8 @@
#define FE_UPWARD 0x800
#define FE_TOWARDZERO 0xc00
extern
CHAR
*
g_groupFileStream
;
extern
CHAR
*
g_passwdFileStream
;
extern
VOID
ItTestSys001
(
VOID
);
extern
VOID
IT_TEST_SYS_002
(
VOID
);
extern
VOID
IT_TEST_SYS_003
(
VOID
);
...
...
@@ -78,7 +80,7 @@ extern VOID ItTestSys024(VOID);
extern
VOID
ItTestSys025
(
VOID
);
extern
VOID
ItTestSys026
(
VOID
);
extern
VOID
ItTestSys027
(
VOID
);
extern
VOID
I
T_TEST_SYS_
028
(
VOID
);
extern
VOID
I
tTestSys
028
(
VOID
);
extern
VOID
ItTestSys029
(
VOID
);
extern
VOID
IT_TEST_SYS_030
(
VOID
);
extern
VOID
IT_TEST_SYS_031
(
VOID
);
...
...
testsuites/unittest/sys/full/sys_test_018.cpp
浏览文件 @
60d3f6d5
...
...
@@ -30,51 +30,66 @@
*/
#include "It_test_sys.h"
static
UINT32
TestCase
(
VOID
)
STATIC
UINT32
TestCase
(
VOID
)
{
struct
passwd
*
user1
=
nullptr
;
struct
passwd
*
user2
=
nullptr
;
struct
passwd
*
user3
=
nullptr
;
struct
passwd
*
user4
=
nullptr
;
INT32
ret
;
CHAR
*
pathList
[]
=
{
"/etc/group"
,
"/etc/passwd"
};
CHAR
*
streamList
[]
=
{
g_groupFileStream
,
g_passwdFileStream
};
INT32
streamLen
[]
=
{
strlen
(
g_groupFileStream
),
strlen
(
g_passwdFileStream
)};
ret
=
PrepareFileEnv
(
pathList
,
streamList
,
streamLen
,
2
);
/* 2, group & passwd */
if
(
ret
!=
0
)
{
printf
(
"error: need some env file, but prepare is not ok"
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
user1
=
getpwnam
(
"root"
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user1
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user1
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
,
ERROUT
);
user2
=
getpwnam
(
"daemon"
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user2
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_name
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user2
->
pw_uid
,
1
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user2
->
pw_gid
,
1
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_gecos
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_dir
,
"/usr/sbin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user2
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_name
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user2
->
pw_uid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user2
->
pw_gid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_gecos
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_dir
,
"/usr/sbin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
user3
=
getpwnam
(
"bin"
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user3
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_name
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user3
->
pw_uid
,
2
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user3
->
pw_gid
,
2
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_gecos
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_dir
,
"/bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user3
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_name
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user3
->
pw_uid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_EQUAL
(
user3
->
pw_gid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_gecos
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_dir
,
"/bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
user4
=
getpwnam
(
"lyw"
);
ICUNIT_
ASSERT_EQUAL
(
user4
,
nullptr
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
user4
,
nullptr
,
-
1
,
ERROUT
);
user4
=
getpwnam
(
""
);
ICUNIT_
ASSERT_EQUAL
(
user4
,
nullptr
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
user4
,
nullptr
,
-
1
,
ERROUT
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
0
;
ERROUT:
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
VOID
ItTestSys018
(
VOID
)
...
...
testsuites/unittest/sys/full/sys_test_019.cpp
浏览文件 @
60d3f6d5
...
...
@@ -30,7 +30,7 @@
*/
#include "It_test_sys.h"
static
UINT32
TestCase
(
VOID
)
STATIC
UINT32
TestCase
(
VOID
)
{
struct
passwd
pwd
;
struct
passwd
*
user1
=
nullptr
;
...
...
@@ -38,61 +38,75 @@ static UINT32 TestCase(VOID)
struct
passwd
*
user3
=
nullptr
;
struct
passwd
*
user4
=
nullptr
;
struct
passwd
*
user5
=
nullptr
;
char
buf1
[
1024
]
=
{
0
};
char
buf2
[
2
]
=
{
0
};
int
ret
;
CHAR
buf1
[
1024
]
=
{
0
};
/* 1024, buffer for test */
CHAR
buf2
[
2
]
=
{
0
};
/* 2, for test,this buffer is not enough large to save data */
INT32
ret
;
CHAR
*
pathList
[]
=
{
"/etc/group"
,
"/etc/passwd"
};
CHAR
*
streamList
[]
=
{
g_groupFileStream
,
g_passwdFileStream
};
INT32
streamLen
[]
=
{
strlen
(
g_groupFileStream
),
strlen
(
g_passwdFileStream
)};
ret
=
PrepareFileEnv
(
pathList
,
streamList
,
streamLen
,
2
);
/* 2, group & passwd */
if
(
ret
!=
0
)
{
printf
(
"error: need some env file, but prepare is not ok"
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
ret
=
getpwnam_r
(
"root"
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user1
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user1
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
ret
,
0
,
ret
,
ERROUT
);
ICUNIT_
GOTO_NOT_EQUAL
(
user1
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
,
ERROUT
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_name
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
pwd
.
pw_uid
,
0
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
pwd
.
pw_gid
,
0
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_gecos
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_dir
,
"/root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_shell
,
"/bin/bash"
,
-
1
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_name
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
pwd
.
pw_uid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
pwd
.
pw_gid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_gecos
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_dir
,
"/root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_shell
,
"/bin/bash"
,
-
1
,
ERROUT
);
ret
=
getpwnam_r
(
"daemon"
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user2
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user2
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_name
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user2
->
pw_uid
,
1
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user2
->
pw_gid
,
1
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_gecos
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_dir
,
"/usr/sbin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user2
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_name
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user2
->
pw_uid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user2
->
pw_gid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_gecos
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_dir
,
"/usr/sbin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
ret
=
getpwnam_r
(
"bin"
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user3
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user3
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_name
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user3
->
pw_uid
,
2
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user3
->
pw_gid
,
2
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_gecos
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_dir
,
"/bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user3
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_name
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user3
->
pw_uid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_EQUAL
(
user3
->
pw_gid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_gecos
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_dir
,
"/bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
ret
=
getpwnam_r
(
"root"
,
&
pwd
,
buf2
,
sizeof
(
buf2
),
&
user4
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
ERANGE
,
ret
);
ICUNIT_
ASSERT_EQUAL
(
user4
,
nullptr
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
ret
,
ERANGE
,
ret
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user4
,
nullptr
,
-
1
,
ERROUT
);
ret
=
getpwnam_r
(
nullptr
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
0
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
ret
,
0
,
-
1
,
ERROUT
);
ret
=
getpwnam_r
(
""
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
ICUNIT_
ASSERT_NOT_EQUAL
(
ret
,
0
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
ret
,
0
,
-
1
,
ERROUT
);
ret
=
getpwnam_r
(
"sssssss"
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
ICUNIT_
ASSERT_NOT_EQUAL
(
ret
,
0
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
ret
,
0
,
-
1
,
ERROUT
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
0
;
ERROUT:
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
VOID
ItTestSys019
(
VOID
)
...
...
testsuites/unittest/sys/full/sys_test_020.cpp
浏览文件 @
60d3f6d5
...
...
@@ -30,53 +30,68 @@
*/
#include "It_test_sys.h"
static
UINT32
TestCase
(
VOID
)
STATIC
UINT32
TestCase
(
VOID
)
{
struct
passwd
*
user1
=
nullptr
;
struct
passwd
*
user2
=
nullptr
;
struct
passwd
*
user3
=
nullptr
;
struct
passwd
*
user4
=
nullptr
;
INT32
ret
;
CHAR
*
pathList
[]
=
{
"/etc/group"
,
"/etc/passwd"
};
CHAR
*
streamList
[]
=
{
g_groupFileStream
,
g_passwdFileStream
};
INT32
streamLen
[]
=
{
strlen
(
g_groupFileStream
),
strlen
(
g_passwdFileStream
)};
ret
=
PrepareFileEnv
(
pathList
,
streamList
,
streamLen
,
2
);
/* 2, group & passwd */
if
(
ret
!=
0
)
{
printf
(
"error: need some env file, but prepare is not ok"
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
user1
=
getpwuid
(
0
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user1
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user1
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
,
ERROUT
);
user2
=
getpwuid
(
1
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user2
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_name
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user2
->
pw_uid
,
1
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user2
->
pw_gid
,
1
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_gecos
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_dir
,
"/usr/sbin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user2
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_name
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user2
->
pw_uid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user2
->
pw_gid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_gecos
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_dir
,
"/usr/sbin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
user3
=
getpwuid
(
2
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user3
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_name
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user3
->
pw_uid
,
2
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user3
->
pw_gid
,
2
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_gecos
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_dir
,
"/bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
user3
=
getpwuid
(
2
);
/* 2, from etc/group */
ICUNIT_
GOTO_NOT_EQUAL
(
user3
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_name
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user3
->
pw_uid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_EQUAL
(
user3
->
pw_gid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_gecos
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_dir
,
"/bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
user4
=
getpwuid
(
200
);
ICUNIT_
ASSERT_EQUAL
(
user4
,
nullptr
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
user4
,
nullptr
,
-
1
,
ERROUT
);
user4
=
getpwuid
(
-
100
);
ICUNIT_
ASSERT_EQUAL
(
user4
,
nullptr
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
user4
,
nullptr
,
-
1
,
ERROUT
);
user4
=
getpwuid
(
100000
);
ICUNIT_
ASSERT_EQUAL
(
user4
,
nullptr
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
user4
,
nullptr
,
-
1
,
ERROUT
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
0
;
ERROUT:
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
VOID
ItTestSys020
(
VOID
)
...
...
testsuites/unittest/sys/full/sys_test_021.cpp
浏览文件 @
60d3f6d5
...
...
@@ -30,7 +30,7 @@
*/
#include "It_test_sys.h"
static
UINT32
TestCase
(
VOID
)
STATIC
UINT32
TestCase
(
VOID
)
{
struct
passwd
pwd
;
struct
passwd
*
user1
=
nullptr
;
...
...
@@ -38,69 +38,83 @@ static UINT32 TestCase(VOID)
struct
passwd
*
user3
=
nullptr
;
struct
passwd
*
user4
=
nullptr
;
struct
passwd
*
user5
=
nullptr
;
char
buf1
[
1024
]
=
{
0
};
char
buf2
[
2
]
=
{
0
};
int
ret
;
CHAR
buf1
[
1024
]
=
{
0
};
/* 1024, buffer for test */
CHAR
buf2
[
2
]
=
{
0
};
/* 2, for test,this buffer is not enough large to save data */
INT32
ret
;
CHAR
*
pathList
[]
=
{
"/etc/group"
,
"/etc/passwd"
};
CHAR
*
streamList
[]
=
{
g_groupFileStream
,
g_passwdFileStream
};
INT32
streamLen
[]
=
{
strlen
(
g_groupFileStream
),
strlen
(
g_passwdFileStream
)};
ret
=
PrepareFileEnv
(
pathList
,
streamList
,
streamLen
,
2
);
/* 2, group & passwd */
if
(
ret
!=
0
)
{
printf
(
"error: need some env file, but prepare is not ok"
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
ret
=
getpwuid_r
(
0
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user1
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user1
,
NULL
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
ret
,
0
,
ret
,
ERROUT
);
ICUNIT_
GOTO_NOT_EQUAL
(
user1
,
NULL
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
,
ERROUT
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_name
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
pwd
.
pw_uid
,
0
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
pwd
.
pw_gid
,
0
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_gecos
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_dir
,
"/root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
pwd
.
pw_shell
,
"/bin/bash"
,
-
1
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_name
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
pwd
.
pw_uid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
pwd
.
pw_gid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_gecos
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_dir
,
"/root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
pwd
.
pw_shell
,
"/bin/bash"
,
-
1
,
ERROUT
);
ret
=
getpwuid_r
(
1
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user2
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user2
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_name
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user2
->
pw_uid
,
1
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user2
->
pw_gid
,
1
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_gecos
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_dir
,
"/usr/sbin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
ret
,
0
,
ret
,
ERROUT
);
ICUNIT_
GOTO_NOT_EQUAL
(
user2
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_name
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user2
->
pw_uid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user2
->
pw_gid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_gecos
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_dir
,
"/usr/sbin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
ret
=
getpwuid_r
(
2
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user3
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_
ASSERT_NOT_EQUAL
(
user3
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_name
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user3
->
pw_uid
,
2
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user3
->
pw_gid
,
2
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_gecos
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_dir
,
"/bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user3
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ret
=
getpwuid_r
(
2
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user3
);
/* 2, from etc/group */
ICUNIT_
GOTO_EQUAL
(
ret
,
0
,
ret
,
ERROUT
);
ICUNIT_
GOTO_NOT_EQUAL
(
user3
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_name
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user3
->
pw_uid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_EQUAL
(
user3
->
pw_gid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_gecos
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_dir
,
"/bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user3
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
ret
=
getpwuid_r
(
0
,
&
pwd
,
buf2
,
sizeof
(
buf2
),
&
user4
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
ERANGE
,
ret
);
ICUNIT_
ASSERT_EQUAL
(
user4
,
nullptr
,
-
1
);
ICUNIT_
GOTO_EQUAL
(
ret
,
ERANGE
,
ret
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user4
,
nullptr
,
-
1
,
ERROUT
);
ret
=
getpwuid_r
(
200
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
ICUNIT_
ASSERT_EQUAL
(
user5
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_NOT_EQUAL
(
ret
,
0
,
-
1
);
ret
=
getpwuid_r
(
200
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
/* 200, invalid param for test */
ICUNIT_
GOTO_EQUAL
(
user5
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_NOT_EQUAL
(
ret
,
0
,
-
1
,
ERROUT
);
ret
=
getpwuid_r
(
100000
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
ICUNIT_
ASSERT_EQUAL
(
user5
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_NOT_EQUAL
(
ret
,
0
,
-
1
);
ret
=
getpwuid_r
(
100000
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
/* 100000, invalid param for test */
ICUNIT_
GOTO_EQUAL
(
user5
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_NOT_EQUAL
(
ret
,
0
,
-
1
,
ERROUT
);
ret
=
getpwuid_r
(
-
100
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
ICUNIT_
ASSERT_EQUAL
(
user5
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_NOT_EQUAL
(
ret
,
0
,
-
1
);
ret
=
getpwuid_r
(
-
100
,
&
pwd
,
buf1
,
sizeof
(
buf1
),
&
user5
);
/* -100, invalid param for test */
ICUNIT_
GOTO_EQUAL
(
user5
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_NOT_EQUAL
(
ret
,
0
,
-
1
,
ERROUT
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
0
;
ERROUT:
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
VOID
ItTestSys021
(
VOID
)
...
...
testsuites/unittest/sys/full/sys_test_022.cpp
浏览文件 @
60d3f6d5
...
...
@@ -30,47 +30,64 @@
*/
#include "It_test_sys.h"
static
UINT32
TestCase
(
VOID
)
STATIC
UINT32
TestCase
(
VOID
)
{
struct
passwd
*
user1
=
nullptr
;
struct
passwd
*
user2
=
nullptr
;
INT32
ret
;
CHAR
*
pathList
[]
=
{
"/etc/group"
,
"/etc/passwd"
};
CHAR
*
streamList
[]
=
{
g_groupFileStream
,
g_passwdFileStream
};
INT32
streamLen
[]
=
{
strlen
(
g_groupFileStream
),
strlen
(
g_passwdFileStream
)};
ret
=
PrepareFileEnv
(
pathList
,
streamList
,
streamLen
,
2
);
/* 2, group & passwd */
if
(
ret
!=
0
)
{
printf
(
"error: need some env file, but prepare is not ok"
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
user1
=
getpwent
();
ICUNIT_
ASSERT_NOT_EQUAL
(
user1
,
NULL
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user1
,
NULL
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_name
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_uid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_gid
,
0
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_gecos
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_dir
,
"/root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_shell
,
"/bin/bash"
,
-
1
,
ERROUT
);
user1
=
getpwent
();
ICUNIT_
ASSERT_NOT_EQUAL
(
user1
,
NULL
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_name
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_uid
,
1
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_gid
,
1
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_gecos
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_dir
,
"/usr/sbin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user1
,
NULL
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_name
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_uid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_gid
,
1
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_gecos
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_dir
,
"/usr/sbin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
user1
=
getpwent
();
ICUNIT_
ASSERT_NOT_EQUAL
(
user1
,
NULL
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_name
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_uid
,
2
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
user1
->
pw_gid
,
2
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_gecos
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_dir
,
"/bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user1
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user1
,
NULL
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_name
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_uid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_EQUAL
(
user1
->
pw_gid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_gecos
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_dir
,
"/bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user1
->
pw_shell
,
"/usr/sbin/nologin"
,
-
1
,
ERROUT
);
setpwent
();
user2
=
getpwent
();
ICUNIT_
ASSERT_NOT_EQUAL
(
user2
,
NULL
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
user2
->
pw_name
,
user1
->
pw_name
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
user2
,
NULL
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
user2
->
pw_name
,
user1
->
pw_name
,
-
1
,
ERROUT
);
setpwent
();
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
0
;
ERROUT:
setpwent
();
(
VOID
)
RecoveryFileEnv
(
pathList
,
2
);
/* 2, group & passwd */
return
-
1
;
}
VOID
ItTestSys022
(
VOID
)
...
...
testsuites/unittest/sys/full/sys_test_023.cpp
浏览文件 @
60d3f6d5
...
...
@@ -31,39 +31,55 @@
#include "It_test_sys.h"
#include "grp.h"
static
UINT32
TestCase
(
VOID
)
STATIC
UINT32
TestCase
(
VOID
)
{
struct
group
*
grp1
=
nullptr
;
struct
group
*
grp2
=
nullptr
;
struct
group
*
grp3
=
nullptr
;
struct
group
*
grp4
=
nullptr
;
INT32
ret
;
CHAR
*
pathList
[]
=
{
"/etc/group"
};
CHAR
*
streamList
[]
=
{
g_groupFileStream
};
INT32
streamLen
[]
=
{
strlen
(
g_groupFileStream
)};
ret
=
PrepareFileEnv
(
pathList
,
streamList
,
streamLen
,
1
);
if
(
ret
!=
0
)
{
printf
(
"error: need some env file, but prepare is not ok"
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
1
);
return
-
1
;
}
grp1
=
getgrent
();
ICUNIT_
ASSERT_NOT_EQUAL
(
grp1
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
grp1
->
gr_name
,
"root"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
grp1
->
gr_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
grp1
->
gr_gid
,
0
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
grp1
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
grp1
->
gr_name
,
"root"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
grp1
->
gr_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
grp1
->
gr_gid
,
0
,
-
1
,
ERROUT
);
grp2
=
getgrent
();
ICUNIT_
ASSERT_NOT_EQUAL
(
grp2
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
grp2
->
gr_name
,
"daemon"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
grp2
->
gr_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
grp2
->
gr_gid
,
1
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
grp2
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
grp2
->
gr_name
,
"daemon"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
grp2
->
gr_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
grp2
->
gr_gid
,
1
,
-
1
,
ERROUT
);
grp3
=
getgrent
();
ICUNIT_
ASSERT_NOT_EQUAL
(
grp3
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
grp3
->
gr_name
,
"bin"
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
grp3
->
gr_passwd
,
"x"
,
-
1
);
ICUNIT_
ASSERT_EQUAL
(
grp3
->
gr_gid
,
2
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
grp3
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
grp3
->
gr_name
,
"bin"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
grp3
->
gr_passwd
,
"x"
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_EQUAL
(
grp3
->
gr_gid
,
2
,
-
1
,
ERROUT
);
/* 2, from etc/group */
setgrent
();
grp4
=
getgrent
();
ICUNIT_
ASSERT_NOT_EQUAL
(
grp4
,
nullptr
,
-
1
);
ICUNIT_
ASSERT_STRING_EQUAL
(
grp1
->
gr_name
,
grp4
->
gr_name
,
-
1
);
ICUNIT_
GOTO_NOT_EQUAL
(
grp4
,
nullptr
,
-
1
,
ERROUT
);
ICUNIT_
GOTO_STRING_EQUAL
(
grp1
->
gr_name
,
grp4
->
gr_name
,
-
1
,
ERROUT
);
setgrent
();
(
VOID
)
RecoveryFileEnv
(
pathList
,
1
);
return
0
;
ERROUT:
setgrent
();
(
VOID
)
RecoveryFileEnv
(
pathList
,
1
);
return
-
1
;
}
VOID
ItTestSys023
(
VOID
)
...
...
testsuites/unittest/sys/full/sys_test_025.cpp
浏览文件 @
60d3f6d5
...
...
@@ -34,17 +34,17 @@
#define GROUPFILE "/etc/group"
static
int
TestCase0
(
void
)
STATIC
INT32
TestCase0
(
void
)
{
struct
group
getNam1
=
{
nullptr
};
struct
group
*
getNam2
=
nullptr
;
struct
group
getData1
=
{
nullptr
};
struct
group
*
getData2
=
nullptr
;
struct
group
*
groupRet
=
nullptr
;
char
buf
[
1000
];
size_t
len
=
1000
;
CHAR
buf
[
1000
];
/* 1000, buffer for test */
size_t
len
=
sizeof
(
buf
)
;
int
ret
=
getgrgid_r
(
0
,
&
getNam1
,
buf
,
len
,
&
getNam2
);
INT32
ret
=
getgrgid_r
(
0
,
&
getNam1
,
buf
,
len
,
&
getNam2
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_NOT_EQUAL
(
getNam2
,
nullptr
,
getNam2
);
...
...
@@ -73,17 +73,17 @@ static int TestCase0(void)
return
0
;
}
static
int
TestCase1
(
void
)
STATIC
INT32
TestCase1
(
void
)
{
int
len
=
1000
;
char
buf
[
1000
];
INT32
len
=
1000
;
CHAR
buf
[
1000
];
struct
group
getNam1
=
{
nullptr
};
struct
group
*
getNam2
=
nullptr
;
struct
group
getData1
=
{
nullptr
};
struct
group
*
getData2
=
nullptr
;
struct
group
*
groupRet
=
nullptr
;
int
ret
=
getgrgid_r
(
-
1
,
&
getNam1
,
buf
,
len
,
&
getNam2
);
INT32
ret
=
getgrgid_r
(
-
1
,
&
getNam1
,
buf
,
len
,
&
getNam2
);
ICUNIT_ASSERT_NOT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EAFNOSUPPORT
,
errno
);
errno
=
0
;
...
...
@@ -103,39 +103,33 @@ static int TestCase1(void)
ICUNIT_ASSERT_EQUAL
(
errno
,
EAFNOSUPPORT
,
errno
);
errno
=
0
;
remove
(
GROUPFILE
);
ret
=
getgrgid_r
(
0
,
&
getNam1
,
buf
,
len
,
&
getNam2
);
ICUNIT_ASSERT_NOT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
ENOENT
,
errno
);
errno
=
0
;
groupRet
=
getgrgid
(
0
);
ICUNIT_ASSERT_EQUAL
(
groupRet
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
ENOENT
,
errno
);
errno
=
0
;
groupRet
=
getgrnam
(
"root"
);
ICUNIT_ASSERT_EQUAL
(
groupRet
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
ENOENT
,
errno
);
errno
=
0
;
ret
=
getgrnam_r
(
"root"
,
&
getData1
,
buf
,
len
,
&
getData2
);
ICUNIT_ASSERT_NOT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
ENOENT
,
errno
);
return
0
;
}
static
int
TestCase
(
void
)
STATIC
INT32
TestCase
(
void
)
{
int
ret
=
TestCase0
();
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
CHAR
*
pathList
[]
=
{
"/etc/group"
};
CHAR
*
streamList
[]
=
{
g_groupFileStream
};
INT32
streamLen
[]
=
{
strlen
(
g_groupFileStream
)};
INT32
ret
=
PrepareFileEnv
(
pathList
,
streamList
,
streamLen
,
1
);
if
(
ret
!=
0
)
{
printf
(
"error: need some env file, but prepare is not ok"
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
1
);
return
-
1
;
}
ret
=
TestCase0
();
ICUNIT_GOTO_EQUAL
(
ret
,
0
,
ret
,
ERROUT
);
ret
=
TestCase1
();
ICUNIT_
ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_
GOTO_EQUAL
(
ret
,
0
,
re
,
ERROUT
);
(
VOID
)
RecoveryFileEnv
(
pathList
,
1
);
return
0
;
ERROUT:
(
VOID
)
RecoveryFileEnv
(
pathList
,
1
);
return
-
1
;
}
VOID
ItTestSys025
(
VOID
)
...
...
testsuites/unittest/sys/full/sys_test_028.cpp
浏览文件 @
60d3f6d5
...
...
@@ -31,20 +31,30 @@
static
UINT32
TestCase
(
VOID
)
{
int
ret
;
int
ret
,
status
;
pid_t
pid
=
fork
();
if
(
pid
==
0
)
{
ret
=
setpriority
(
PRIO_PROCESS
,
0
,
15
);
/* 15, set priority for test */
if
(
ret
!=
0
)
{
exit
(
0
);
}
ret
=
nice
(
0
);
ICUNIT_ASSERT_EQUAL
(
ret
,
15
,
ret
);
exit
(
ret
);
}
else
{
ret
=
nice
(
-
15
);
ret
=
waitpid
(
pid
,
&
status
,
0
);
ICUNIT_ASSERT_EQUAL
(
ret
,
pid
,
ret
);
status
=
WEXITSTATUS
(
status
);
ICUNIT_ASSERT_EQUAL
(
status
,
15
,
status
);
/* 15, set priority for test */
ret
=
nice
(
-
40
);
/* -40, set invaild priority for test */
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EINVAL
,
errno
);
}
return
0
;
}
VOID
I
T_TEST_SYS_
028
(
VOID
)
VOID
I
tTestSys
028
(
VOID
)
{
TEST_ADD_CASE
(
I
T_TEST_SYS_
028
,
TestCase
,
TEST_POSIX
,
TEST_MEM
,
TEST_LEVEL0
,
TEST_FUNCTION
);
TEST_ADD_CASE
(
I
tTestSys
028
,
TestCase
,
TEST_POSIX
,
TEST_MEM
,
TEST_LEVEL0
,
TEST_FUNCTION
);
}
testsuites/unittest/sys/sys_unit_test.cpp
浏览文件 @
60d3f6d5
...
...
@@ -34,6 +34,10 @@
#include "It_test_sys.h"
CHAR
*
g_groupFileStream
=
"root:x:0:
\n
daemon:x:1:
\n
bin:x:2:
\n
"
;
CHAR
*
g_passwdFileStream
=
"root:x:0:0:root:/root:/bin/bash
\n
"
\
"daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
\n
bin:x:2:2:bin:/bin:/usr/sbin/nologin
\n
"
;
using
namespace
testing
::
ext
;
namespace
OHOS
{
class
SysTest
:
public
testing
::
Test
{
...
...
@@ -343,14 +347,14 @@ HWTEST_F(SysTest, ItTestSys027, TestSize.Level0)
}
/* *
* @tc.name: I
T_TEST_SYS_
028
* @tc.name: I
tTestSys
028
* @tc.desc: function for nice:set pthread priority
* @tc.type: FUNC
* @tc.require: AR000EEMQ9
*/
HWTEST_F
(
SysTest
,
I
T_TEST_SYS_
028
,
TestSize
.
Level0
)
HWTEST_F
(
SysTest
,
I
tTestSys
028
,
TestSize
.
Level0
)
{
I
T_TEST_SYS_
028
();
I
tTestSys
028
();
}
#endif
}
// namespace OHOS
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录