Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
45a128a4
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 2 年 前同步成功
通知
475
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看板
提交
45a128a4
编写于
8月 24, 2021
作者:
O
openharmony_ci
提交者:
Gitee
8月 24, 2021
浏览文件
操作
浏览文件
下载
差异文件
!504 clock模块内核unittest用例调整
Merge pull request !504 from phchang/updateclock
上级
83bff88f
555e0681
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
202 addition
and
180 deletion
+202
-180
testsuites/unittest/time/clock/BUILD.gn
testsuites/unittest/time/clock/BUILD.gn
+10
-12
testsuites/unittest/time/clock/full/clock_test_001.cpp
testsuites/unittest/time/clock/full/clock_test_001.cpp
+12
-10
testsuites/unittest/time/clock/full/clock_test_002.cpp
testsuites/unittest/time/clock/full/clock_test_002.cpp
+4
-11
testsuites/unittest/time/clock/full/clock_test_003.cpp
testsuites/unittest/time/clock/full/clock_test_003.cpp
+17
-13
testsuites/unittest/time/clock/full/clock_test_004.cpp
testsuites/unittest/time/clock/full/clock_test_004.cpp
+8
-10
testsuites/unittest/time/clock/full/clock_test_005.cpp
testsuites/unittest/time/clock/full/clock_test_005.cpp
+14
-8
testsuites/unittest/time/clock/full/clock_test_006.cpp
testsuites/unittest/time/clock/full/clock_test_006.cpp
+10
-6
testsuites/unittest/time/clock/full/clock_test_007.cpp
testsuites/unittest/time/clock/full/clock_test_007.cpp
+9
-6
testsuites/unittest/time/clock/full/clock_test_008.cpp
testsuites/unittest/time/clock/full/clock_test_008.cpp
+10
-6
testsuites/unittest/time/clock/full/clock_test_009.cpp
testsuites/unittest/time/clock/full/clock_test_009.cpp
+9
-5
testsuites/unittest/time/clock/lt_clock_test.h
testsuites/unittest/time/clock/lt_clock_test.h
+7
-2
testsuites/unittest/time/clock/smoke/clock_test_003.cpp
testsuites/unittest/time/clock/smoke/clock_test_003.cpp
+0
-65
testsuites/unittest/time/clock/smoke/clock_test_smoke.cpp
testsuites/unittest/time/clock/smoke/clock_test_smoke.cpp
+69
-0
testsuites/unittest/time/clock/time_clock_test.cpp
testsuites/unittest/time/clock/time_clock_test.cpp
+23
-26
未找到文件。
testsuites/unittest/time/clock/BUILD.gn
浏览文件 @
45a128a4
...
@@ -41,20 +41,18 @@ sources_entry = [
...
@@ -41,20 +41,18 @@ sources_entry = [
"time_clock_test.cpp",
"time_clock_test.cpp",
]
]
sources_smoke = [
sources_smoke = [ "smoke/clock_test_smoke.cpp" ]
"smoke/clock_test_001.cpp",
"smoke/clock_test_002.cpp",
"smoke/clock_test_003.cpp",
"smoke/clock_test_004.cpp",
"smoke/clock_test_006.cpp",
"smoke/clock_test_007.cpp",
"smoke/clock_test_008.cpp",
"smoke/clock_test_009.cpp",
"smoke/clock_test_011.cpp",
"smoke/clock_test_012.cpp",
]
sources_full = [
sources_full = [
"full/clock_test_001.cpp",
"full/clock_test_002.cpp",
"full/clock_test_003.cpp",
"full/clock_test_004.cpp",
"full/clock_test_005.cpp",
"full/clock_test_006.cpp",
"full/clock_test_007.cpp",
"full/clock_test_008.cpp",
"full/clock_test_009.cpp",
"full/clock_test_010.cpp",
"full/clock_test_010.cpp",
]
]
...
...
testsuites/unittest/time/clock/
smoke
/clock_test_001.cpp
→
testsuites/unittest/time/clock/
full
/clock_test_001.cpp
浏览文件 @
45a128a4
...
@@ -45,36 +45,38 @@ static int ClockTest(void)
...
@@ -45,36 +45,38 @@ static int ClockTest(void)
clockid_t
clk
=
CLOCK_REALTIME
;
clockid_t
clk
=
CLOCK_REALTIME
;
struct
timespec
res
,
tp
,
oldtp
;
struct
timespec
res
,
tp
,
oldtp
;
int
ret
;
int
ret
;
int
passflag
=
0
;
/* get clock resolution */
/* get clock resolution */
ret
=
clock_getres
(
clk
,
&
res
);
ret
=
clock_getres
(
clk
,
&
res
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_sec
,
CLOCK_RES_SEC
,
res
.
tv_sec
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_nsec
,
CLOCK_RES_NSEC
,
res
.
tv_nsec
);
/* get current real time */
/* get current real time */
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ret
=
clock_gettime
(
clk
,
&
oldtp
);
printf
(
"The current real time: sec is %lld, nsec is %ld
\n
"
,
oldtp
.
tv_sec
,
oldtp
.
tv_nsec
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"sleep 2 seconds
\n
"
);
printf
(
"sleep 2 seconds
\n
"
);
sleep
(
2
);
// 2, seconds.
sleep
(
2
);
// 2, seconds.
tp
.
tv_sec
=
5
*
res
.
tv_sec
;
// 5, times the number of seconds.
tp
.
tv_sec
=
oldtp
.
tv_sec
+
2
;
// 2, use for testing clock setting
tp
.
tv_nsec
=
5
*
res
.
tv_nsec
;
// 5, times the number of nseconds.
tp
.
tv_nsec
=
oldtp
.
tv_nsec
;
/* set real time */
/* set real time */
ret
=
clock_settime
(
clk
,
&
tp
);
ret
=
clock_settime
(
clk
,
&
tp
);
#if TEST_ON_LINUX
printf
(
"Setting time: sec is %lld, nsec is %ld
\n
"
,
tp
.
tv_sec
,
tp
.
tv_nsec
);
/* on linux host we need root to set clock time */
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EPERM
,
errno
);
#else
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
#endif
LogPrintln
(
"get real time clock again
\n
"
);
printf
(
"get real time clock again
\n
"
);
/* get current real time again */
/* get current real time again */
ret
=
clock_gettime
(
clk
,
&
tp
);
ret
=
clock_gettime
(
clk
,
&
tp
);
printf
(
"Obtaining the current time after setting: sec = %lld, nsec = %ld
\n
"
,
tp
.
tv_sec
,
tp
.
tv_nsec
);
passflag
=
(
tp
.
tv_sec
>=
2
+
oldtp
.
tv_sec
)
&&
(
tp
.
tv_sec
<=
2
+
oldtp
.
tv_sec
+
1
);
// 2, use for testing clock setting
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
passflag
,
true
,
passflag
);
return
0
;
return
0
;
}
}
...
...
testsuites/unittest/time/clock/
smoke/clock_test_011
.cpp
→
testsuites/unittest/time/clock/
full/clock_test_002
.cpp
浏览文件 @
45a128a4
...
@@ -46,7 +46,7 @@ static int ThreadClock(const char *msg, clockid_t cid)
...
@@ -46,7 +46,7 @@ static int ThreadClock(const char *msg, clockid_t cid)
ret
=
clock_gettime
(
cid
,
&
ts
);
ret
=
clock_gettime
(
cid
,
&
ts
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"%
4jd.%03ld
\n
"
,
ts
.
tv_sec
,
ts
.
tv_nsec
/
1000000
);
// 1000000, 1ms.
printf
(
"%
lld.%03ld s
\n
"
,
ts
.
tv_sec
,
ts
.
tv_nsec
/
1000000
);
// 1000000, 1ms.
return
0
;
return
0
;
}
}
...
@@ -57,11 +57,6 @@ static int ClockTest(void)
...
@@ -57,11 +57,6 @@ static int ClockTest(void)
int
ret
;
int
ret
;
struct
timespec
ts
;
struct
timespec
ts
;
/* check param invalid */
ret
=
clock_gettime
(
-
2050
,
&
ts
);
// 2050, clock id.
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EINVAL
,
errno
);
ret
=
pthread_create
(
&
thread
,
NULL
,
ThreadFuncTest
,
0
);
ret
=
pthread_create
(
&
thread
,
NULL
,
ThreadFuncTest
,
0
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
...
@@ -69,9 +64,7 @@ static int ClockTest(void)
...
@@ -69,9 +64,7 @@ static int ClockTest(void)
sleep
(
1
);
sleep
(
1
);
printf
(
"Main thread consuming some CPU time...
\n
"
);
printf
(
"Main thread consuming some CPU time...
\n
"
);
for
(
int
j
=
0
;
j
<
4000000
;
j
++
)
{
// 4000000, The loop frequency.
usleep
(
400000
);
// 400000 delay for test
getppid
();
}
/* get current pthread clockid */
/* get current pthread clockid */
ret
=
pthread_getcpuclockid
(
pthread_self
(),
&
clockid
);
ret
=
pthread_getcpuclockid
(
pthread_self
(),
&
clockid
);
...
@@ -84,13 +77,13 @@ static int ClockTest(void)
...
@@ -84,13 +77,13 @@ static int ClockTest(void)
ret
=
pthread_getcpuclockid
(
thread
,
&
clockid
);
ret
=
pthread_getcpuclockid
(
thread
,
&
clockid
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ret
=
ThreadClock
(
"Subthread CPU time:
1
"
,
clockid
);
ret
=
ThreadClock
(
"Subthread CPU time: "
,
clockid
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
return
0
;
return
0
;
}
}
void
ClockTest0
11
(
void
)
void
ClockTest0
02
(
void
)
{
{
TEST_ADD_CASE
(
__FUNCTION__
,
ClockTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
TEST_ADD_CASE
(
__FUNCTION__
,
ClockTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
}
}
testsuites/unittest/time/clock/
smoke/clock_test_012
.cpp
→
testsuites/unittest/time/clock/
full/clock_test_003
.cpp
浏览文件 @
45a128a4
...
@@ -35,42 +35,46 @@ static int ClockTest(void)
...
@@ -35,42 +35,46 @@ static int ClockTest(void)
clockid_t
clockid
;
clockid_t
clockid
;
struct
timespec
ts
;
struct
timespec
ts
;
int
ret
;
int
ret
;
pid_t
pid
=
0
;
int
passflag
=
0
;
/* check param invalid */
/* get kernel process 1 clockid */
ret
=
clock_getcpuclockid
(
0
,
&
clockid
);
pid
=
1
;
ICUNIT_ASSERT_EQUAL
(
ret
,
EINVAL
,
ret
);
ret
=
clock_getcpuclockid
(
1
,
&
clockid
);
ret
=
clock_getcpuclockid
(
65
,
&
clockid
);
// 65, pthread id.
ICUNIT_ASSERT_EQUAL
(
ret
,
EINVAL
,
ret
);
/* get user process2 clockid */
ret
=
clock_getcpuclockid
(
2
,
&
clockid
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
clockid
,
CLOCK_GET_CPU_CLOCKID
(
pid
),
clockid
);
/* get clockid time */
/* get clockid time */
ret
=
clock_gettime
(
clockid
,
&
ts
);
ret
=
clock_gettime
(
clockid
,
&
ts
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"Obtaining the process running time: %lld second, %ld nanosecond
\n
"
,
ts
.
tv_sec
,
ts
.
tv_nsec
);
/* get kernel process1 clockid */
/* get user process 2 clockid */
ret
=
clock_getcpuclockid
(
1
,
&
clockid
);
pid
=
2
;
// 2, test the process 2 (An existent pid)
ret
=
clock_getcpuclockid
(
2
,
&
clockid
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
clockid
,
CLOCK_GET_CPU_CLOCKID
(
pid
),
clockid
);
/* get clockid time */
/* get clockid time */
ret
=
clock_gettime
(
clockid
,
&
ts
);
ret
=
clock_gettime
(
clockid
,
&
ts
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"Obtaining the process running time: %lld second, %ld nanosecond
\n
"
,
ts
.
tv_sec
,
ts
.
tv_nsec
);
/* get current process clockid */
/* get current process clockid */
pid
=
getpid
();
ret
=
clock_getcpuclockid
(
getpid
(),
&
clockid
);
ret
=
clock_getcpuclockid
(
getpid
(),
&
clockid
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
clockid
,
CLOCK_GET_CPU_CLOCKID
(
pid
),
clockid
);
/* get clockid time */
/* get clockid time */
ret
=
clock_gettime
(
clockid
,
&
ts
);
ret
=
clock_gettime
(
clockid
,
&
ts
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"Obtaining the process running time: %lld second, %ld nanosecond
\n
"
,
ts
.
tv_sec
,
ts
.
tv_nsec
);
return
0
;
return
0
;
}
}
void
ClockTest0
12
(
void
)
void
ClockTest0
03
(
void
)
{
{
TEST_ADD_CASE
(
__FUNCTION__
,
ClockTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
TEST_ADD_CASE
(
__FUNCTION__
,
ClockTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
}
}
\ No newline at end of file
testsuites/unittest/time/clock/
smoke
/clock_test_004.cpp
→
testsuites/unittest/time/clock/
full
/clock_test_004.cpp
浏览文件 @
45a128a4
...
@@ -30,24 +30,22 @@
...
@@ -30,24 +30,22 @@
*/
*/
#include "lt_clock_test.h"
#include "lt_clock_test.h"
static
int
C
puC
lockTest
(
void
)
static
int
ClockTest
(
void
)
{
{
int
pid
=
0
;
pthread_t
thread
;
int
ret
;
clockid_t
clockid
;
clockid_t
clockid
;
int
ret
;
struct
timespec
ts
;
struct
timespec
ts
;
/* CLOCK_PROCESS_CPUTIME_ID if pid == 0 */
/* check param invalid */
ret
=
clock_getcpuclockid
(
pid
,
&
clockid
);
ret
=
clock_gettime
(
-
2050
,
&
ts
);
// 2050, clock id.
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EINVAL
,
errno
);
ret
=
clock_gettime
(
clockid
,
&
ts
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
return
0
;
return
0
;
}
}
void
ClockTest004
(
void
)
void
ClockTest004
(
void
)
{
{
TEST_ADD_CASE
(
__FUNCTION__
,
C
puC
lockTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
TEST_ADD_CASE
(
__FUNCTION__
,
ClockTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
}
}
testsuites/unittest/time/clock/
smoke/clock_test_002
.cpp
→
testsuites/unittest/time/clock/
full/clock_test_005
.cpp
浏览文件 @
45a128a4
...
@@ -30,19 +30,25 @@
...
@@ -30,19 +30,25 @@
*/
*/
#include "lt_clock_test.h"
#include "lt_clock_test.h"
static
int
Clock
Monotonic
Test
(
void
)
static
int
ClockTest
(
void
)
{
{
clockid_t
cl
k
=
CLOCK_MONOTONIC
;
clockid_t
cl
ockid
;
struct
timespec
res
,
ts
;
struct
timespec
ts
;
int
ret
;
int
ret
;
pid_t
pid
=
0
;
ret
=
clock_gettime
(
clk
,
&
ts
);
/* check param invalid */
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ret
=
clock_getcpuclockid
(
pid
,
&
clockid
);
ICUNIT_ASSERT_EQUAL
(
ret
,
EINVAL
,
ret
);
pid
=
65
;
// 65, non existent process id.
ret
=
clock_getcpuclockid
(
pid
,
&
clockid
);
ICUNIT_ASSERT_EQUAL
(
ret
,
EINVAL
,
ret
);
return
0
;
return
0
;
}
}
void
ClockTest00
2
(
void
)
void
ClockTest00
5
(
void
)
{
{
TEST_ADD_CASE
(
__FUNCTION__
,
ClockMonotonicTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
TEST_ADD_CASE
(
__FUNCTION__
,
ClockTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
}
}
\ No newline at end of file
testsuites/unittest/time/clock/
smoke
/clock_test_006.cpp
→
testsuites/unittest/time/clock/
full
/clock_test_006.cpp
浏览文件 @
45a128a4
...
@@ -45,31 +45,35 @@ static int ClockTest(void)
...
@@ -45,31 +45,35 @@ static int ClockTest(void)
clockid_t
clk
=
CLOCK_REALTIME_COARSE
;
clockid_t
clk
=
CLOCK_REALTIME_COARSE
;
struct
timespec
res
,
tp
,
oldtp
;
struct
timespec
res
,
tp
,
oldtp
;
int
ret
;
int
ret
;
int
passflag
=
0
;
/* get clock resolution */
/* get clock resolution */
ret
=
clock_getres
(
clk
,
&
res
);
ret
=
clock_getres
(
clk
,
&
res
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_sec
,
CLOCK_COARSE_RES_SEC
,
res
.
tv_sec
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_nsec
,
CLOCK_COARSE_RES_NSEC
,
res
.
tv_nsec
);
/* get current real coarse time */
/* get current real coarse time */
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"The current coarse real time: sec is %lld, nsec is %ld
\n
"
,
oldtp
.
tv_sec
,
oldtp
.
tv_nsec
);
LogPrintln
(
"sleep 2 seconds
\n
"
);
tp
.
tv_sec
=
5
*
oldtp
.
tv_sec
;
// 5, times the number of seconds.
sleep
(
2
);
// 2, seconds.
tp
.
tv_nsec
=
oldtp
.
tv_nsec
;
// 5, times the number of nseconds.
tp
.
tv_sec
=
5
*
res
.
tv_sec
;
// 5, times the number of seconds.
tp
.
tv_nsec
=
5
*
res
.
tv_nsec
;
// 5, times the number of nseconds.
/* set real coarse time */
/* set real coarse time */
ret
=
clock_settime
(
clk
,
&
tp
);
ret
=
clock_settime
(
clk
,
&
tp
);
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EOPNOTSUPP
,
errno
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EOPNOTSUPP
,
errno
);
LogPrintln
(
"get coarse real time clock again
\n
"
);
printf
(
"get coarse real time clock again
\n
"
);
/* get current real coarse time again */
/* get current real coarse time again */
ret
=
clock_gettime
(
clk
,
&
tp
);
ret
=
clock_gettime
(
clk
,
&
tp
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"The current coarse real time again: sec is %lld, nsec is %ld
\n
"
,
tp
.
tv_sec
,
tp
.
tv_nsec
);
passflag
=
(
tp
.
tv_sec
>=
oldtp
.
tv_sec
)
&&
(
tp
.
tv_sec
<=
oldtp
.
tv_sec
+
1
);
ICUNIT_ASSERT_EQUAL
(
passflag
,
1
,
passflag
);
return
0
;
return
0
;
}
}
...
...
testsuites/unittest/time/clock/
smoke
/clock_test_007.cpp
→
testsuites/unittest/time/clock/
full
/clock_test_007.cpp
浏览文件 @
45a128a4
...
@@ -45,31 +45,34 @@ static int ClockTest(void)
...
@@ -45,31 +45,34 @@ static int ClockTest(void)
clockid_t
clk
=
CLOCK_MONOTONIC_COARSE
;
clockid_t
clk
=
CLOCK_MONOTONIC_COARSE
;
struct
timespec
res
,
tp
,
oldtp
;
struct
timespec
res
,
tp
,
oldtp
;
int
ret
;
int
ret
;
int
passflag
=
0
;
/* get clock resolution */
/* get clock resolution */
ret
=
clock_getres
(
clk
,
&
res
);
ret
=
clock_getres
(
clk
,
&
res
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_sec
,
CLOCK_COARSE_RES_SEC
,
res
.
tv_sec
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_nsec
,
CLOCK_COARSE_RES_NSEC
,
res
.
tv_nsec
);
/* get current monotonic coarse time */
/* get current monotonic coarse time */
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"The current monotonic coarse time: sec is %lld, nsec is %ld
\n
"
,
oldtp
.
tv_sec
,
oldtp
.
tv_nsec
);
LogPrintln
(
"sleep 2 seconds
\n
"
);
sleep
(
2
);
// 2, seconds.
tp
.
tv_sec
=
5
*
res
.
tv_sec
;
// 5, times the number of seconds.
tp
.
tv_sec
=
5
*
res
.
tv_sec
;
// 5, times the number of seconds.
tp
.
tv_nsec
=
5
*
res
.
tv_nsec
;
// 5, times the number of nseconds.
tp
.
tv_nsec
=
res
.
tv_nsec
;
/* set monotonic coarse time */
/* set monotonic coarse time */
ret
=
clock_settime
(
clk
,
&
tp
);
ret
=
clock_settime
(
clk
,
&
tp
);
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EOPNOTSUPP
,
errno
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EOPNOTSUPP
,
errno
);
LogPrintln
(
"get coarse monotonic time clock again
\n
"
);
printf
(
"get coarse monotonic time clock again
\n
"
);
/* get current monotonic coarse time again */
/* get current monotonic coarse time again */
ret
=
clock_gettime
(
clk
,
&
tp
);
ret
=
clock_gettime
(
clk
,
&
tp
);
passflag
=
(
tp
.
tv_sec
>=
oldtp
.
tv_sec
)
&&
(
tp
.
tv_sec
<=
oldtp
.
tv_sec
+
1
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
passflag
,
1
,
passflag
);
printf
(
"The current monotonic coarse time again: sec is %lld, nsec is %ld
\n
"
,
tp
.
tv_sec
,
tp
.
tv_nsec
);
return
0
;
return
0
;
}
}
...
...
testsuites/unittest/time/clock/
smoke
/clock_test_008.cpp
→
testsuites/unittest/time/clock/
full
/clock_test_008.cpp
浏览文件 @
45a128a4
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
#include <time.h>
#include <time.h>
#include <sys/times.h>
#include <sys/times.h>
#include <errno.h>
#include <errno.h>
#include "lt_clock_test.h"
#include <osTest.h>
#include <osTest.h>
#include "lt_clock_test.h"
/* When clock time is changed, timers for a relative interval are unaffected,
/* When clock time is changed, timers for a relative interval are unaffected,
* but timers for an absolute point in time are affected.
* but timers for an absolute point in time are affected.
...
@@ -45,20 +45,21 @@ static int ClockTest(void)
...
@@ -45,20 +45,21 @@ static int ClockTest(void)
clockid_t
clk
=
CLOCK_MONOTONIC
;
clockid_t
clk
=
CLOCK_MONOTONIC
;
struct
timespec
res
,
tp
,
oldtp
;
struct
timespec
res
,
tp
,
oldtp
;
int
ret
;
int
ret
;
int
passflag
=
0
;
/* get clock resolution */
/* get clock resolution */
ret
=
clock_getres
(
clk
,
&
res
);
ret
=
clock_getres
(
clk
,
&
res
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_sec
,
CLOCK_RES_SEC
,
res
.
tv_sec
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_nsec
,
CLOCK_RES_NSEC
,
res
.
tv_nsec
);
/* get current monotonic time */
/* get current monotonic time */
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"The current monotonic time: sec is %lld, nsec is %ld
\n
"
,
oldtp
.
tv_sec
,
oldtp
.
tv_nsec
);
LogPrintln
(
"sleep 2 seconds
\n
"
);
tp
.
tv_sec
=
5
*
oldtp
.
tv_sec
;
// 5, times the number of seconds.
sleep
(
2
);
// 2, seconds.
tp
.
tv_nsec
=
oldtp
.
tv_nsec
;
tp
.
tv_sec
=
5
*
res
.
tv_sec
;
// 5, times the number of seconds.
tp
.
tv_nsec
=
5
*
res
.
tv_nsec
;
// 5, times the number of nseconds.
/* set real time */
/* set real time */
ret
=
clock_settime
(
clk
,
&
tp
);
ret
=
clock_settime
(
clk
,
&
tp
);
...
@@ -69,7 +70,10 @@ static int ClockTest(void)
...
@@ -69,7 +70,10 @@ static int ClockTest(void)
/* get current monotonic time again */
/* get current monotonic time again */
ret
=
clock_gettime
(
clk
,
&
tp
);
ret
=
clock_gettime
(
clk
,
&
tp
);
passflag
=
(
tp
.
tv_sec
>=
oldtp
.
tv_sec
)
&&
(
tp
.
tv_sec
<=
oldtp
.
tv_sec
+
1
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
passflag
,
1
,
passflag
);
printf
(
"The current monotonic time: sec is %lld, nsec is %ld
\n
"
,
tp
.
tv_sec
,
tp
.
tv_nsec
);
return
0
;
return
0
;
}
}
...
...
testsuites/unittest/time/clock/
smoke
/clock_test_009.cpp
→
testsuites/unittest/time/clock/
full
/clock_test_009.cpp
浏览文件 @
45a128a4
...
@@ -45,31 +45,35 @@ static int ClockTest(void)
...
@@ -45,31 +45,35 @@ static int ClockTest(void)
clockid_t
clk
=
CLOCK_MONOTONIC_RAW
;
clockid_t
clk
=
CLOCK_MONOTONIC_RAW
;
struct
timespec
res
,
tp
,
oldtp
;
struct
timespec
res
,
tp
,
oldtp
;
int
ret
;
int
ret
;
int
passflag
=
0
;
/* get clock resolution */
/* get clock resolution */
ret
=
clock_getres
(
clk
,
&
res
);
ret
=
clock_getres
(
clk
,
&
res
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_sec
,
CLOCK_RES_SEC
,
res
.
tv_sec
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_nsec
,
CLOCK_RES_NSEC
,
res
.
tv_nsec
);
/* get current monotonic raw time */
/* get current monotonic raw time */
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ret
=
clock_gettime
(
clk
,
&
oldtp
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"The current monotonic raw time: sec is %lld, nsec is %ld
\n
"
,
oldtp
.
tv_sec
,
oldtp
.
tv_nsec
);
LogPrintln
(
"sleep 2 seconds
\n
"
);
sleep
(
2
);
// 2, seconds.
tp
.
tv_sec
=
5
*
res
.
tv_sec
;
// 5, times the number of seconds.
tp
.
tv_sec
=
5
*
res
.
tv_sec
;
// 5, times the number of seconds.
tp
.
tv_nsec
=
5
*
res
.
tv_nsec
;
// 5, times the number of nseconds.
tp
.
tv_nsec
=
res
.
tv_nsec
;
/* set monotonic raw time */
/* set monotonic raw time */
ret
=
clock_settime
(
clk
,
&
tp
);
ret
=
clock_settime
(
clk
,
&
tp
);
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
-
1
,
ret
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EOPNOTSUPP
,
errno
);
ICUNIT_ASSERT_EQUAL
(
errno
,
EOPNOTSUPP
,
errno
);
LogPrintln
(
"get monotonic raw time clock again
\n
"
);
printf
(
"get monotonic raw time clock again
\n
"
);
/* get current monotonic raw time again */
/* get current monotonic raw time again */
ret
=
clock_gettime
(
clk
,
&
tp
);
ret
=
clock_gettime
(
clk
,
&
tp
);
passflag
=
(
tp
.
tv_sec
>=
oldtp
.
tv_sec
)
&&
(
tp
.
tv_sec
<=
oldtp
.
tv_sec
+
1
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
passflag
,
1
,
passflag
);
printf
(
"The current monotonic raw time again: sec is %lld, nsec is %ld
\n
"
,
tp
.
tv_sec
,
tp
.
tv_nsec
);
return
0
;
return
0
;
}
}
...
...
testsuites/unittest/time/clock/lt_clock_test.h
浏览文件 @
45a128a4
...
@@ -37,6 +37,13 @@
...
@@ -37,6 +37,13 @@
#include <sys/times.h>
#include <sys/times.h>
#include "osTest.h"
#include "osTest.h"
#define CLOCK_RES_SEC 0
#define CLOCK_RES_NSEC 1000
#define CLOCK_COARSE_RES_SEC 0
#define CLOCK_COARSE_RES_NSEC 1000000
#define CLOCK_GET_CPU_CLOCKID(pid) ((-pid - 1) * 8U + 2)
void
ClockTestSmoke
(
void
);
void
ClockTest001
(
void
);
void
ClockTest001
(
void
);
void
ClockTest002
(
void
);
void
ClockTest002
(
void
);
void
ClockTest003
(
void
);
void
ClockTest003
(
void
);
...
@@ -47,7 +54,5 @@ void ClockTest007(void);
...
@@ -47,7 +54,5 @@ void ClockTest007(void);
void
ClockTest008
(
void
);
void
ClockTest008
(
void
);
void
ClockTest009
(
void
);
void
ClockTest009
(
void
);
void
ClockTest010
(
void
);
void
ClockTest010
(
void
);
void
ClockTest011
(
void
);
void
ClockTest012
(
void
);
#endif
/* TIME_CLOCK_LT_CLOCK_TEST_H_ */
#endif
/* TIME_CLOCK_LT_CLOCK_TEST_H_ */
testsuites/unittest/time/clock/smoke/clock_test_003.cpp
已删除
100644 → 0
浏览文件 @
83bff88f
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include <sys/times.h>
#include "lt_clock_test.h"
#include <osTest.h>
static
int
ClockCoarseTest
(
void
)
{
clockid_t
clk
=
CLOCK_REALTIME_COARSE
;
struct
timespec
res
,
realts
,
monots
;
int
ret
;
ret
=
clock_gettime
(
clk
,
&
realts
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
LogPrintln
(
"sleep 2 seconds
\n
"
);
sleep
(
2
);
// 2, seconds.
LogPrintln
(
"get real coarse time again
\n
"
);
ret
=
clock_gettime
(
clk
,
&
realts
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
clk
=
CLOCK_MONOTONIC_COARSE
;
ret
=
clock_gettime
(
clk
,
&
monots
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
return
0
;
}
void
ClockTest003
(
void
)
{
TEST_ADD_CASE
(
__FUNCTION__
,
ClockCoarseTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
}
\ No newline at end of file
testsuites/unittest/time/clock/smoke/clock_test_smoke.cpp
0 → 100644
浏览文件 @
45a128a4
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "lt_clock_test.h"
static
int
ClockSmokeTest
(
void
)
{
clockid_t
clk
=
CLOCK_REALTIME
;
struct
timespec
res
=
{
0
,
0
},
setts
=
{
0
,
0
},
oldtp
=
{
0
,
0
},
ts
=
{
0
,
0
};
int
ret
;
int
passflag
=
0
;
/* get clock resolution */
ret
=
clock_getres
(
clk
,
&
res
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_sec
,
CLOCK_RES_SEC
,
res
.
tv_sec
);
ICUNIT_ASSERT_EQUAL
(
res
.
tv_nsec
,
CLOCK_RES_NSEC
,
res
.
tv_nsec
);
/* get clock realtime */
ret
=
clock_gettime
(
clk
,
&
oldtp
);
printf
(
"the clock current time: %lld second, %ld nanosecond
\n
"
,
oldtp
.
tv_sec
,
oldtp
.
tv_nsec
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
/* set clock realtime */
setts
.
tv_sec
=
oldtp
.
tv_sec
+
1
;
setts
.
tv_nsec
=
oldtp
.
tv_nsec
;
printf
(
"the clock setting time: %lld second, %ld nanosecond
\n
"
,
setts
.
tv_sec
,
setts
.
tv_nsec
);
ret
=
clock_settime
(
CLOCK_REALTIME
,
&
setts
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ret
=
clock_gettime
(
clk
,
&
ts
);
printf
(
"obtaining the current time after setting: %lld second, %ld nanosecond
\n
"
,
ts
.
tv_sec
,
ts
.
tv_nsec
);
passflag
=
(
ts
.
tv_sec
>=
setts
.
tv_sec
)
&&
(
ts
.
tv_sec
<=
setts
.
tv_sec
+
1
);
// 1, means obtaining time's errno is 1 second.
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
passflag
,
true
,
passflag
);
return
0
;
}
void
ClockTestSmoke
(
void
)
{
TEST_ADD_CASE
(
__FUNCTION__
,
ClockSmokeTest
,
TEST_POSIX
,
TEST_TIMES
,
TEST_LEVEL0
,
TEST_FUNCTION
);
}
testsuites/unittest/time/clock/time_clock_test.cpp
浏览文件 @
45a128a4
...
@@ -43,6 +43,19 @@ public:
...
@@ -43,6 +43,19 @@ public:
};
};
#if defined(LOSCFG_USER_TEST_SMOKE)
#if defined(LOSCFG_USER_TEST_SMOKE)
/* *
* @tc.name: ClockTestSmoke
* @tc.desc: function for TimeClockTest
* @tc.type: FUNC
* @tc.require: AR000EEMQ9
*/
HWTEST_F
(
TimeClockTest
,
ClockTestSmoke
,
TestSize
.
Level0
)
{
ClockTestSmoke
();
}
#endif
#if defined(LOSCFG_USER_TEST_FULL)
/* *
/* *
* @tc.name: ClockTest001
* @tc.name: ClockTest001
* @tc.desc: function for TimeClockTest
* @tc.desc: function for TimeClockTest
...
@@ -76,7 +89,6 @@ HWTEST_F(TimeClockTest, ClockTest003, TestSize.Level0)
...
@@ -76,7 +89,6 @@ HWTEST_F(TimeClockTest, ClockTest003, TestSize.Level0)
ClockTest003
();
ClockTest003
();
}
}
#if TEST_ON_LINUX
/* *
/* *
* @tc.name: ClockTest004
* @tc.name: ClockTest004
* @tc.desc: function for TimeClockTest
* @tc.desc: function for TimeClockTest
...
@@ -88,7 +100,16 @@ HWTEST_F(TimeClockTest, ClockTest004, TestSize.Level0)
...
@@ -88,7 +100,16 @@ HWTEST_F(TimeClockTest, ClockTest004, TestSize.Level0)
ClockTest004
();
// clock_getcpuclockid not supported on HMOS currently
ClockTest004
();
// clock_getcpuclockid not supported on HMOS currently
}
}
#endif
/* *
* @tc.name: ClockTest005
* @tc.desc: function for TimeClockTest
* @tc.type: FUNC
* @tc.require: AR000EEMQ9
*/
HWTEST_F
(
TimeClockTest
,
ClockTest005
,
TestSize
.
Level0
)
{
ClockTest005
();
}
/* *
/* *
* @tc.name: ClockTest006
* @tc.name: ClockTest006
...
@@ -133,9 +154,7 @@ HWTEST_F(TimeClockTest, ClockTest009, TestSize.Level0)
...
@@ -133,9 +154,7 @@ HWTEST_F(TimeClockTest, ClockTest009, TestSize.Level0)
{
{
ClockTest009
();
ClockTest009
();
}
}
#endif
#if defined(LOSCFG_USER_TEST_FULL)
/* *
/* *
* @tc.name: ClockTest010
* @tc.name: ClockTest010
* @tc.desc: function for TimeClockTest
* @tc.desc: function for TimeClockTest
...
@@ -147,27 +166,5 @@ HWTEST_F(TimeClockTest, ClockTest010, TestSize.Level0)
...
@@ -147,27 +166,5 @@ HWTEST_F(TimeClockTest, ClockTest010, TestSize.Level0)
ClockTest010
();
ClockTest010
();
}
}
/* *
* @tc.name: ClockTest011
* @tc.desc: test pthread_getcpuclockid:get pthread time
* @tc.type: FUNC
* @tc.require: AR000E0QAB
*/
HWTEST_F
(
TimeClockTest
,
ClockTest011
,
TestSize
.
Level0
)
{
ClockTest011
();
}
/* *
* @tc.name: ClockTest012
* @tc.desc: test clock_getcpuclockid:get process time
* @tc.type: FUNC
* @tc.require: AR000E0QAB
*/
HWTEST_F
(
TimeClockTest
,
ClockTest012
,
TestSize
.
Level0
)
{
ClockTest012
();
}
#endif
#endif
}
// namespace OHOS
}
// namespace OHOS
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录