未验证 提交 76dc5f3c 编写于 作者: O openharmony_ci 提交者: Gitee

!405 fix: fuzztest code build problem

Merge pull request !405 from 熊磊/fuzzrelease
......@@ -27,10 +27,13 @@ ohos_static_library("libfuzz_utils") {
}
##############################fuzztest##########################################
ohos_fuzztest("DoRebootFuzzTest") {
ohos_fuzztest("test_startup_DoRebootFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
include_dirs = [
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
......@@ -45,15 +48,18 @@ ohos_fuzztest("DoRebootFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "DoReboot_fuzzer/DoReboot_fuzzer.cpp" ]
sources = [ "test_startup_DoReboot_fuzzer/test_startup_DoReboot_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("GetControlFileFuzzTest") {
ohos_fuzztest("test_startup_GetControlFileFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
include_dirs = [
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
......@@ -68,15 +74,20 @@ ohos_fuzztest("GetControlFileFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "GetControlFile_fuzzer/GetControlFile_fuzzer.cpp" ]
sources = [
"test_startup_GetControlFile_fuzzer/test_startup_GetControlFile_fuzzer.cpp",
]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("GetControlSocketFuzzTest") {
ohos_fuzztest("test_startup_GetControlSocketFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
include_dirs = [
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
......@@ -90,12 +101,12 @@ ohos_fuzztest("GetControlSocketFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "GetControlSocket_fuzzer/GetControlSocket_fuzzer.cpp" ]
sources = [ "test_startup_GetControlSocket_fuzzer/test_startup_GetControlSocket_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("MountAllFstabFuzzTest") {
ohos_fuzztest("test_startup_MountAllFstabFuzzTest") {
module_out_path = module_output_path
include_dirs = [
......@@ -117,17 +128,20 @@ ohos_fuzztest("MountAllFstabFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "MountAllFstab_fuzzer/MountAllFstab_fuzzer.cpp" ]
sources = [
"test_startup_MountAllFstab_fuzzer/test_startup_MountAllFstab_fuzzer.cpp",
]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("ReadFileInDirFuzzTest") {
ohos_fuzztest("test_startup_ReadFileInDirFuzzTest") {
module_out_path = module_output_path
include_dirs = [
"//base/startup/init_lite/services/init/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
......@@ -142,15 +156,20 @@ ohos_fuzztest("ReadFileInDirFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "ReadFileInDir_fuzzer/ReadFileInDir_fuzzer.cpp" ]
sources = [
"test_startup_ReadFileInDir_fuzzer/test_startup_ReadFileInDir_fuzzer.cpp",
]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("ServiceControlStartFuzzTest") {
ohos_fuzztest("test_startup_ServiceControlStartFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
include_dirs = [
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
"//base/startup/init_lite/services/param:param_client",
......@@ -163,15 +182,18 @@ ohos_fuzztest("ServiceControlStartFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "ServiceControlStart_fuzzer/ServiceControlStart_fuzzer.cpp" ]
sources = [ "test_startup_ServiceControlStart_fuzzer/test_startup_ServiceControlStart_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("ServiceControlStopFuzzTest") {
ohos_fuzztest("test_startup_ServiceControlStopFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
include_dirs = [
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
"//base/startup/init_lite/services/param:param_client",
......@@ -184,12 +206,12 @@ ohos_fuzztest("ServiceControlStopFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "ServiceControlStop_fuzzer/ServiceControlStop_fuzzer.cpp" ]
sources = [ "test_startup_ServiceControlStop_fuzzer/test_startup_ServiceControlStop_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemDumpParametersFuzzTest") {
ohos_fuzztest("test_startup_SystemDumpParametersFuzzTest") {
module_out_path = module_output_path
include_dirs = [
......@@ -211,15 +233,18 @@ ohos_fuzztest("SystemDumpParametersFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "SystemDumpParameters_fuzzer/SystemDumpParameters_fuzzer.cpp" ]
sources = [ "test_startup_SystemDumpParameters_fuzzer/test_startup_SystemDumpParameters_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemFindParameterFuzzTest") {
ohos_fuzztest("test_startup_SystemFindParameterFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/services/include/param" ]
include_dirs = [
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
......@@ -234,15 +259,18 @@ ohos_fuzztest("SystemFindParameterFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "SystemFindParameter_fuzzer/SystemFindParameter_fuzzer.cpp" ]
sources = [ "test_startup_SystemFindParameter_fuzzer/test_startup_SystemFindParameter_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemGetParameterFuzzTest") {
ohos_fuzztest("test_startup_SystemGetParameterFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/services/include/param" ]
include_dirs = [
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
......@@ -257,15 +285,18 @@ ohos_fuzztest("SystemGetParameterFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "SystemGetParameter_fuzzer/SystemGetParameter_fuzzer.cpp" ]
sources = [ "test_startup_SystemGetParameter_fuzzer/test_startup_SystemGetParameter_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemGetParameterCommitIdFuzzTest") {
ohos_fuzztest("test_startup_SystemGetParameterCommitIdFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/services/include/param" ]
include_dirs = [
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
......@@ -280,17 +311,18 @@ ohos_fuzztest("SystemGetParameterCommitIdFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [
"SystemGetParameterCommitId_fuzzer/SystemGetParameterCommitId_fuzzer.cpp",
]
sources = [ "test_startup_SystemGetParameterCommitId_fuzzer/test_startup_SystemGetParameterCommitId_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemGetParameterNameFuzzTest") {
ohos_fuzztest("test_startup_SystemGetParameterNameFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/services/include/param" ]
include_dirs = [
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
......@@ -305,16 +337,18 @@ ohos_fuzztest("SystemGetParameterNameFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources =
[ "SystemGetParameterName_fuzzer/SystemGetParameterName_fuzzer.cpp" ]
sources = [ "test_startup_SystemGetParameterName_fuzzer/test_startup_SystemGetParameterName_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemGetParameterValueFuzzTest") {
ohos_fuzztest("test_startup_SystemGetParameterValueFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/services/include/param" ]
include_dirs = [
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
......@@ -329,16 +363,18 @@ ohos_fuzztest("SystemGetParameterValueFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources =
[ "SystemGetParameterValue_fuzzer/SystemGetParameterValue_fuzzer.cpp" ]
sources = [ "test_startup_SystemGetParameterValue_fuzzer/test_startup_SystemGetParameterValue_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemSetParameterFuzztest") {
ohos_fuzztest("test_startup_SystemSetParameterFuzztest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/services/include/param" ]
include_dirs = [
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
......@@ -353,12 +389,12 @@ ohos_fuzztest("SystemSetParameterFuzztest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "SystemSetParameter_fuzzer/SystemSetParameter_fuzzer.cpp" ]
sources = [ "test_startup_SystemSetParameter_fuzzer/test_startup_SystemSetParameter_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemTraversalParameterFuzztest") {
ohos_fuzztest("test_startup_SystemTraversalParameterFuzztest") {
module_out_path = module_output_path
include_dirs = [
......@@ -382,16 +418,18 @@ ohos_fuzztest("SystemTraversalParameterFuzztest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources =
[ "SystemTraversalParameter_fuzzer/SystemTraversalParameter_fuzzer.cpp" ]
sources = [ "test_startup_SystemTraversalParameter_fuzzer/test_startup_SystemTraversalParameter_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemWaitParameterFuzzTest") {
ohos_fuzztest("test_startup_SystemWaitParameterFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/services/include/param" ]
include_dirs = [
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
......@@ -406,17 +444,18 @@ ohos_fuzztest("SystemWaitParameterFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "SystemWaitParameter_fuzzer/SystemWaitParameter_fuzzer.cpp" ]
sources = [ "test_startup_SystemWaitParameter_fuzzer/test_startup_SystemWaitParameter_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemWatchParameterFuzzTest") {
ohos_fuzztest("test_startup_SystemWatchParameterFuzzTest") {
module_out_path = module_output_path
include_dirs = [
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/services/init/include",
"//base/startup/init_lite/test/fuzztest/utils/include",
]
deps = [
......@@ -440,12 +479,12 @@ ohos_fuzztest("SystemWatchParameterFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "SystemWatchParameter_fuzzer/SystemWatchParameter_fuzzer.cpp" ]
sources = [ "test_startup_SystemWatchParameter_fuzzer/test_startup_SystemWatchParameter_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("UmountAllFstabFuzzTest") {
ohos_fuzztest("test_startup_UmountAllFstabFuzzTest") {
module_out_path = module_output_path
include_dirs = [
......@@ -454,7 +493,7 @@ ohos_fuzztest("UmountAllFstabFuzzTest") {
]
deps = [
"//base/startup/init_lite/interfaces/innerkits/fs_manager:libfsmanager_static",
"//base/startup/init_lite/interfaces/innerkits:libfsmanager_static",
"//base/startup/init_lite/services/log:init_log",
"//base/startup/init_lite/services/utils:libinit_utils",
"//base/startup/init_lite/test/fuzztest:libfuzz_utils",
......@@ -467,7 +506,9 @@ ohos_fuzztest("UmountAllFstabFuzzTest") {
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "UmountAllFstab_fuzzer/UmountAllFstab_fuzzer.cpp" ]
sources = [
"test_startup_UmountAllFstab_fuzzer/test_startup_UmountAllFstab_fuzzer.cpp",
]
defines = [ "STARTUP_INIT_TEST" ]
}
......@@ -478,24 +519,24 @@ group("fuzztest") {
deps = []
deps += [
# deps file
":DoRebootFuzzTest",
":GetControlFileFuzzTest",
":GetControlSocketFuzzTest",
":MountAllFstabFuzzTest",
":ReadFileInDirFuzzTest",
":StartDynamicProcessFuzzTest",
":StopDynamicProcessFuzzTest",
":SystemDumpParametersFuzzTest",
":SystemFindParameterFuzzTest",
":SystemGetParameterCommitIdFuzzTest",
":SystemGetParameterFuzzTest",
":SystemGetParameterNameFuzzTest",
":SystemGetParameterValueFuzzTest",
":SystemSetParameterFuzztest",
":SystemTraversalParameterFuzztest",
":SystemWaitParameterFuzzTest",
":SystemWatchParameterFuzzTest",
":UmountAllFstabFuzzTest",
":test_startup_DoRebootFuzzTest",
":test_startup_GetControlFileFuzzTest",
":test_startup_GetControlSocketFuzzTest",
":test_startup_MountAllFstabFuzzTest",
":test_startup_ReadFileInDirFuzzTest",
":test_startup_ServiceControlStartFuzzTest",
":test_startup_ServiceControlStopFuzzTest",
":test_startup_SystemDumpParametersFuzzTest",
":test_startup_SystemFindParameterFuzzTest",
":test_startup_SystemGetParameterCommitIdFuzzTest",
":test_startup_SystemGetParameterFuzzTest",
":test_startup_SystemGetParameterNameFuzzTest",
":test_startup_SystemGetParameterValueFuzzTest",
":test_startup_SystemSetParameterFuzztest",
":test_startup_SystemTraversalParameterFuzztest",
":test_startup_SystemWaitParameterFuzzTest",
":test_startup_SystemWatchParameterFuzzTest",
":test_startup_UmountAllFstabFuzzTest",
]
}
###############################################################################
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "DoReboot_fuzzer.h"
#include "test_startup_DoReboot_fuzzer.h"
#include "init_reboot.h"
namespace OHOS {
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_DOREBOOT_FUZZER_H
#define TEST_FUZZTEST_DOREBOOT_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "DoReboot_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "GetControlFile_fuzzer.h"
#include "test_startup_GetControlFile_fuzzer.h"
#include "init_file.h"
namespace OHOS {
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_GETCONTROLFILE_FUZZER_H
#define TEST_FUZZTEST_GETCONTROLFILE_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "GetControlFile_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "GetControlSocket_fuzzer.h"
#include "test_startup_GetControlSocket_fuzzer.h"
#include "init_socket.h"
namespace OHOS {
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_GETCONTROLSOCKET_FUZZER_H
#define TEST_FUZZTEST_GETCONTROLSOCKET_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "GetControlSocket_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "MountAllFstab_fuzzer.h"
#include "test_startup_MountAllFstab_fuzzer.h"
#include <iostream>
#include "fs_manager/fs_manager.h"
......@@ -29,7 +29,7 @@ namespace OHOS {
std::cout << "[fuzz] open file fstab.test failed";
return false;
}
if (reinterpret_cast<int>(fwrite(data, 1, size, pFile)) != size) {
if (fwrite(data, 1, size, pFile) != size) {
std::cout << "[fuzz] write data to fstab.test failed";
(void)fclose(pFile);
return false;
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_MOUNTALLFSTAB_FUZZER_H
#define TEST_FUZZTEST_MOUNTALLFSTAB_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "MountAllFstab_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "ReadFileInDir_fuzzer.h"
#include "test_startup_ReadFileInDir_fuzzer.h"
#include <fstream>
#include <iostream>
......@@ -47,7 +47,7 @@ namespace OHOS {
std::cout << "[fuzz] open file ReadFileInDir.test failed";
return false;
}
if (reinterpret_cast<int>(fwrite(data, 1, size, pFile)) != size) {
if (fwrite(data, 1, size, pFile) != size) {
std::cout << "[fuzz] write data to ReadFileInDir.test failed";
(void)fclose(pFile);
return false;
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_READFILEINDIR_FUZZER_H
#define TEST_FUZZTEST_READFILEINDIR_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "ReadFileInDir_fuzzer"
#endif
......@@ -13,14 +13,14 @@
* limitations under the License.
*/
#include "ServiceControlStart_fuzzer.h"
#include "test_startup_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) {
if (!ServiceControl(reinterpret_cast<const char*>(data), START)) {
result = true;
}
return result;
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_STARTDYNAMICPROCESS_FUZZER_H
#define TEST_FUZZTEST_STARTDYNAMICPROCESS_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "ServiceControlStart_fuzzer"
#endif
......@@ -13,14 +13,14 @@
* limitations under the License.
*/
#include "ServiceControlStop_fuzzer.h"
#include "test_startup_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) {
if (!ServiceControl(reinterpret_cast<const char*>(data), STOP)) {
result = true;
}
return result;
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_STOPDYNAMICPROCESS_FUZZER_H
#define TEST_FUZZTEST_STOPDYNAMICPROCESS_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "ServiceControlStop_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemDumpParameters_fuzzer.h"
#include "test_startup_SystemDumpParameters_fuzzer.h"
#include "sys_param.h"
#include "fuzz_utils.h"
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMDUMPPARAMETERS_FUZZER_H
#define TEST_FUZZTEST_SYSTEMDUMPPARAMETERS_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemDumpParameters_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemFindParameter_fuzzer.h"
#include "test_startup_SystemFindParameter_fuzzer.h"
#include "sys_param.h"
static ParamHandle handle;
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMFINDPARAMETER_FUZZER_H
#define TEST_FUZZTEST_SYSTEMFINDPARAMETER_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemFindParameter_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemGetParameterCommitId_fuzzer.h"
#include "test_startup_SystemGetParameterCommitId_fuzzer.h"
#include "sys_param.h"
namespace OHOS {
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMGETPARAMETERCOMMITID_FUZZER_H
#define TEST_FUZZTEST_SYSTEMGETPARAMETERCOMMITID_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemGetParameterCommitId_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemGetParameterName_fuzzer.h"
#include "test_startup_SystemGetParameterName_fuzzer.h"
#include "sys_param.h"
namespace OHOS {
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMGETPARAMETERNAME_FUZZER_H
#define TEST_FUZZTEST_SYSTEMGETPARAMETERNAME_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemGetParameterName_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemGetParameterValue_fuzzer.h"
#include "test_startup_SystemGetParameterValue_fuzzer.h"
#include "sys_param.h"
namespace OHOS {
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMGETPARAMETERVALUE_FUZZER_H
#define TEST_FUZZTEST_SYSTEMGETPARAMETERVALUE_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemGetParameterValue_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemGetParameter_fuzzer.h"
#include "test_startup_SystemGetParameter_fuzzer.h"
#include <iostream>
#include "sys_param.h"
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMGETPARAMETER_FUZZER_H
#define TEST_FUZZTEST_SYSTEMGETPARAMETER_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemGetParameter_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemSetParameter_fuzzer.h"
#include "test_startup_SystemSetParameter_fuzzer.h"
#include "sys_param.h"
namespace OHOS {
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMSETPARAMETER_FUZZER_H
#define TEST_FUZZTEST_SYSTEMSETPARAMETER_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemSetParameter_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemTraversalParameter_fuzzer.h"
#include "test_startup_SystemTraversalParameter_fuzzer.h"
#include "fuzz_utils.h"
#include "init.h"
......@@ -51,7 +51,7 @@ namespace OHOS {
if (ret != EOK) {
return false;
}
if (!SystemTraversalParameter(FakeShowParam, reinterpret_cast<void*>(cookie))) {
if (!SystemTraversalParameter(nullptr, FakeShowParam, reinterpret_cast<void*>(cookie))) {
result = true;
}
free(cookie->data);
......
......@@ -15,6 +15,7 @@
#ifndef TEST_FUZZTEST_SYSTEMTRAVERSALPARAMETER_FUZZER_H
#define TEST_FUZZTEST_SYSTEMTRAVERSALPARAMETER_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemTraversalParameter_fuzzer"
typedef struct {
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemWaitParameter_fuzzer.h"
#include "test_startup_SystemWaitParameter_fuzzer.h"
#include "sys_param.h"
namespace OHOS {
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMWAITPARAMETER_FUZZER_H
#define TEST_FUZZTEST_SYSTEMWAITPARAMETER_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemWaitParameter_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "SystemWatchParameter_fuzzer.h"
#include "test_startup_SystemWatchParameter_fuzzer.h"
#include "init.h"
#include "sys_param.h"
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_SYSTEMWATCHPARAMETER_FUZZER_H
#define TEST_FUZZTEST_SYSTEMWATCHPARAMETER_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "SystemWatchParameter_fuzzer"
#endif
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "UmountAllFstab_fuzzer.h"
#include "test_startup_UmountAllFstab_fuzzer.h"
#include <iostream>
#include "fs_manager/fs_manager.h"
......@@ -29,7 +29,7 @@ namespace OHOS {
std::cout << "[fuzz] open file fstab.test failed";
return false;
}
if (reinterpret_cast<int>(fwrite(data, 1, size, pFile)) != size) {
if (fwrite(data, 1, size, pFile) != size) {
std::cout << "[fuzz] write data to fstab.test failed";
(void)fclose(pFile);
return false;
......
......@@ -15,5 +15,6 @@
#ifndef TEST_FUZZTEST_UMOUNTALLFSTAB_FUZZER_H
#define TEST_FUZZTEST_UMOUNTALLFSTAB_FUZZER_H
#include "fuzz_utils.h"
#define FUZZ_PROJECT_NAME "UmountAllFstab_fuzzer"
#endif
......@@ -15,6 +15,8 @@
#ifndef FUZZ_UTILS_H
#define FUZZ_UTILS_H
#include <stdint.h>
#include <stdlib.h>
void CloseStdout(void);
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册