Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c9b71921
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看板
提交
c9b71921
编写于
8月 28, 2021
作者:
O
openharmony_ci
提交者:
Gitee
8月 28, 2021
浏览文件
操作
浏览文件
下载
差异文件
!300 add hievent hal test
Merge pull request !300 from stesen/master
上级
a8779972
fcecd0a9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
173 addition
and
0 deletion
+173
-0
build_lite/BUILD.gn
build_lite/BUILD.gn
+1
-0
hiviewdfx_lite/hievent_hal/BUILD.gn
hiviewdfx_lite/hievent_hal/BUILD.gn
+27
-0
hiviewdfx_lite/hievent_hal/Test.tmpl
hiviewdfx_lite/hievent_hal/Test.tmpl
+19
-0
hiviewdfx_lite/hievent_hal/src/hievent_lite_test.c
hiviewdfx_lite/hievent_hal/src/hievent_lite_test.c
+126
-0
未找到文件。
build_lite/BUILD.gn
浏览文件 @
c9b71921
...
...
@@ -42,6 +42,7 @@ lite_component("acts_component") {
"//test/xts/acts/utils_lite/kv_store_hal:ActsKvStoreTest",
#"//test/xts/acts/security_lite/huks_hal:ActsSecurityDataTest",
"//test/xts/acts/hiviewdfx_lite/hilog_hal:ActsDfxFuncTest",
"//test/xts/acts/hiviewdfx_lite/hievent_hal:ActsHieventLiteTest",
"//test/xts/acts/distributed_schedule_lite/system_ability_manager_hal:ActsSamgrTest",
"//test/xts/acts/update_lite/dupdate_hal:ActsUpdaterFuncTest",
...
...
hiviewdfx_lite/hievent_hal/BUILD.gn
0 → 100755
浏览文件 @
c9b71921
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/lite/build/suite_lite.gni")
hctest_suite("ActsHieventLiteTest") {
suite_name = "acts"
sources = [
"src/hievent_lite_test.c",
]
include_dirs = [
"src",
"//base/hiviewdfx/hievent_lite/interfaces/native/innerkits",
]
cflags = [ "-Wno-error" ]
}
hiviewdfx_lite/hievent_hal/Test.tmpl
0 → 100755
浏览文件 @
c9b71921
{
"description": "Config for $module test cases",
"environment": [
{
"type": "device",
"label": "wifiiot"
}
],
"kits": [
{
"type": "DeployKit",
"timeout": "20000",
"burn_file": "$subsystem/$module.bin"
}
],
"driver": {
"type": "CTestLite"
}
}
\ No newline at end of file
hiviewdfx_lite/hievent_hal/src/hievent_lite_test.c
0 → 100755
浏览文件 @
c9b71921
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <ctype.h>
#include <stdint.h>
#include "event.h"
#include "hctest.h"
#define HIEVENT_TEST_ID 0x1234
/**
* @tc.desc : register a test suite, this suite is used to test basic flow and interface dependency
* @param : subsystem name is hiviewdfx
* @param : module name is hievet_lite
* @param : test suit name is HieventLiteTest
*/
LITE_TEST_SUIT
(
hiviewdfx
,
hievent_lite
,
HieventLiteTest
);
/**
* @tc.setup : setup for all testcases
* @return : setup result, TRUE is success, FALSE is fail
*/
static
BOOL
HieventLiteTestSuiteSetUp
(
void
)
{
return
TRUE
;
}
/**
* @tc.teardown : teardown for all testcases
* @return : teardown result, TRUE is success, FALSE is fail
*/
static
BOOL
HieventLiteTestSuiteTearDown
(
void
)
{
printf
(
"+-------------------------------------------+
\n
"
);
return
TRUE
;
}
/**
* @tc.desc : register a test suite, this suite is used to test basic flow and interface dependency
* @param : subsystem name is hiviewdfx
* @param : module name is hievet_lite
* @param : test suit name is HieventLiteTest
*/
static
HieventProc
HieventLiteTestOutputFunc
(
uint8
*
data
)
{
HiEvent
*
e
=
(
HiEvent
*
)
data
;
TEST_ASSERT_EQUAL_INT
(
HIEVENT_TEST_ID
,
e
->
common
.
eventId
);
}
/**
* @tc.name : HieventLiteFuncTest001
* @tc.desc : Test HiEventCreate
* @tc.level : Level 1
*/
LITE_TEST_CASE
(
HieventLiteTestSuite
,
HieventLiteFuncTest001
,
Level1
)
{
HiEvent
*
e
=
HiEventCreate
(
HIEVENT_FAULT
,
0
,
3
);
TEST_ASSERT_NOT_NULL
(
e
);
HiEventReport
(
e
);
};
/**
* @tc.name : HieventLiteFuncTest002
* @tc.desc : Test HiEventPutInteger 3 items whth async flush
* @tc.level : Level 1
*/
LITE_TEST_CASE
(
HieventLiteTestSuite
,
HieventLiteFuncTest002
,
Level1
)
{
HiEvent
*
e
=
HiEventCreate
(
HIEVENT_FAULT
,
1
,
3
);
TEST_ASSERT_NOT_NULL
(
e
);
HiEventPutInteger
(
e
,
1
,
0
);
HiEventReport
(
e
);
HiEventFlush
(
FALSE
);
};
/**
* @tc.name : HieventLiteFuncTest003
* @tc.desc : Test HiEventCreate
* @tc.level : Level 1
*/
LITE_TEST_CASE
(
HieventLiteTestSuite
,
HieventLiteFuncTest003
,
Level1
)
{
HiEvent
*
e
=
HiEventCreate
(
HIEVENT_FAULT
,
HIEVENT_TEST_ID
,
3
);
HiEventRegisterProc
(
HieventLiteTestOutputFunc
);
TEST_ASSERT_NOT_NULL
(
e
);
HiEventPutInteger
(
e
,
1
,
0
);
HiEventPutInteger
(
e
,
2
,
10
);
HiEventPutInteger
(
e
,
3
,
20
);
HiEventReport
(
e
);
HiEventFlush
(
TRUE
);
HiEventUnRegisterProc
(
HieventLiteTestOutputFunc
);
};
/**
* @tc.name : HieventLiteFuncTest004
* @tc.desc : Test HiEventCreate
* @tc.level : Level 1
*/
LITE_TEST_CASE
(
HieventLiteTestSuite
,
HieventLiteFuncTest004
,
Level1
)
{
HIEVENT_FAULT_REPORT
(
8
,
1
,
2
);
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录