diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index 9b8fa3a211b84602bf7a3da106261ae77668dc1b..b21736520a16e9a0f71506b922e97eacaeb38ed5 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -2020,60 +2020,6 @@ ohos_fuzztest("ReceiveFdsFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("LoadFstabFromCommandLineFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = - "//base/startup/init/test/fuzztest/loadfstabfromcommandline_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ - "//base/startup/init/interfaces/innerkits:libbegetutil", - "//base/startup/init/interfaces/innerkits/fs_manager:libfsmanager_static", - ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = - [ "loadfstabfromcommandline_fuzzer/loadfstabfromcommandline_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetBootSlotsFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getbootslots_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ - "//base/startup/init/interfaces/innerkits:libbegetutil", - "//base/startup/init/interfaces/innerkits/fs_manager:libfsmanager_static", - ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getbootslots_fuzzer/getbootslots_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("GetCurrentSlotFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/getcurrentslot_fuzzer" @@ -2150,29 +2096,6 @@ ohos_fuzztest("GetOSFullNameFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("GetVersionIdFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getversionid_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getversionid_fuzzer/getversionid_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("GetBuildRootHashFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/getbuildroothash_fuzzer" @@ -2242,29 +2165,6 @@ ohos_fuzztest("GetSdkApiVersionFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("GetDeviceTypeCFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getdevicetypec_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getdevicetypec_fuzzer/getdevicetypec_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("GetDeviceNodePermissionsFuzzTest") { module_out_path = module_output_path fuzz_config_file = @@ -2324,29 +2224,6 @@ ohos_fuzztest("GetDeviceUdevConfByDevNodeFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("GetProductModelFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getproductmodel_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getproductmodel_fuzzer/getproductmodel_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("GetManufactureFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/getmanufacture_fuzzer" @@ -2370,168 +2247,6 @@ ohos_fuzztest("GetManufactureFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("GetBrandFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getbrand_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getbrand_fuzzer/getbrand_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetMarketNameFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getmarketname_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getmarketname_fuzzer/getmarketname_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetProductSeriesFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getproductseries_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getproductseries_fuzzer/getproductseries_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetSoftwareModelFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getsoftwaremodel_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getsoftwaremodel_fuzzer/getsoftwaremodel_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetHardwareModelFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/gethardwaremodel_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "gethardwaremodel_fuzzer/gethardwaremodel_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetHardwareProfileFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = - "//base/startup/init/test/fuzztest/gethardwareprofile_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "gethardwareprofile_fuzzer/gethardwareprofile_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetSerialFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getserial_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getserial_fuzzer/getserial_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("GetAbiListFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/getabilist_fuzzer" @@ -2555,54 +2270,6 @@ ohos_fuzztest("GetAbiListFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("GetDisplayVersionFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = - "//base/startup/init/test/fuzztest/getdisplayversion_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getdisplayversion_fuzzer/getdisplayversion_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetIncrementalVersionFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = - "//base/startup/init/test/fuzztest/getincrementalversion_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getincrementalversion_fuzzer/getincrementalversion_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("GetBootloaderVersionFuzzTest") { module_out_path = module_output_path fuzz_config_file = @@ -2673,29 +2340,6 @@ ohos_fuzztest("GetBuildUserFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("GetBuildHostFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getbuildhost_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getbuildhost_fuzzer/getbuildhost_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("GetBuildTimeFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/getbuildtime_fuzzer" @@ -2719,30 +2363,6 @@ ohos_fuzztest("GetBuildTimeFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("GetFirstApiVersionFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = - "//base/startup/init/test/fuzztest/getfirstapiversion_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getfirstapiversion_fuzzer/getfirstapiversion_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("AclGetSerialFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/aclgetserial_fuzzer" @@ -2769,53 +2389,6 @@ ohos_fuzztest("AclGetSerialFuzzTest") { defines = [ "STARTUP_INIT_TEST" ] } -ohos_fuzztest("GetSystemCommitIdFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = - "//base/startup/init/test/fuzztest/getsystemcommitid_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getsystemcommitid_fuzzer/getsystemcommitid_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - -ohos_fuzztest("GetDeviceTypeCppFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getdevicetypecpp_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getdevicetypecpp_fuzzer/getdevicetypecpp_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("GetMajorVersionFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/getmajorversion_fuzzer" @@ -3136,29 +2709,6 @@ ohos_fuzztest("ProcessWatcherMessageFuzzTest") { } } -ohos_fuzztest("GetBuildVersionFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/getbuildversion_fuzzer" - - include_dirs = [ - "//base/startup/init/interfaces/innerkits/fd_holder", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "getbuildversion_fuzzer/getbuildversion_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("AclGetDevUdidFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/aclgetdevudid_fuzzer" @@ -3513,29 +3063,6 @@ ohos_fuzztest("RefreshWatcherFuzzTest") { } } -ohos_fuzztest("SaveParametersFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "//base/startup/init/test/fuzztest/saveparameters_fuzzer" - - include_dirs = [ - "//base/startup/init/services/include/param", - "//base/startup/init/test/fuzztest/utils/include", - ] - - deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ] - external_deps = [ "bounds_checking_function:libsec_static" ] - external_deps += [ "hilog:libhilog" ] - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "saveparameters_fuzzer/saveparameters_fuzzer.cpp" ] - defines = [ "STARTUP_INIT_TEST" ] -} - ohos_fuzztest("SystemWaitParameterFuzzTest") { module_out_path = module_output_path fuzz_config_file = @@ -3993,6 +3520,35 @@ ohos_fuzztest("AddWatcherGroupFuzzTest") { } } +ohos_fuzztest("ParamFuzzTest") { + module_out_path = module_output_path + fuzz_config_file = + "//base/startup/init/test/fuzztest/param_fuzzer" + + include_dirs = [ + "//base/startup/init/interfaces/innerkits/fd_holder", + "//base/startup/init/test/fuzztest/utils/include", + ] + + deps = [ + "//base/startup/init/interfaces/innerkits:libbegetutil", + "//base/startup/init/interfaces/innerkits/fs_manager:libfsmanager_static", + ] + + external_deps = [ "bounds_checking_function:libsec_static" ] + external_deps += [ "hilog:libhilog" ] + + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = + [ "param_fuzzer/param_fuzzer.cpp" ] + defines = [ "STARTUP_INIT_TEST" ] +} + ohos_fuzztest("DUMPFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//base/startup/init/test/fuzztest/dump_fuzzer" @@ -4148,34 +3704,22 @@ group("fuzztest") { ":GetBlockDeviceByNameFuzzTest", ":GetBlockDevicePathFuzzTest", ":GetBoolParameterCppFuzzTest", - ":GetBootSlotsFuzzTest", ":GetBootloaderVersionFuzzTest", - ":GetBrandFuzzTest", - ":GetBuildHostFuzzTest", ":GetBuildRootHashFuzzTest", ":GetBuildTimeFuzzTest", ":GetBuildTypeFuzzTest", ":GetBuildUserFuzzTest", - ":GetBuildVersionFuzzTest", ":GetControlFileFuzzTest", ":GetControlSocketFuzzTest", ":GetCurrentSlotFuzzTest", ":GetDevUdidFuzzTest", ":GetDeviceNodePermissionsFuzzTest", - ":GetDeviceTypeCFuzzTest", - ":GetDeviceTypeCppFuzzTest", ":GetDeviceUdevConfByDevNodeFuzzTest", - ":GetDisplayVersionFuzzTest", ":GetFeatureVersionFuzzTest", - ":GetFirstApiVersionFuzzTest", - ":GetHardwareModelFuzzTest", - ":GetHardwareProfileFuzzTest", - ":GetIncrementalVersionFuzzTest", ":GetIntParameterCFuzzTest", ":GetIntParameterCppFuzzTest", ":GetMajorVersionFuzzTest", ":GetManufactureFuzzTest", - ":GetMarketNameFuzzTest", ":GetMountStatusForMountPointFuzzTest", ":GetOSFullNameFuzzTest", ":GetOsReleaseTypeFuzzTest", @@ -4185,18 +3729,12 @@ group("fuzztest") { ":GetParameterCppFuzzTest", ":GetParameterNameFuzzTest", ":GetParameterValueFuzzTest", - ":GetProductModelFuzzTest", - ":GetProductSeriesFuzzTest", ":GetSdkApiVersionFuzzTest", ":GetSecurityPatchTagFuzzTest", ":GetSeniorVersionFuzzTest", - ":GetSerialFuzzTest", ":GetServiceCtrlInfoFuzzTest", - ":GetSoftwareModelFuzzTest", ":GetStringParameterFuzzTest", - ":GetSystemCommitIdFuzzTest", ":GetUintParameterCFuzzTest", - ":GetVersionIdFuzzTest", ":HandleBlockDeviceEventFuzzTest", ":HandleOtherDeviceEventFuzzTest", ":HasSystemCapabilityFuzzTest", @@ -4211,7 +3749,6 @@ group("fuzztest") { ":InitWorkSpaceFuzzTest", ":IsSupportedFilesystemFuzzTest", ":LoadFscryptPolicyFuzzTest", - ":LoadFstabFromCommandLineFuzzTest", ":LoadParamFromCmdLineFuzzTest", ":ModuleMgrCreateFuzzTest", ":ModuleMgrDestroyFuzzTest", @@ -4261,6 +3798,7 @@ group("fuzztest") { ":WriteAllFuzzTest", ":OnRemoteDiedFuzzTest", ":OnStopFuzzTest", + ":ParamFuzzTest" ] } ############################################################################### diff --git a/test/fuzztest/getbootslots_fuzzer/getbootslots_fuzzer.h b/test/fuzztest/getbootslots_fuzzer/getbootslots_fuzzer.h deleted file mode 100644 index 249839e967987a78ffc1f7d505e6fd026489c441..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbootslots_fuzzer/getbootslots_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_BOOT_SLOTS_H -#define TEST_FUZZTEST_GET_BOOT_SLOTS_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getbootslots_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getbootslots_fuzzer/project.xml b/test/fuzztest/getbootslots_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbootslots_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getbrand_fuzzer/corpus/init b/test/fuzztest/getbrand_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbrand_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getbrand_fuzzer/getbrand_fuzzer.cpp b/test/fuzztest/getbrand_fuzzer/getbrand_fuzzer.cpp deleted file mode 100644 index dd98b230dd43a76ff88b7214ada33aaa7a2b3eaa..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbrand_fuzzer/getbrand_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getbrand_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetBrand(const uint8_t* data, size_t size) - { - bool result = false; - if (GetBrand() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetBrand(data, size); - return 0; -} diff --git a/test/fuzztest/getbrand_fuzzer/project.xml b/test/fuzztest/getbrand_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbrand_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getbuildhost_fuzzer/corpus/init b/test/fuzztest/getbuildhost_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbuildhost_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getbuildhost_fuzzer/getbuildhost_fuzzer.cpp b/test/fuzztest/getbuildhost_fuzzer/getbuildhost_fuzzer.cpp deleted file mode 100644 index c8c8d04fd6a8f2b993678c10ccfa0ffd0f1f1d17..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbuildhost_fuzzer/getbuildhost_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getbuildhost_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetBuildHost(const uint8_t* data, size_t size) - { - bool result = false; - if (GetBuildHost() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetBuildHost(data, size); - return 0; -} diff --git a/test/fuzztest/getbuildhost_fuzzer/getbuildhost_fuzzer.h b/test/fuzztest/getbuildhost_fuzzer/getbuildhost_fuzzer.h deleted file mode 100644 index a33e412365939b4e6b3772e17bce18f6988da720..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbuildhost_fuzzer/getbuildhost_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_BUILD_HOST_H -#define TEST_FUZZTEST_GET_BUILD_HOST_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getbuildhost_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getbuildversion_fuzzer/corpus/init b/test/fuzztest/getbuildversion_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbuildversion_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getbuildversion_fuzzer/getbuildversion_fuzzer.cpp b/test/fuzztest/getbuildversion_fuzzer/getbuildversion_fuzzer.cpp deleted file mode 100644 index 75c72bf3f818f0c2f006b3bfa13456f8962e3e09..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbuildversion_fuzzer/getbuildversion_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getbuildversion_fuzzer.h" -#include -#include "sysversion.h" - -namespace OHOS { - bool FuzzGetBuildVersion(const uint8_t* data, size_t size) - { - bool result = false; - if (!GetBuildVersion()) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetBuildVersion(data, size); - return 0; -} diff --git a/test/fuzztest/getbuildversion_fuzzer/getbuildversion_fuzzer.h b/test/fuzztest/getbuildversion_fuzzer/getbuildversion_fuzzer.h deleted file mode 100644 index 03e6ca8e678d6639ef55ffeedf18d3bd84866976..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbuildversion_fuzzer/getbuildversion_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_BUILD_VERSION_H -#define TEST_FUZZTEST_GET_BUILD_VERSION_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getbuildversion_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getbuildversion_fuzzer/project.xml b/test/fuzztest/getbuildversion_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getbuildversion_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getdevicetypec_fuzzer/corpus/init b/test/fuzztest/getdevicetypec_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getdevicetypec_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getdevicetypec_fuzzer/getdevicetypec_fuzzer.cpp b/test/fuzztest/getdevicetypec_fuzzer/getdevicetypec_fuzzer.cpp deleted file mode 100644 index d0383126de471d1abc9b5f5870c8812b74c9b0c7..0000000000000000000000000000000000000000 --- a/test/fuzztest/getdevicetypec_fuzzer/getdevicetypec_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getdevicetypec_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetDeviceCType(const uint8_t* data, size_t size) - { - bool result = false; - if (GetDeviceType() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetDeviceCType(data, size); - return 0; -} diff --git a/test/fuzztest/getdevicetypec_fuzzer/getdevicetypec_fuzzer.h b/test/fuzztest/getdevicetypec_fuzzer/getdevicetypec_fuzzer.h deleted file mode 100644 index 7038e88be13178b6cfbb65a652fedebd6789bcd9..0000000000000000000000000000000000000000 --- a/test/fuzztest/getdevicetypec_fuzzer/getdevicetypec_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_DEVICE_TYPE_C_H -#define TEST_FUZZTEST_GET_DEVICE_TYPE_C_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getdevicetypec_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getdevicetypec_fuzzer/project.xml b/test/fuzztest/getdevicetypec_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getdevicetypec_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getdevudid_fuzzer/getdevudid_fuzzer.cpp b/test/fuzztest/getdevudid_fuzzer/getdevudid_fuzzer.cpp index ecfd3995b641c31bc790c7efab1a766951038f01..f10cb28c3d0550899832ba95e5a2a8d3e6516435 100644 --- a/test/fuzztest/getdevudid_fuzzer/getdevudid_fuzzer.cpp +++ b/test/fuzztest/getdevudid_fuzzer/getdevudid_fuzzer.cpp @@ -16,16 +16,29 @@ #include "getdevudid_fuzzer.h" #include #include "parameter.h" +#include "securec.h" namespace OHOS { bool FuzzGetDevUdid(const uint8_t* data, size_t size) { + if (data == nullptr || size == 0) { + return false; + } + char* udid = new (std::nothrow) char[size + 1]; + if (udid == nullptr) { + return false; + } + if (memcpy_s(udid, size + 1, data, size) != EOK) { + delete[] udid; + return false; + } + udid[size] = '\0'; bool result = false; - char udid[65] = {0}; - int len = sizeof(udid); - if (!GetDevUdid(udid, len)) { + if (!GetDevUdid(udid, size)) { result = true; - }; + } + + delete[] udid; return result; } } diff --git a/test/fuzztest/getdisplayversion_fuzzer/corpus/init b/test/fuzztest/getdisplayversion_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getdisplayversion_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getdisplayversion_fuzzer/getdisplayversion_fuzzer.cpp b/test/fuzztest/getdisplayversion_fuzzer/getdisplayversion_fuzzer.cpp deleted file mode 100644 index d76ea2df436b2d5018b3065f20836aa8a7a08bb1..0000000000000000000000000000000000000000 --- a/test/fuzztest/getdisplayversion_fuzzer/getdisplayversion_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getdisplayversion_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetDisplayVersion(const uint8_t* data, size_t size) - { - bool result = false; - if (GetDisplayVersion() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetDisplayVersion(data, size); - return 0; -} diff --git a/test/fuzztest/getdisplayversion_fuzzer/getdisplayversion_fuzzer.h b/test/fuzztest/getdisplayversion_fuzzer/getdisplayversion_fuzzer.h deleted file mode 100644 index 0fb9fac217839098e9b3df7d592c4616b6e684e8..0000000000000000000000000000000000000000 --- a/test/fuzztest/getdisplayversion_fuzzer/getdisplayversion_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_DISPLAY_VERSION_H -#define TEST_FUZZTEST_GET_DISPLAY_VERSION_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getdisplayversion_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getdisplayversion_fuzzer/project.xml b/test/fuzztest/getdisplayversion_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getdisplayversion_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getfirstapiversion_fuzzer/corpus/init b/test/fuzztest/getfirstapiversion_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getfirstapiversion_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getfirstapiversion_fuzzer/getfirstapiversion_fuzzer.cpp b/test/fuzztest/getfirstapiversion_fuzzer/getfirstapiversion_fuzzer.cpp deleted file mode 100644 index f022c2aab1614fd6658dce63b3a11bdc61208e9f..0000000000000000000000000000000000000000 --- a/test/fuzztest/getfirstapiversion_fuzzer/getfirstapiversion_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getfirstapiversion_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetFirstApiVersion(const uint8_t* data, size_t size) - { - bool result = false; - if (!GetFirstApiVersion()) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetFirstApiVersion(data, size); - return 0; -} diff --git a/test/fuzztest/getfirstapiversion_fuzzer/getfirstapiversion_fuzzer.h b/test/fuzztest/getfirstapiversion_fuzzer/getfirstapiversion_fuzzer.h deleted file mode 100644 index 271ac6a7f83ca2ffb7335ad9c6b5752a4f3aab2b..0000000000000000000000000000000000000000 --- a/test/fuzztest/getfirstapiversion_fuzzer/getfirstapiversion_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_FIRST_API_VERSION_H -#define TEST_FUZZTEST_GET_FIRST_API_VERSION_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getfirstapiversion_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getfirstapiversion_fuzzer/project.xml b/test/fuzztest/getfirstapiversion_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getfirstapiversion_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/gethardwaremodel_fuzzer/corpus/init b/test/fuzztest/gethardwaremodel_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/gethardwaremodel_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/gethardwaremodel_fuzzer/gethardwaremodel_fuzzer.cpp b/test/fuzztest/gethardwaremodel_fuzzer/gethardwaremodel_fuzzer.cpp deleted file mode 100644 index b7851fc8ad949cfc8a2ed130c9de610edc5661b1..0000000000000000000000000000000000000000 --- a/test/fuzztest/gethardwaremodel_fuzzer/gethardwaremodel_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "gethardwaremodel_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetHardwareModel(const uint8_t* data, size_t size) - { - bool result = false; - if (GetHardwareModel() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetHardwareModel(data, size); - return 0; -} diff --git a/test/fuzztest/gethardwaremodel_fuzzer/gethardwaremodel_fuzzer.h b/test/fuzztest/gethardwaremodel_fuzzer/gethardwaremodel_fuzzer.h deleted file mode 100644 index 81bd3e675555f2914c0d9040e9954f81f6ceff33..0000000000000000000000000000000000000000 --- a/test/fuzztest/gethardwaremodel_fuzzer/gethardwaremodel_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_HARDWARE_MODEL_H -#define TEST_FUZZTEST_GET_HARDWARE_MODEL_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "gethardwaremodel_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/gethardwaremodel_fuzzer/project.xml b/test/fuzztest/gethardwaremodel_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/gethardwaremodel_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/gethardwareprofile_fuzzer/corpus/init b/test/fuzztest/gethardwareprofile_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/gethardwareprofile_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/gethardwareprofile_fuzzer/gethardwareprofile_fuzzer.cpp b/test/fuzztest/gethardwareprofile_fuzzer/gethardwareprofile_fuzzer.cpp deleted file mode 100644 index a299cde89e4601bfd305c82f51d2d3ad28e70bd6..0000000000000000000000000000000000000000 --- a/test/fuzztest/gethardwareprofile_fuzzer/gethardwareprofile_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "gethardwareprofile_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetHardwareProfile(const uint8_t* data, size_t size) - { - bool result = false; - if (GetHardwareProfile() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetHardwareProfile(data, size); - return 0; -} diff --git a/test/fuzztest/gethardwareprofile_fuzzer/gethardwareprofile_fuzzer.h b/test/fuzztest/gethardwareprofile_fuzzer/gethardwareprofile_fuzzer.h deleted file mode 100644 index 33f18b91faace3bebfdd1f1447dbc58e525640a7..0000000000000000000000000000000000000000 --- a/test/fuzztest/gethardwareprofile_fuzzer/gethardwareprofile_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_HARDWARE_PROFILE_H -#define TEST_FUZZTEST_GET_HARDWARE_PROFILE_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "gethardwareprofile_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/gethardwareprofile_fuzzer/project.xml b/test/fuzztest/gethardwareprofile_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/gethardwareprofile_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getincrementalversion_fuzzer/corpus/init b/test/fuzztest/getincrementalversion_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getincrementalversion_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getincrementalversion_fuzzer/getincrementalversion_fuzzer.cpp b/test/fuzztest/getincrementalversion_fuzzer/getincrementalversion_fuzzer.cpp deleted file mode 100644 index 2469c53959a10c5d381b85017e6bc5c7ec9a41c3..0000000000000000000000000000000000000000 --- a/test/fuzztest/getincrementalversion_fuzzer/getincrementalversion_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getincrementalversion_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetIncrementalVersion(const uint8_t* data, size_t size) - { - bool result = false; - if (GetIncrementalVersion() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetIncrementalVersion(data, size); - return 0; -} diff --git a/test/fuzztest/getincrementalversion_fuzzer/getincrementalversion_fuzzer.h b/test/fuzztest/getincrementalversion_fuzzer/getincrementalversion_fuzzer.h deleted file mode 100644 index 40fb3fdd330f6a5d8c877095758fea888641e9ef..0000000000000000000000000000000000000000 --- a/test/fuzztest/getincrementalversion_fuzzer/getincrementalversion_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_INCREMENTAL_VERSION_H -#define TEST_FUZZTEST_GET_INCREMENTAL_VERSION_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getincrementalversion_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getincrementalversion_fuzzer/project.xml b/test/fuzztest/getincrementalversion_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getincrementalversion_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getmarketname_fuzzer/corpus/init b/test/fuzztest/getmarketname_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getmarketname_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getmarketname_fuzzer/getmarketname_fuzzer.cpp b/test/fuzztest/getmarketname_fuzzer/getmarketname_fuzzer.cpp deleted file mode 100644 index 87552415116d3fe77a564f547f229c49eb9ae51b..0000000000000000000000000000000000000000 --- a/test/fuzztest/getmarketname_fuzzer/getmarketname_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getmarketname_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetMarketName(const uint8_t* data, size_t size) - { - bool result = false; - if (GetMarketName() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetMarketName(data, size); - return 0; -} diff --git a/test/fuzztest/getmarketname_fuzzer/getmarketname_fuzzer.h b/test/fuzztest/getmarketname_fuzzer/getmarketname_fuzzer.h deleted file mode 100644 index 4dbdd632ae6bd93d49b1d3e184e05a40019b84de..0000000000000000000000000000000000000000 --- a/test/fuzztest/getmarketname_fuzzer/getmarketname_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_MARKET_NAME_H -#define TEST_FUZZTEST_GET_MARKET_NAME_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getmarketname_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getmarketname_fuzzer/project.xml b/test/fuzztest/getmarketname_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getmarketname_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getproductmodel_fuzzer/corpus/init b/test/fuzztest/getproductmodel_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getproductmodel_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getproductmodel_fuzzer/getproductmodel_fuzzer.cpp b/test/fuzztest/getproductmodel_fuzzer/getproductmodel_fuzzer.cpp deleted file mode 100644 index ef72f4b90180300d0e66effafe58a52fe6609177..0000000000000000000000000000000000000000 --- a/test/fuzztest/getproductmodel_fuzzer/getproductmodel_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getproductmodel_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetProductModel(const uint8_t* data, size_t size) - { - bool result = false; - if (GetProductModel() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetProductModel(data, size); - return 0; -} diff --git a/test/fuzztest/getproductmodel_fuzzer/getproductmodel_fuzzer.h b/test/fuzztest/getproductmodel_fuzzer/getproductmodel_fuzzer.h deleted file mode 100644 index 7d5d3a2f20cfa6fe74a63b109359a6cb531fdc56..0000000000000000000000000000000000000000 --- a/test/fuzztest/getproductmodel_fuzzer/getproductmodel_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_PRODUCT_MODULE_H -#define TEST_FUZZTEST_GET_PRODUCT_MODULE_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getproductmodel_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getproductmodel_fuzzer/project.xml b/test/fuzztest/getproductmodel_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getproductmodel_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getproductseries_fuzzer/corpus/init b/test/fuzztest/getproductseries_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getproductseries_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getproductseries_fuzzer/getproductseries_fuzzer.cpp b/test/fuzztest/getproductseries_fuzzer/getproductseries_fuzzer.cpp deleted file mode 100644 index 9eb9d5cbabc19f2cddbbda325362d5e8decf3f40..0000000000000000000000000000000000000000 --- a/test/fuzztest/getproductseries_fuzzer/getproductseries_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getproductseries_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetProductSeries(const uint8_t* data, size_t size) - { - bool result = false; - if (GetProductSeries() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetProductSeries(data, size); - return 0; -} diff --git a/test/fuzztest/getproductseries_fuzzer/getproductseries_fuzzer.h b/test/fuzztest/getproductseries_fuzzer/getproductseries_fuzzer.h deleted file mode 100644 index 3e2740b3319f6f2973351574693d636ba2549b39..0000000000000000000000000000000000000000 --- a/test/fuzztest/getproductseries_fuzzer/getproductseries_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_PRODUCT_SERIES_H -#define TEST_FUZZTEST_GET_PRODUCT_SERIES_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getproductseries_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getproductseries_fuzzer/project.xml b/test/fuzztest/getproductseries_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getproductseries_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getserial_fuzzer/corpus/init b/test/fuzztest/getserial_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getserial_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getserial_fuzzer/getserial_fuzzer.cpp b/test/fuzztest/getserial_fuzzer/getserial_fuzzer.cpp deleted file mode 100644 index e0a7b2cf9eb949878adab77585b4b6bdbfa24240..0000000000000000000000000000000000000000 --- a/test/fuzztest/getserial_fuzzer/getserial_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getserial_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetSerial(const uint8_t* data, size_t size) - { - bool result = false; - if (GetSerial() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetSerial(data, size); - return 0; -} diff --git a/test/fuzztest/getserial_fuzzer/getserial_fuzzer.h b/test/fuzztest/getserial_fuzzer/getserial_fuzzer.h deleted file mode 100644 index 5742d64bd2a7f8051e647579e657ca8a70db5dd7..0000000000000000000000000000000000000000 --- a/test/fuzztest/getserial_fuzzer/getserial_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_SERIAL_H -#define TEST_FUZZTEST_GET_SERIAL_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getserial_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getserial_fuzzer/project.xml b/test/fuzztest/getserial_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getserial_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getsoftwaremodel_fuzzer/corpus/init b/test/fuzztest/getsoftwaremodel_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getsoftwaremodel_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getsoftwaremodel_fuzzer/getsoftwaremodel_fuzzer.cpp b/test/fuzztest/getsoftwaremodel_fuzzer/getsoftwaremodel_fuzzer.cpp deleted file mode 100644 index e747e054f0ecdbf4b6926f8eb77b78a739d488a9..0000000000000000000000000000000000000000 --- a/test/fuzztest/getsoftwaremodel_fuzzer/getsoftwaremodel_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getsoftwaremodel_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetSoftwareModel(const uint8_t* data, size_t size) - { - bool result = false; - if (GetSoftwareModel() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetSoftwareModel(data, size); - return 0; -} diff --git a/test/fuzztest/getsoftwaremodel_fuzzer/getsoftwaremodel_fuzzer.h b/test/fuzztest/getsoftwaremodel_fuzzer/getsoftwaremodel_fuzzer.h deleted file mode 100644 index bdf2dcd5656e75ee78338637a68f78817d8336a0..0000000000000000000000000000000000000000 --- a/test/fuzztest/getsoftwaremodel_fuzzer/getsoftwaremodel_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_SOFTWARE_MODULE_H -#define TEST_FUZZTEST_GET_SOFTWARE_MODULE_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getsoftwaremodel_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getsoftwaremodel_fuzzer/project.xml b/test/fuzztest/getsoftwaremodel_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getsoftwaremodel_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getsystemcommitid_fuzzer/corpus/init b/test/fuzztest/getsystemcommitid_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getsystemcommitid_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getsystemcommitid_fuzzer/getsystemcommitid_fuzzer.cpp b/test/fuzztest/getsystemcommitid_fuzzer/getsystemcommitid_fuzzer.cpp deleted file mode 100644 index 704ec840c1b22e98a40a37a2d16a9a589ab07f3b..0000000000000000000000000000000000000000 --- a/test/fuzztest/getsystemcommitid_fuzzer/getsystemcommitid_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getsystemcommitid_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetSystemCommitId(const uint8_t* data, size_t size) - { - bool result = false; - if (!GetSystemCommitId()) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetSystemCommitId(data, size); - return 0; -} diff --git a/test/fuzztest/getsystemcommitid_fuzzer/getsystemcommitid_fuzzer.h b/test/fuzztest/getsystemcommitid_fuzzer/getsystemcommitid_fuzzer.h deleted file mode 100644 index 221d4a0903b6e9f45605d87466efe5380ba77760..0000000000000000000000000000000000000000 --- a/test/fuzztest/getsystemcommitid_fuzzer/getsystemcommitid_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_SYSTEM_COMMITID_H -#define TEST_FUZZTEST_GET_SYSTEM_COMMITID_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getsystemcommitid_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getsystemcommitid_fuzzer/project.xml b/test/fuzztest/getsystemcommitid_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getsystemcommitid_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getversionid_fuzzer/corpus/init b/test/fuzztest/getversionid_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/getversionid_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/getversionid_fuzzer/getversionid_fuzzer.cpp b/test/fuzztest/getversionid_fuzzer/getversionid_fuzzer.cpp deleted file mode 100644 index 52eff04e1de054f06df0c41bb8d83313d20118dd..0000000000000000000000000000000000000000 --- a/test/fuzztest/getversionid_fuzzer/getversionid_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "getversionid_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzGetVersionId(const uint8_t* data, size_t size) - { - bool result = false; - if (GetVersionId() != nullptr) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzGetVersionId(data, size); - return 0; -} diff --git a/test/fuzztest/getversionid_fuzzer/getversionid_fuzzer.h b/test/fuzztest/getversionid_fuzzer/getversionid_fuzzer.h deleted file mode 100644 index ae0af1322a0ac2f4e8c76b4d8699ef95f489afa4..0000000000000000000000000000000000000000 --- a/test/fuzztest/getversionid_fuzzer/getversionid_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_GET_VERSION_ID_H -#define TEST_FUZZTEST_GET_VERSION_ID_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getversionid_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/getversionid_fuzzer/project.xml b/test/fuzztest/getversionid_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/getversionid_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/loadfstabfromcommandline_fuzzer/corpus/init b/test/fuzztest/loadfstabfromcommandline_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..0000000000000000000000000000000000000000 --- a/test/fuzztest/loadfstabfromcommandline_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/loadfstabfromcommandline_fuzzer/loadfstabfromcommandline_fuzzer.cpp b/test/fuzztest/loadfstabfromcommandline_fuzzer/loadfstabfromcommandline_fuzzer.cpp deleted file mode 100644 index c2d069d3dc4fb4e968b70a8831b1ec9876f0eaf2..0000000000000000000000000000000000000000 --- a/test/fuzztest/loadfstabfromcommandline_fuzzer/loadfstabfromcommandline_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 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 "loadfstabfromcommandline_fuzzer.h" -#include -#include "fs_manager/fs_manager.h" - -namespace OHOS { - bool FuzzLoadFstabFromCommandLine(const uint8_t* data, size_t size) - { - bool result = false; - if (LoadFstabFromCommandLine() != nullptr) { - result = true; - } - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzLoadFstabFromCommandLine(data, size); - return 0; -} diff --git a/test/fuzztest/loadfstabfromcommandline_fuzzer/loadfstabfromcommandline_fuzzer.h b/test/fuzztest/loadfstabfromcommandline_fuzzer/loadfstabfromcommandline_fuzzer.h deleted file mode 100644 index aa52134da3a1363ea5326eee33b811cd82ff0fd2..0000000000000000000000000000000000000000 --- a/test/fuzztest/loadfstabfromcommandline_fuzzer/loadfstabfromcommandline_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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_LOAD_FSTAB_FROM_COMMANDLINE_H -#define TEST_FUZZTEST_LOAD_FSTAB_FROM_COMMANDLINE_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "loadfstabfromcommandline_fuzzer" -#endif \ No newline at end of file diff --git a/test/fuzztest/loadfstabfromcommandline_fuzzer/project.xml b/test/fuzztest/loadfstabfromcommandline_fuzzer/project.xml deleted file mode 100644 index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..0000000000000000000000000000000000000000 --- a/test/fuzztest/loadfstabfromcommandline_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/getbootslots_fuzzer/corpus/init b/test/fuzztest/param_fuzzer/corpus/init similarity index 92% rename from test/fuzztest/getbootslots_fuzzer/corpus/init rename to test/fuzztest/param_fuzzer/corpus/init index 8eb5a7d6eb6b7d71f0c70c244e5768d62bee6ac5..7ade8a0faafeaedba7241e7d4a97b8e1f9691932 100644 --- a/test/fuzztest/getbootslots_fuzzer/corpus/init +++ b/test/fuzztest/param_fuzzer/corpus/init @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 diff --git a/test/fuzztest/getbootslots_fuzzer/getbootslots_fuzzer.cpp b/test/fuzztest/param_fuzzer/param_fuzzer.cpp similarity index 50% rename from test/fuzztest/getbootslots_fuzzer/getbootslots_fuzzer.cpp rename to test/fuzztest/param_fuzzer/param_fuzzer.cpp index ee1deee0fc0ad5d16447939de30d8e19c075320f..6daa35a8d70581e3996750e42ca230363667201e 100644 --- a/test/fuzztest/getbootslots_fuzzer/getbootslots_fuzzer.cpp +++ b/test/fuzztest/param_fuzzer/param_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -13,14 +13,37 @@ * limitations under the License. */ -#include "getbootslots_fuzzer.h" +#include "param_fuzzer.h" #include +#include "parameter.h" #include "fs_manager/fs_manager.h" +#include "sysversion.h" + namespace OHOS { - bool FuzzGetBootSlots(const uint8_t* data, size_t size) + bool FuzzParam(const uint8_t* data, size_t size) { + std::string str(reinterpret_cast(data), size); + WaitParameter(str.c_str(), str.c_str(), 1); GetBootSlots(); + GetFirstApiVersion(); + GetSerial(); + GetProductModel(); + GetIncrementalVersion(); + GetHardwareModel(); + GetBuildVersion(); + LoadFstabFromCommandLine(); + GetDeviceType(); + GetProductSeries(); + SaveParameters(); + GetDisplayVersion(); + GetHardwareProfile(); + GetBrand(); + GetBuildHost(); + GetVersionId(); + GetSoftwareModel(); + GetMarketName(); + GetSystemCommitId(); return true; } } @@ -29,6 +52,6 @@ namespace OHOS { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ - OHOS::FuzzGetBootSlots(data, size); + OHOS::FuzzParam(data, size); return 0; -} +} \ No newline at end of file diff --git a/test/fuzztest/getbrand_fuzzer/getbrand_fuzzer.h b/test/fuzztest/param_fuzzer/param_fuzzer.h similarity index 78% rename from test/fuzztest/getbrand_fuzzer/getbrand_fuzzer.h rename to test/fuzztest/param_fuzzer/param_fuzzer.h index bba400d52c8b306adfbfd08532d5e3b46d79fb5b..4c59866063ca640ad631a800d87dc44ed84fc90f 100644 --- a/test/fuzztest/getbrand_fuzzer/getbrand_fuzzer.h +++ b/test/fuzztest/param_fuzzer/param_fuzzer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2025 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 @@ -13,8 +13,8 @@ * limitations under the License. */ -#ifndef TEST_FUZZTEST_GET_BRAND_H -#define TEST_FUZZTEST_GET_BRAND_H +#ifndef TEST_FUZZTEST_PARAM_FUZZER_H +#define TEST_FUZZTEST_PARAM_FUZZER_H #include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "getbrand_fuzzer" +#define FUZZ_PROJECT_NAME "param_fuzzer" #endif \ No newline at end of file diff --git a/test/fuzztest/getbuildhost_fuzzer/project.xml b/test/fuzztest/param_fuzzer/project.xml similarity index 95% rename from test/fuzztest/getbuildhost_fuzzer/project.xml rename to test/fuzztest/param_fuzzer/project.xml index 949d03efd7477905377ac79f3b0bb374c8ac2e9a..b39473f2f6776874287a2de22477705b1b60385c 100644 --- a/test/fuzztest/getbuildhost_fuzzer/project.xml +++ b/test/fuzztest/param_fuzzer/project.xml @@ -1,5 +1,5 @@ - - - - - 100 - - 30 - - 2048 - - diff --git a/test/fuzztest/saveparameters_fuzzer/saveparameters_fuzzer.cpp b/test/fuzztest/saveparameters_fuzzer/saveparameters_fuzzer.cpp deleted file mode 100644 index 7149b4cfd23ecb2414bfb0b2c15b3c3c19b35dd5..0000000000000000000000000000000000000000 --- a/test/fuzztest/saveparameters_fuzzer/saveparameters_fuzzer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2023 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 "saveparameters_fuzzer.h" -#include -#include "parameter.h" - -namespace OHOS { - bool FuzzSaveParameters(const uint8_t* data, size_t size) - { - bool result = false; - if (SaveParameters()) { - result = true; - }; - return result; - } -} - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - /* Run your code on data */ - OHOS::FuzzSaveParameters(data, size); - return 0; -} diff --git a/test/fuzztest/saveparameters_fuzzer/saveparameters_fuzzer.h b/test/fuzztest/saveparameters_fuzzer/saveparameters_fuzzer.h deleted file mode 100644 index 4dd2d25d22837f371feb035cccd21b5084713d6d..0000000000000000000000000000000000000000 --- a/test/fuzztest/saveparameters_fuzzer/saveparameters_fuzzer.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 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_GET_FIRST_API_VERSION_H -#define TEST_FUZZTEST_GET_FIRST_API_VERSION_H -#include "fuzz_utils.h" -#define FUZZ_PROJECT_NAME "saveparameters_fuzzer" -#endif \ No newline at end of file