Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
798210a9
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
大约 1 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
798210a9
编写于
12月 29, 2021
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init:add fuzztest
Signed-off-by:
N
xionglei6
<
xionglei6@huawei.com
>
上级
d6793472
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
152 addition
and
0 deletion
+152
-0
test/fuzztest/BUILD.gn
test/fuzztest/BUILD.gn
+42
-0
test/fuzztest/ServiceControlStart_fuzzer/ServiceControlStart_fuzzer.cpp
...ServiceControlStart_fuzzer/ServiceControlStart_fuzzer.cpp
+36
-0
test/fuzztest/ServiceControlStart_fuzzer/ServiceControlStart_fuzzer.h
...t/ServiceControlStart_fuzzer/ServiceControlStart_fuzzer.h
+19
-0
test/fuzztest/ServiceControlStop_fuzzer/ServiceControlStop_fuzzer.cpp
...t/ServiceControlStop_fuzzer/ServiceControlStop_fuzzer.cpp
+36
-0
test/fuzztest/ServiceControlStop_fuzzer/ServiceControlStop_fuzzer.h
...est/ServiceControlStop_fuzzer/ServiceControlStop_fuzzer.h
+19
-0
未找到文件。
test/fuzztest/BUILD.gn
浏览文件 @
798210a9
...
@@ -147,6 +147,48 @@ ohos_fuzztest("ReadFileInDirFuzzTest") {
...
@@ -147,6 +147,48 @@ ohos_fuzztest("ReadFileInDirFuzzTest") {
defines = [ "STARTUP_INIT_TEST" ]
defines = [ "STARTUP_INIT_TEST" ]
}
}
ohos_fuzztest("ServiceControlStartFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
"//base/startup/init_lite/services/param:param_client",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
cflags = [
"-g",
"-O0",
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "ServiceControlStart_fuzzer/ServiceControlStart_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("ServiceControlStopFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
"//base/startup/init_lite/services/param:param_client",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
cflags = [
"-g",
"-O0",
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "ServiceControlStop_fuzzer/ServiceControlStop_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemDumpParametersFuzzTest") {
ohos_fuzztest("SystemDumpParametersFuzzTest") {
module_out_path = module_output_path
module_out_path = module_output_path
...
...
test/fuzztest/ServiceControlStart_fuzzer/ServiceControlStart_fuzzer.cpp
0 → 100644
浏览文件 @
798210a9
/*
* 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 "ServiceControlStart_fuzzer.h"
#include "service_control.h"
namespace
OHOS
{
bool
FuzzServiceControlStart
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
ServiceControl
(
reinterpret_cast
<
const
char
*>
(
data
)),
START
)
{
result
=
true
;
}
return
result
;
}
}
/* Fuzzer entry point */
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
/* Run your code on data */
OHOS
::
FuzzServiceControlStart
(
data
,
size
);
return
0
;
}
test/fuzztest/ServiceControlStart_fuzzer/ServiceControlStart_fuzzer.h
0 → 100644
浏览文件 @
798210a9
/*
* 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.
*/
#ifndef TEST_FUZZTEST_STARTDYNAMICPROCESS_FUZZER_H
#define TEST_FUZZTEST_STARTDYNAMICPROCESS_FUZZER_H
#define FUZZ_PROJECT_NAME "ServiceControlStart_fuzzer"
#endif
test/fuzztest/ServiceControlStop_fuzzer/ServiceControlStop_fuzzer.cpp
0 → 100644
浏览文件 @
798210a9
/*
* 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 "ServiceControlStop_fuzzer.h"
#include "service_control.h"
namespace
OHOS
{
bool
FuzzServiceControlStop
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
ServiceControl
(
reinterpret_cast
<
const
char
*>
(
data
)),
STOP
)
{
result
=
true
;
}
return
result
;
}
}
/* Fuzzer entry point */
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
/* Run your code on data */
OHOS
::
FuzzServiceControlStop
(
data
,
size
);
return
0
;
}
test/fuzztest/ServiceControlStop_fuzzer/ServiceControlStop_fuzzer.h
0 → 100644
浏览文件 @
798210a9
/*
* 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.
*/
#ifndef TEST_FUZZTEST_STOPDYNAMICPROCESS_FUZZER_H
#define TEST_FUZZTEST_STOPDYNAMICPROCESS_FUZZER_H
#define FUZZ_PROJECT_NAME "ServiceControlStop_fuzzer"
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录