diff --git a/.vscode/.cache/clangd/wecode-cpp.db-shm b/.vscode/.cache/clangd/wecode-cpp.db-shm new file mode 100644 index 0000000000000000000000000000000000000000..e667935afdff777b85b202266f0b63d81b5dbbb7 Binary files /dev/null and b/.vscode/.cache/clangd/wecode-cpp.db-shm differ diff --git a/.vscode/.cache/clangd/wecode-cpp.db-wal b/.vscode/.cache/clangd/wecode-cpp.db-wal new file mode 100644 index 0000000000000000000000000000000000000000..4c74a1a2e6b1ec987d91aadd5e7c671a43ff530f Binary files /dev/null and b/.vscode/.cache/clangd/wecode-cpp.db-wal differ diff --git a/.vscode/tags-34.wecode-db b/.vscode/tags-34.wecode-db new file mode 100644 index 0000000000000000000000000000000000000000..eddf172d69e9b572062fe938413c09999888eb13 Binary files /dev/null and b/.vscode/tags-34.wecode-db differ diff --git a/.vscode/tags-34.wecode-db-shm b/.vscode/tags-34.wecode-db-shm new file mode 100644 index 0000000000000000000000000000000000000000..5e65d87138a51a5624d1588d85982a950f4c0a65 Binary files /dev/null and b/.vscode/tags-34.wecode-db-shm differ diff --git a/.vscode/tags-34.wecode-db-wal b/.vscode/tags-34.wecode-db-wal new file mode 100644 index 0000000000000000000000000000000000000000..bae852d5bb4026e6b925a0078aba5a13510f6ff0 Binary files /dev/null and b/.vscode/tags-34.wecode-db-wal differ diff --git a/.vscode/tags-34.wecode-lock b/.vscode/tags-34.wecode-lock new file mode 100644 index 0000000000000000000000000000000000000000..fd1e976b3908e713eff26061ab401cf0d0f2de82 Binary files /dev/null and b/.vscode/tags-34.wecode-lock differ diff --git a/test/fuzztest/advancednotificationservice/BUILD.gn b/test/fuzztest/advancednotificationservice/BUILD.gn index d2ce258a4a8ebd87462d755b4f0ab3ce015756d9..544826e8755af8d92fd5ab95d099d2bfd0870973 100644 --- a/test/fuzztest/advancednotificationservice/BUILD.gn +++ b/test/fuzztest/advancednotificationservice/BUILD.gn @@ -18,5 +18,96 @@ group("fuzztest") { deps = [ "servicepublish_fuzzer:ServicePublishFuzzTest", + "servicesetdistributedenabledbybundle_fuzzer:ServiceSetDistributedEnabledByBundleFuzzTest", + "servicesetbadgenumberfordhbybundle_fuzzer:ServiceSetBadgeNumberForDhByBundleFuzzTest", + "servicesetslotflagsasbundle_fuzzer:ServiceSetSlotFlagsAsBundleFuzzTest", + "servicepublishnotificationforindirectproxy_fuzzer:ServicePublishNotificationForIndirectProxyFuzzTest", + "servicegetsyncnotificationenabledwithoutapp_fuzzer:ServiceGetSyncNotificationEnabledWithoutAppFuzzTest", + "servicesubscribe_fuzzer:ServiceSubscribeFuzzTest", + "servicegetnotificationrequestbyhashcode_fuzzer:ServiceGetNotificationRequestByHashCodeFuzzTest", + "serviceregisterpushcallback_fuzzer:ServiceRegisterPushCallbackFuzzTest", + "serviceremovenotification_fuzzer:ServiceRemoveNotificationFuzzTest", + "servicegetslotsbybundle_fuzzer:ServiceGetSlotsByBundleFuzzTest", + "servicepublishasbundle_fuzzer:ServicePublishAsBundleFuzzTest", + "servicecancelall_fuzzer:ServiceCancelAllFuzzTest", + "serviceisdistributedenabledbybundle_fuzzer:ServiceIsDistributedEnabledByBundleFuzzTest", + "servicegetshowbadgeenabledforbundle_fuzzer:ServiceGetShowBadgeEnabledForBundleFuzzTest", + "servicedistributeoperation_fuzzer:ServiceDistributeOperationFuzzTest", + "servicedeleteallbyuser_fuzzer:ServiceDeleteAllByUserFuzzTest", + "serviceenabledistributedbybundle_fuzzer:ServiceEnableDistributedByBundleFuzzTest", + "servicesubscribelocalliveview_fuzzer:ServiceSubscribeLocalLiveViewFuzzTest", + "servicesubscribeself_fuzzer:ServiceSubscribeSelfFuzzTest", + "serviceremovegroupbybundle_fuzzer:ServiceRemoveGroupByBundleFuzzTest", + "serviceadddonotdisturbprofiles_fuzzer:ServiceAddDoNotDisturbProfilesFuzzTest", + "serviceisdistributedenablebybundle_fuzzer:ServiceIsDistributedEnableByBundleFuzzTest", + "serviceissmartreminderenabled_fuzzer:ServiceIsSmartReminderEnabledFuzzTest", + "serviceremovenotifications_fuzzer:ServiceRemoveNotificationsFuzzTest", + "servicepublishforindirectproxywithmaxcapacity_fuzzer:ServicePublishForIndirectProxyWithMaxCapacityFuzzTest", + "serviceissupporttemplate_fuzzer:ServiceIsSupportTemplateFuzzTest", + "servicecanpublishasbundle_fuzzer:ServiceCanPublishAsBundleFuzzTest", + "serviceunsubscribe_fuzzer:ServiceUnsubscribeFuzzTest", + "servicecancelgroup_fuzzer:ServiceCancelGroupFuzzTest", + "servicesetsyncnotificationenabledwithoutapp_fuzzer:ServiceSetSyncNotificationEnabledWithoutAppFuzzTest", + "servicepublishcontinuoustasknotification_fuzzer:ServicePublishContinuousTaskNotificationFuzzTest", + "serviceupdateslots_fuzzer:ServiceUpdateSlotsFuzzTest", + "servicegetslots_fuzzer:ServiceGetSlotsFuzzTest", + "servicegetenabledforbundleslotself_fuzzer:ServiceGetEnabledForBundleSlotSelfFuzzTest", + "servicesetnotificationbadgenum_fuzzer:ServiceSetNotificationBadgeNumFuzzTest", + "serviceremoveallnotifications_fuzzer:ServiceRemoveAllNotificationsFuzzTest", + "servicegetenabledforbundleslot_fuzzer:ServiceGetEnabledForBundleSlotFuzzTest", + "servicesetbadgenumberbybundle_fuzzer:ServiceSetBadgeNumberByBundleFuzzTest", + "servicesethashcoderule_fuzzer:ServiceSetHashCodeRuleFuzzTest", + "serviceisneedsilentindonotdisturbmode_fuzzer:ServiceIsNeedSilentInDoNotDisturbModeFuzzTest", + "servicegetalldistribuedenabledbundles_fuzzer:ServiceGetAllDistribuedEnabledBundlesFuzzTest", + "servicesetnotificationsenabledforspecialbundle_fuzzer:ServiceSetNotificationsEnabledForSpecialBundleFuzzTest", + "servicegetslotbybundle_fuzzer:ServiceGetSlotByBundleFuzzTest", + "servicegetdonotdisturbprofile_fuzzer:ServiceGetDoNotDisturbProfileFuzzTest", + "servicecancelasbundlewithagent_fuzzer:ServiceCancelAsBundleWithAgentFuzzTest", + "servicesetsmartreminderenabled_fuzzer:ServiceSetSmartReminderEnabledFuzzTest", + "serviceisspecialuserallowednotify_fuzzer:ServiceIsSpecialUserAllowedNotifyFuzzTest", + "servicesetbadgenumber_fuzzer:ServiceSetBadgeNumberFuzzTest", + "servicesetnotificationsenabledforbundle_fuzzer:ServiceSetNotificationsEnabledForBundleFuzzTest", + "servicesetadditionconfig_fuzzer:ServiceSetAdditionConfigFuzzTest", + "servicesetdonotdisturbdate_fuzzer:ServiceSetDoNotDisturbDateFuzzTest", + "servicegetslotnumasbundle_fuzzer:ServiceGetSlotNumAsBundleFuzzTest", + "serviceaddslots_fuzzer:ServiceAddSlotsFuzzTest", + "servicegetspecialactivenotifications_fuzzer:ServiceGetSpecialActiveNotificationsFuzzTest", + "servicegetallliveviewenabledbundles_fuzzer:ServiceGetAllLiveViewEnabledBundlesFuzzTest", + "servicesetshowbadgeenabledforbundle_fuzzer:ServiceSetShowBadgeEnabledForBundleFuzzTest", + "servicedisablenotificationfeature_fuzzer:ServiceDisableNotificationFeatureFuzzTest", + "servicecancel_fuzzer:ServiceCancelFuzzTest", + "servicereplydistributeoperation_fuzzer:ServiceReplyDistributeOperationFuzzTest", + "servicegetdonotdisturbdate_fuzzer:ServiceGetDoNotDisturbDateFuzzTest", + "servicesettargetdevicestatus_fuzzer:ServiceSetTargetDeviceStatusFuzzTest", + "servicesetenabledforbundleslot_fuzzer:ServiceSetEnabledForBundleSlotFuzzTest", + "serviceremovedonotdisturbprofiles_fuzzer:ServiceRemoveDoNotDisturbProfilesFuzzTest", + "serviceshelldump_fuzzer:ServiceShellDumpFuzzTest", + "servicegetbundleimportance_fuzzer:ServiceGetBundleImportanceFuzzTest", + "servicegetactivenotifications_fuzzer:ServiceGetActiveNotificationsFuzzTest", + "servicesetnotificationsenabledforallbundles_fuzzer:ServiceSetNotificationsEnabledForAllBundlesFuzzTest", + "servicecanpopenablenotificationdialog_fuzzer:ServiceCanPopEnableNotificationDialogFuzzTest", + "servicecancelcontinuoustasknotification_fuzzer:ServiceCancelContinuousTaskNotificationFuzzTest", + "servicepublishwithmaxcapacity_fuzzer:ServicePublishWithMaxCapacityFuzzTest", + "servicegetdeviceremindtype_fuzzer:ServiceGetDeviceRemindTypeFuzzTest", + "servicedelete_fuzzer:ServiceDeleteFuzzTest", + "servicesetdistributedenabledbyslot_fuzzer:ServiceSetDistributedEnabledBySlotFuzzTest", + "servicesetnotificationsenabledbyuser_fuzzer:ServiceSetNotificationsEnabledByUserFuzzTest", + "servicedeletebybundle_fuzzer:ServiceDeleteByBundleFuzzTest", + "servicegetallnotificationsbyslottype_fuzzer:ServiceGetAllNotificationsBySlotTypeFuzzTest", + "servicepublishasbundlewithmaxcapacity_fuzzer:ServicePublishAsBundleWithMaxCapacityFuzzTest", + "servicegettargetdevicestatus_fuzzer:ServiceGetTargetDeviceStatusFuzzTest", + "servicegetactivenotificationbyfilter_fuzzer:ServiceGetActiveNotificationByFilterFuzzTest", + "servicegetslotbytype_fuzzer:ServiceGetSlotByTypeFuzzTest", + "servicerequestenablenotification_fuzzer:ServiceRequestEnableNotificationFuzzTest", + "servicegetslotflagsasbundle_fuzzer:ServiceGetSlotFlagsAsBundleFuzzTest", + "servicetriggerlocalliveview_fuzzer:ServiceTriggerLocalLiveViewFuzzTest", + "serviceallowusereminder_fuzzer:ServiceAllowUseReminderFuzzTest", + "serviceisspecialbundleallowednotify_fuzzer:ServiceIsSpecialBundleAllowedNotifyFuzzTest", + "serviceremoveslotbytype_fuzzer:ServiceRemoveSlotByTypeFuzzTest", + "servicecancelasbundle_fuzzer:ServiceCancelAsBundleFuzzTest", + "serviceaddslotbytype_fuzzer:ServiceAddSlotByTypeFuzzTest", + "serviceupdatenotificationtimerbyuid_fuzzer:ServiceUpdateNotificationTimerByUidFuzzTest", + "serviceisdistributedenabledbyslot_fuzzer:ServiceIsDistributedEnabledBySlotFuzzTest", + "serviceremovedistributednotifications_fuzzer:ServiceRemoveDistributedNotificationsFuzzTest", ] -} +} \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/advancednotificationservice_fuzztest_common.gni b/test/fuzztest/advancednotificationservice/advancednotificationservice_fuzztest_common.gni new file mode 100644 index 0000000000000000000000000000000000000000..b0faf95a7eadd97f01987fac2431cd6b579cf4e3 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/advancednotificationservice_fuzztest_common.gni @@ -0,0 +1,161 @@ +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//base/notification/distributed_notification_service/notification.gni") +import("//build/config/features.gni") +import("//build/test.gni") + +# advancednotificationservice_fuzztest公共配置模板 +template("advancednotificationservice_fuzztest_target") { + assert(defined(invoker.sources_value), "sources_value must be defined") + assert(defined(invoker.fuzz_config_file_value), "fuzz_config_file_value must be defined") + + ohos_fuzztest(target_name) { + module_out_path = service_fuzz_test_path + sources = invoker.sources_value + fuzz_config_file = invoker.fuzz_config_file_value + include_dirs = [ "${services_path}/ans/include" ] + cflags = [ + "-fno-math-errno", + "-fno-unroll-loops", + "-fmerge-all-constants", + "-fno-ident", + "-Oz", + "-flto", + "-ffunction-sections", + "-fdata-sections", + ] + defines = [] + deps = [] + if (defined(invoker.defines_value)) { + defines += invoker.defines_value + } + + if (defined(invoker.deps_value)) { + deps += invoker.deps_value + } + + if (defined(invoker.common_deps_value)) { + deps += invoker.common_deps_value + } + + # 公共外部依赖 + external_deps = [ + "ability_base:configuration", + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "ability_runtime:appkit_native", + "ability_runtime:dataobs_manager", + "ability_runtime:extension_manager", + "ability_runtime:wantagent_innerkits", + "access_token:libaccesstoken_sdk", + "access_token:libtokenid_sdk", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "c_utils:utils", + "common_event_service:cesfwk_innerkits", + "config_policy:configpolicy_util", + "data_share:datashare_common", + "data_share:datashare_consumer", + "data_share:datashare_permission", + "device_manager:devicemanagersdk", + "ffrt:libffrt", + "hilog:libhilog", + "i18n:intl_util", + "image_framework:image_native", + "init:libbegetutil", + "kv_store:distributeddata_inner", + "openssl:libcrypto_shared", + "os_account:os_account_innerkits", + "relational_store:native_rdb", + "resource_management:global_resmgr", + "time_service:time_client", + ] + external_deps += component_external_deps + + # 条件编译标志 + if (is_double_framework) { + cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] + } + + if (distributed_notification_supported) { + defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] + deps += [ "${services_path}/distributed:libans_distributed" ] + include_dirs += [ "${services_path}/distributed/include" ] + } + + if (notification_smart_reminder_supported) { + defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ] + } + + if (device_usage) { + external_deps += [ "device_usage_statistics:usagestatsinner" ] + defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] + } + + if (hisysevent_usage) { + cflags += [ "-DHAS_HISYSEVENT_PART" ] + external_deps += [ "hisysevent:libhisysevent" ] + } + + if (standby_enable) { + external_deps += [ "device_standby:standby_innerkits" ] + defines += [ "DEVICE_STANDBY_ENABLE" ] + } + + if (player_framework) { + external_deps += [ "player_framework:media_client" ] + defines += [ "PLAYER_FRAMEWORK_ENABLE" ] + } + + if (ans_hitrace_usage) { + external_deps += [ "hitrace:hitrace_meter" ] + defines += [ "HITRACE_METER_ENABLE" ] + } + + if (ans_config_policy_enable) { + external_deps += [ "config_policy:configpolicy_util" ] + defines += [ "CONFIG_POLICY_ENABLE" ] + } + + if (screenlock_mgr_enable) { + external_deps += [ "screenlock_mgr:screenlock_client" ] + defines += [ "SCREENLOCK_MGR_ENABLE" ] + } + + if (distributed_notification_service_feature_additional_control || + distributed_notification_service_feature_privileged_message) { + defines += [ "ENABLE_ANS_EXT_WRAPPER" ] + } + + if (distributed_notification_service_feature_additional_control) { + defines += [ "ENABLE_ANS_ADDITIONAL_CONTROL" ] + } + + if (telephony_cust) { + defines += [ "ENABLE_ANS_TELEPHONY_CUST_WRAPPER" ] + } + + if (distributed_notification_service_feature_disable_fa_model) { + defines += [ "ANS_DISABLE_FA_MODEL" ] + } + } +} + +# 公共依赖(所有 fuzzer 共享) +common_deps = [ + "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", + "${component_path}/test/fuzztest/fuzz_common_base:fuzz_mock_object", + "${frameworks_module_ans_path}:ans_innerkits", + "${services_path}/ans:ans_service_sources" +] diff --git a/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..4dc4628e6b4ee4d60f9195b34e5bccac0516094a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceAddDoNotDisturbProfilesFuzzTest") { + sources_value = [ "service_adddonotdisturbprofiles_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceAddDoNotDisturbProfilesFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/service_adddonotdisturbprofiles_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/service_adddonotdisturbprofiles_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4e21d92e4a57cded9c0c03734df87dfda15289e4 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/service_adddonotdisturbprofiles_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_adddonotdisturbprofiles_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/service_adddonotdisturbprofiles_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/service_adddonotdisturbprofiles_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..7ab675b5b7bc00037a680df76750fffb2c24edad --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/service_adddonotdisturbprofiles_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDDONOTDISTURBPROFILES_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDDONOTDISTURBPROFILES_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceadddonotdisturbprofiles_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDDONOTDISTURBPROFILES_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..434900cb120937dccbbef9eb87d5d79afdb6fec8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceAddSlotByTypeFuzzTest") { + sources_value = [ "service_addslotbytype_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceAddSlotByTypeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/service_addslotbytype_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/service_addslotbytype_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e9f337907c87bf84f58e8fc8e52d146916937422 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/service_addslotbytype_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_addslotbytype_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/service_addslotbytype_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/service_addslotbytype_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..821c09e94ad8074e14d12a3b01a55a43c3abd407 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/service_addslotbytype_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDSLOTBYTYPE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDSLOTBYTYPE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceaddslotbytype_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDSLOTBYTYPE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..0d3f5912bd7a8b54643c3b10aa7885732161cb11 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceAddSlotsFuzzTest") { + sources_value = [ "service_addslots_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceAddSlotsFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/service_addslots_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/service_addslots_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c6e81bdc7949f214f9d28dabd4ee0cabb917769e --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/service_addslots_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_addslots_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/service_addslots_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/service_addslots_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..61bf0bfad8dde5aee9193027fc1cc5f90bdd77ca --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/service_addslots_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDSLOTS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDSLOTS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceaddslots_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ADDSLOTS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..042e3ef7b47608ddde170ac551c1789e7323d6bb --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceAllowUseReminderFuzzTest") { + sources_value = [ "service_allowusereminder_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceAllowUseReminderFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/service_allowusereminder_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/service_allowusereminder_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5a8bc01e7fef09b06d56b6690692f0f115386513 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/service_allowusereminder_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_allowusereminder_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/service_allowusereminder_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/service_allowusereminder_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..067be7b7589556498f775ecd831b049a3be06acc --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/service_allowusereminder_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ALLOWUSEREMINDER_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ALLOWUSEREMINDER_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceallowusereminder_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ALLOWUSEREMINDER_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..9a4da9de60939b9fccae155e681346644bde1eff --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceCancelFuzzTest") { + sources_value = [ "service_cancel_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicecancel_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceCancelFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/service_cancel_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/service_cancel_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3dace1401ca5763efd1e26264fc382573ba79676 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/service_cancel_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_cancel_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/service_cancel_fuzzer.h b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/service_cancel_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..2b4361c1e20484eb7d18f4d494e0d3291de6e66a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancel_fuzzer/service_cancel_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCEL_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCEL_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicecancel_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCEL_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..ef5e11dc2c909cb93ff67bd925a07f86b1f10841 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceCancelAllFuzzTest") { + sources_value = [ "service_cancelall_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceCancelAllFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/service_cancelall_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/service_cancelall_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e3198ba83178431c37753688af73fae127768132 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/service_cancelall_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_cancelall_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/service_cancelall_fuzzer.h b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/service_cancelall_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..d2f471d7b303324163fa8236d182f61b201b6c76 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/service_cancelall_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELALL_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELALL_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicecancelall_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELALL_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..bd95f631a8731e3135533db0302a5b0a0d3a9d17 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceCancelAsBundleFuzzTest") { + sources_value = [ "service_cancelasbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceCancelAsBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/service_cancelasbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/service_cancelasbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ddae103e7da684b956658b77087e41550128b08e --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/service_cancelasbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_cancelasbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/service_cancelasbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/service_cancelasbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..16db997cf48b2747171f5d1a28e675cf22547c06 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/service_cancelasbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELASBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELASBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicecancelasbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELASBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..71c5232d90190d674e5030f447c2de39792aa481 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceCancelAsBundleWithAgentFuzzTest") { + sources_value = [ "service_cancelasbundlewithagent_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceCancelAsBundleWithAgentFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/service_cancelasbundlewithagent_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/service_cancelasbundlewithagent_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6e1dab8d7686cba5050b72baf4e38317e352b482 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/service_cancelasbundlewithagent_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_cancelasbundlewithagent_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/service_cancelasbundlewithagent_fuzzer.h b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/service_cancelasbundlewithagent_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..557b7a385fd679963cfa575b82ab1b9b61e807eb --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/service_cancelasbundlewithagent_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELASBUNDLEWITHAGENT_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELASBUNDLEWITHAGENT_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicecancelasbundlewithagent_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELASBUNDLEWITHAGENT_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e0e73ae8c47093587b7b4364487953b27a481932 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceCancelContinuousTaskNotificationFuzzTest") { + sources_value = [ "service_cancelcontinuoustasknotification_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceCancelContinuousTaskNotificationFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/service_cancelcontinuoustasknotification_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/service_cancelcontinuoustasknotification_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f831c24003ada502461dab24ddf78c490f02ec86 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/service_cancelcontinuoustasknotification_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_cancelcontinuoustasknotification_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/service_cancelcontinuoustasknotification_fuzzer.h b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/service_cancelcontinuoustasknotification_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..a9d18f38d7a20a205b23919025f1c7d447ff6bfe --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/service_cancelcontinuoustasknotification_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELCONTINUOUSTASKNOTIFICATION_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELCONTINUOUSTASKNOTIFICATION_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicecancelcontinuoustasknotification_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELCONTINUOUSTASKNOTIFICATION_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..25a9a6467f1415f9a78f46eb15a268a66dcdc2d2 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceCancelGroupFuzzTest") { + sources_value = [ "service_cancelgroup_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceCancelGroupFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9e0e8533274790f4b4981f004d6b3b0789f093a7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_cancelgroup_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.h b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..03acaa5c938c3d050556facda15b020ea3cdd5b9 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELGROUP_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELGROUP_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicecancelgroup_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANCELGROUP_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..d36613cabea29d1ce7ee59bc04d2787b5dc1bc67 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceCanPopEnableNotificationDialogFuzzTest") { + sources_value = [ "service_canpopenablenotificationdialog_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceCanPopEnableNotificationDialogFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/service_canpopenablenotificationdialog_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/service_canpopenablenotificationdialog_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee5e5168e8a53e7b7a6aec9503bce3b874995a95 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/service_canpopenablenotificationdialog_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_canpopenablenotificationdialog_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/service_canpopenablenotificationdialog_fuzzer.h b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/service_canpopenablenotificationdialog_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..23bc1a6dfe49e24adca7bb7d27de4b43100d89e4 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/service_canpopenablenotificationdialog_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANPOPENABLENOTIFICATIONDIALOG_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANPOPENABLENOTIFICATIONDIALOG_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicecanpopenablenotificationdialog_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANPOPENABLENOTIFICATIONDIALOG_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..9809a8094df305f77d1c7c33d3af57d4e5285da2 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceCanPublishAsBundleFuzzTest") { + sources_value = [ "service_canpublishasbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceCanPublishAsBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a14eb0e92e8101482b243d2a7adabc7f60c32d62 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_canpublishasbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..ba14dd71f2455a58780be99eb7df0f192b3d6a30 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANPUBLISHASBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANPUBLISHASBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicecanpublishasbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_CANPUBLISHASBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..3c1b479b06edfdedd010acb436d9049786e4381b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceDeleteFuzzTest") { + sources_value = [ "service_delete_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicedelete_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceDeleteFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/service_delete_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/service_delete_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f20581c84556e20722f789b15cd76a8a43bc39ee --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/service_delete_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_delete_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/service_delete_fuzzer.h b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/service_delete_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..b9db3e14514962600815539b37a30e5bae740dfb --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedelete_fuzzer/service_delete_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicedelete_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..9537b63ca6af0c0643981bb60ad997aa47474e1f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceDeleteAllByUserFuzzTest") { + sources_value = [ "service_deleteallbyuser_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceDeleteAllByUserFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/service_deleteallbyuser_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/service_deleteallbyuser_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..79b8e652af4fdf862cf4b973d96c6cf642fe6378 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/service_deleteallbyuser_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_deleteallbyuser_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/service_deleteallbyuser_fuzzer.h b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/service_deleteallbyuser_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..a5dc6584cc89d4e8560994a1e36938fbbd128198 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/service_deleteallbyuser_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETEALLBYUSER_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETEALLBYUSER_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicedeleteallbyuser_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETEALLBYUSER_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..1794f55ad47592c6e04d475532d8b30429b903d8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceDeleteByBundleFuzzTest") { + sources_value = [ "service_deletebybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceDeleteByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/service_deletebybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/service_deletebybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3c1e1beba36f69d16850c12e6d46c6ed4792a2f8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/service_deletebybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_deletebybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/service_deletebybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/service_deletebybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..3ca9a04191cb1aee77241348c022c9f528b1a6f6 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/service_deletebybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETEBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETEBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicedeletebybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DELETEBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..dbbf05fdf400be6ecd65216cb4b7216d7219934a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceDisableNotificationFeatureFuzzTest") { + sources_value = [ "service_disablenotificationfeature_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceDisableNotificationFeatureFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/service_disablenotificationfeature_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/service_disablenotificationfeature_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b3c136406cc135c53a97465c933ea9623917d845 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/service_disablenotificationfeature_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_disablenotificationfeature_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/service_disablenotificationfeature_fuzzer.h b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/service_disablenotificationfeature_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..b71bcd1866fc85120d24edc268acb8a1c298cd52 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/service_disablenotificationfeature_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DISABLENOTIFICATIONFEATURE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DISABLENOTIFICATIONFEATURE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicedisablenotificationfeature_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DISABLENOTIFICATIONFEATURE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f9c923edf712c424aab897416c1c45154a4e5bfd --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceDistributeOperationFuzzTest") { + sources_value = [ "service_distributeoperation_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceDistributeOperationFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/service_distributeoperation_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/service_distributeoperation_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7e110d46bf23756b8c0d5a51d17f07ae6e3b7f3b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/service_distributeoperation_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_distributeoperation_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/service_distributeoperation_fuzzer.h b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/service_distributeoperation_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..e908c0eee5fcc43080c1154dc404fd3d6ed4951a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/service_distributeoperation_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DISTRIBUTEOPERATION_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DISTRIBUTEOPERATION_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicedistributeoperation_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_DISTRIBUTEOPERATION_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..037385a0bf8175fe4ce5dd3787f3b1f915a881ac --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceEnableDistributedByBundleFuzzTest") { + sources_value = [ "service_enabledistributedbybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceEnableDistributedByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/service_enabledistributedbybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/service_enabledistributedbybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9e8ee7340e5b8a497fe31d2f8b69f42da5681fe8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/service_enabledistributedbybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_enabledistributedbybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/service_enabledistributedbybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/service_enabledistributedbybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..92ae7416ad5f5cfb30822bac92869d5c699cc10a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/service_enabledistributedbybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ENABLEDISTRIBUTEDBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ENABLEDISTRIBUTEDBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceenabledistributedbybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ENABLEDISTRIBUTEDBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..3bee6856fd68e9a4fa7858376fcac7f25eabf2f8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetActiveNotificationByFilterFuzzTest") { + sources_value = [ "service_getactivenotificationbyfilter_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetActiveNotificationByFilterFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/service_getactivenotificationbyfilter_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/service_getactivenotificationbyfilter_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ddf5e7a2efe39c1d9f67777cdacf98eb553e8b6 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/service_getactivenotificationbyfilter_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getactivenotificationbyfilter_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/service_getactivenotificationbyfilter_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/service_getactivenotificationbyfilter_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..290025e59cda274b98847ef24de39bc6f43e8ba1 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/service_getactivenotificationbyfilter_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETACTIVENOTIFICATIONBYFILTER_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETACTIVENOTIFICATIONBYFILTER_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetactivenotificationbyfilter_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETACTIVENOTIFICATIONBYFILTER_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5993ad766b423afc1a1845afb58e899ee130209d --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetActiveNotificationsFuzzTest") { + sources_value = [ "service_getactivenotifications_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetActiveNotificationsFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/service_getactivenotifications_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/service_getactivenotifications_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ce78257625c57a7d7dbd440415c332314377cf7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/service_getactivenotifications_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getactivenotifications_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/service_getactivenotifications_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/service_getactivenotifications_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..55670f2b0861a3a3ced771de346f45f90a66cd0a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/service_getactivenotifications_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETACTIVENOTIFICATIONS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETACTIVENOTIFICATIONS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetactivenotifications_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETACTIVENOTIFICATIONS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a3afe329f68316dd50dab710e5e9f3aee2c3ec5a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetAllDistribuedEnabledBundlesFuzzTest") { + sources_value = [ "service_getalldistribuedenabledbundles_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetAllDistribuedEnabledBundlesFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/service_getalldistribuedenabledbundles_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/service_getalldistribuedenabledbundles_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..effe2d0445fd862468edb2990a74d59cc8c46459 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/service_getalldistribuedenabledbundles_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getalldistribuedenabledbundles_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/service_getalldistribuedenabledbundles_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/service_getalldistribuedenabledbundles_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..4f3a9665cc37d6b516ec3063be7f5e6d4717edc8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/service_getalldistribuedenabledbundles_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLDISTRIBUEDENABLEDBUNDLES_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLDISTRIBUEDENABLEDBUNDLES_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetalldistribuedenabledbundles_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLDISTRIBUEDENABLEDBUNDLES_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e9911463dd16dc441a8630d650f955b9f2ed0861 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetAllLiveViewEnabledBundlesFuzzTest") { + sources_value = [ "service_getallliveviewenabledbundles_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetAllLiveViewEnabledBundlesFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/service_getallliveviewenabledbundles_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/service_getallliveviewenabledbundles_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d3fd0620db86e0ad04a02cf56325e094f44bb248 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/service_getallliveviewenabledbundles_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getallliveviewenabledbundles_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/service_getallliveviewenabledbundles_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/service_getallliveviewenabledbundles_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..6e6d0fefe82911c488565423c3482842b9476d46 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/service_getallliveviewenabledbundles_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLLIVEVIEWENABLEDBUNDLES_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLLIVEVIEWENABLEDBUNDLES_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetallliveviewenabledbundles_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLLIVEVIEWENABLEDBUNDLES_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..01eeb72c1f54407698bcbea2ef066887c7c5953c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetAllNotificationsBySlotTypeFuzzTest") { + sources_value = [ "service_getallnotificationsbyslottype_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetAllNotificationsBySlotTypeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/service_getallnotificationsbyslottype_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/service_getallnotificationsbyslottype_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..10f2c6df0373150628ac165a9e458be694ac4d02 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/service_getallnotificationsbyslottype_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getallnotificationsbyslottype_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/service_getallnotificationsbyslottype_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/service_getallnotificationsbyslottype_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..0a01b91fcc519929a7cc0c4c7d054a8612e279e3 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/service_getallnotificationsbyslottype_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLNOTIFICATIONSBYSLOTTYPE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLNOTIFICATIONSBYSLOTTYPE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetallnotificationsbyslottype_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETALLNOTIFICATIONSBYSLOTTYPE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..71752c6c8f11e301447becb378e90291bd4f12df --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetBundleImportanceFuzzTest") { + sources_value = [ "service_getbundleimportance_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetBundleImportanceFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/service_getbundleimportance_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/service_getbundleimportance_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3718993e6927cced1a647e51d55b26b644c64857 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/service_getbundleimportance_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getbundleimportance_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/service_getbundleimportance_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/service_getbundleimportance_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..a10702949e53332ffd0d0e2d1e302a80886d3cd1 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/service_getbundleimportance_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETBUNDLEIMPORTANCE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETBUNDLEIMPORTANCE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetbundleimportance_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETBUNDLEIMPORTANCE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a8f2a73385ff87daa61020c4e9c31b3b90560136 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetDeviceRemindTypeFuzzTest") { + sources_value = [ "service_getdeviceremindtype_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetDeviceRemindTypeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/service_getdeviceremindtype_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/service_getdeviceremindtype_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ba549f41d35d1dac6af32a87af0fe1c16097df2 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/service_getdeviceremindtype_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getdeviceremindtype_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/service_getdeviceremindtype_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/service_getdeviceremindtype_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..7785bafa82fb9c28676f8e096fda4b363322efa4 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/service_getdeviceremindtype_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDEVICEREMINDTYPE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDEVICEREMINDTYPE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetdeviceremindtype_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDEVICEREMINDTYPE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..97b8f7aea3fb5cfa8f834cdc29c404c7cbf78b04 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetDoNotDisturbDateFuzzTest") { + sources_value = [ "service_getdonotdisturbdate_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetDoNotDisturbDateFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/service_getdonotdisturbdate_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/service_getdonotdisturbdate_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..275c98fc8c62770c28f48efa423767a7d213dc3e --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/service_getdonotdisturbdate_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getdonotdisturbdate_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/service_getdonotdisturbdate_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/service_getdonotdisturbdate_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..35c335ea0ee3e8f69d4a7d0ad668becbdd3e699f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/service_getdonotdisturbdate_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDONOTDISTURBDATE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDONOTDISTURBDATE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetdonotdisturbdate_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDONOTDISTURBDATE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..181ddf6844acc674f61e32a89e97e6eca751ec4d --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetDoNotDisturbProfileFuzzTest") { + sources_value = [ "service_getdonotdisturbprofile_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetDoNotDisturbProfileFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/service_getdonotdisturbprofile_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/service_getdonotdisturbprofile_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..589fe2098adf1a52c1a2a669a16e927e8585fd50 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/service_getdonotdisturbprofile_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getdonotdisturbprofile_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/service_getdonotdisturbprofile_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/service_getdonotdisturbprofile_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..01b436317e3bd87b401ae1a9d028565e88ac246c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/service_getdonotdisturbprofile_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDONOTDISTURBPROFILE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDONOTDISTURBPROFILE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetdonotdisturbprofile_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETDONOTDISTURBPROFILE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c8aa77cb219db647593c90e7f430c4b143b97421 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetEnabledForBundleSlotFuzzTest") { + sources_value = [ "service_getenabledforbundleslot_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetEnabledForBundleSlotFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9c1a454e466c666197ac6f51aba366b8feedd5c2 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getenabledforbundleslot_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..f5efd9e60d244a1193eef8b0544fd6923520f90f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETENABLEDFORBUNDLESLOT_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETENABLEDFORBUNDLESLOT_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetenabledforbundleslot_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETENABLEDFORBUNDLESLOT_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a6734fb673e75abaf1d7bfe6659b73e5d928aa02 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetEnabledForBundleSlotSelfFuzzTest") { + sources_value = [ "service_getenabledforbundleslotself_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetEnabledForBundleSlotSelfFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e531760e03961247af626fba0533b72b0ed9f6c5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getenabledforbundleslotself_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..8227b08da4dc4082552991e92f488cbd948e11c8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETENABLEDFORBUNDLESLOTSELF_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETENABLEDFORBUNDLESLOTSELF_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetenabledforbundleslotself_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETENABLEDFORBUNDLESLOTSELF_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..9d6d8bf0cd4af775deb72fe7d2be972e5ba56027 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetNotificationRequestByHashCodeFuzzTest") { + sources_value = [ "service_getnotificationrequestbyhashcode_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetNotificationRequestByHashCodeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/service_getnotificationrequestbyhashcode_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/service_getnotificationrequestbyhashcode_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eb3146dfcabf83bbc0113d45e60d76c9319749b2 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/service_getnotificationrequestbyhashcode_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getnotificationrequestbyhashcode_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/service_getnotificationrequestbyhashcode_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/service_getnotificationrequestbyhashcode_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..3fe498ebe518a3238ddbb0404248942afd7bde4c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/service_getnotificationrequestbyhashcode_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETNOTIFICATIONREQUESTBYHASHCODE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETNOTIFICATIONREQUESTBYHASHCODE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetnotificationrequestbyhashcode_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETNOTIFICATIONREQUESTBYHASHCODE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..374c9674caf9df7ceec92c65b3759b30c84e3c94 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetShowBadgeEnabledForBundleFuzzTest") { + sources_value = [ "service_getshowbadgeenabledforbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetShowBadgeEnabledForBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/service_getshowbadgeenabledforbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/service_getshowbadgeenabledforbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..27f21b34b1e121ff6c4e551370983b1433db1313 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/service_getshowbadgeenabledforbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getshowbadgeenabledforbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/service_getshowbadgeenabledforbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/service_getshowbadgeenabledforbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..fc82cd545b7582bf6c24608d943f0781cc73ddeb --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/service_getshowbadgeenabledforbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSHOWBADGEENABLEDFORBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSHOWBADGEENABLEDFORBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetshowbadgeenabledforbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSHOWBADGEENABLEDFORBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..cbec4ab4d16acf9bbd8654d07beb83199706684d --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetSlotByBundleFuzzTest") { + sources_value = [ "service_getslotbybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetSlotByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/service_getslotbybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/service_getslotbybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..91f472ca6e2faf5aeeefbd112a29435074dbba93 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/service_getslotbybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getslotbybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/service_getslotbybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/service_getslotbybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..9e047f50c12423623ec35f7d3ed3df5c01dc2bd3 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/service_getslotbybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetslotbybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c81944996e814d35551c595b65f78a11a8b895f1 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetSlotByTypeFuzzTest") { + sources_value = [ "service_getslotbytype_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetSlotByTypeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/service_getslotbytype_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/service_getslotbytype_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..78e94faeb9fa856de5b155de38287a1b34f62e71 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/service_getslotbytype_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getslotbytype_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/service_getslotbytype_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/service_getslotbytype_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..2d983a905aa6470183bea41ca0d659d1c4ecfcae --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/service_getslotbytype_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTBYTYPE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTBYTYPE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetslotbytype_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTBYTYPE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..d07bce0ff3df9e52241398c67517ac0a083ae457 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetSlotFlagsAsBundleFuzzTest") { + sources_value = [ "service_getslotflagsasbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetSlotFlagsAsBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/service_getslotflagsasbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/service_getslotflagsasbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f7678c9b476ac4bf8d3e9bfefba0bcaf2fd0142e --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/service_getslotflagsasbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getslotflagsasbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/service_getslotflagsasbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/service_getslotflagsasbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..9e8c906c06988072dee66a5d9d5b145de687b63a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/service_getslotflagsasbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTFLAGSASBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTFLAGSASBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetslotflagsasbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTFLAGSASBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..4b0c36317cecbf5ccd451b385a672f8dcd1d19be --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetSlotNumAsBundleFuzzTest") { + sources_value = [ "service_getslotnumasbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetSlotNumAsBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/service_getslotnumasbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/service_getslotnumasbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..413992351f0e5e93c1dbbe2876bfb6e0e2377ac0 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/service_getslotnumasbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getslotnumasbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/service_getslotnumasbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/service_getslotnumasbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..9cfba785fdf3a424d82c99f52b6485c83c67def5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/service_getslotnumasbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTNUMASBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTNUMASBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetslotnumasbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTNUMASBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..27fd2cb236e5923f3fe9629b4523a4804e65a0db --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetSlotsFuzzTest") { + sources_value = [ "service_getslots_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetSlotsFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..27524e6799f35f1fc58fe83b4f7bee8e8c8ee3df --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getslots_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..ef2854289834cd79f73c263b126f284016c093e1 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetslots_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..58731cc0a60799962c7e1e46eaa6bc35bd761642 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetSlotsByBundleFuzzTest") { + sources_value = [ "service_getslotsbybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetSlotsByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/service_getslotsbybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/service_getslotsbybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..136a30d5fd41ce05d059f6e3a17d9b31210943d0 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/service_getslotsbybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getslotsbybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/service_getslotsbybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/service_getslotsbybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..d919a935638537ba644a54e73928dd9ca907008c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/service_getslotsbybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTSBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTSBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetslotsbybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSLOTSBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..ad24ee045d072a4df45c50d04e2c2a1250d43f98 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetSpecialActiveNotificationsFuzzTest") { + sources_value = [ "service_getspecialactivenotifications_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetSpecialActiveNotificationsFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/service_getspecialactivenotifications_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/service_getspecialactivenotifications_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ff9661159d7e40677cf346da2761a11f973848e9 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/service_getspecialactivenotifications_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getspecialactivenotifications_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/service_getspecialactivenotifications_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/service_getspecialactivenotifications_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..b8b6dead5970833d2f936cf2aaa045afcad3c225 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/service_getspecialactivenotifications_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSPECIALACTIVENOTIFICATIONS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSPECIALACTIVENOTIFICATIONS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetspecialactivenotifications_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSPECIALACTIVENOTIFICATIONS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5ebbf78dd6195e8fec50a5274849e7b4221bbc28 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetSyncNotificationEnabledWithoutAppFuzzTest") { + sources_value = [ "service_getsyncnotificationenabledwithoutapp_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetSyncNotificationEnabledWithoutAppFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/service_getsyncnotificationenabledwithoutapp_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/service_getsyncnotificationenabledwithoutapp_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..216c80c33b3031cc49ac88e75555b30c8b6c28e5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/service_getsyncnotificationenabledwithoutapp_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_getsyncnotificationenabledwithoutapp_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/service_getsyncnotificationenabledwithoutapp_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/service_getsyncnotificationenabledwithoutapp_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..86b0860f8177d572f8d696f4a134d8ec77d4e083 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/service_getsyncnotificationenabledwithoutapp_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSYNCNOTIFICATIONENABLEDWITHOUTAPP_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSYNCNOTIFICATIONENABLEDWITHOUTAPP_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegetsyncnotificationenabledwithoutapp_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETSYNCNOTIFICATIONENABLEDWITHOUTAPP_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..8d6c4b7b798c3d8d7157b23fb81f8044f730a1a7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceGetTargetDeviceStatusFuzzTest") { + sources_value = [ "service_gettargetdevicestatus_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceGetTargetDeviceStatusFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/service_gettargetdevicestatus_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/service_gettargetdevicestatus_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d0c2626b1a963952eea9593676b9165f80f1c6f4 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/service_gettargetdevicestatus_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_gettargetdevicestatus_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/service_gettargetdevicestatus_fuzzer.h b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/service_gettargetdevicestatus_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..b6d4d4a6263130d58ed12723108863f17c90f8de --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/service_gettargetdevicestatus_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETTARGETDEVICESTATUS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETTARGETDEVICESTATUS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicegettargetdevicestatus_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_GETTARGETDEVICESTATUS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5549e29504c79f187687415c16b5bc3104a136e6 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceIsDistributedEnableByBundleFuzzTest") { + sources_value = [ "service_isdistributedenablebybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceIsDistributedEnableByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/service_isdistributedenablebybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/service_isdistributedenablebybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bf25add0163d005dc0b882ec99abba4923384c51 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/service_isdistributedenablebybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_isdistributedenablebybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/service_isdistributedenablebybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/service_isdistributedenablebybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..439fefdd47345575ec7effa903a47f25ae146989 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/service_isdistributedenablebybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceisdistributedenablebybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..0480f7d26bff9608d399a0fe033411e72b551de8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceIsDistributedEnabledByBundleFuzzTest") { + sources_value = [ "service_isdistributedenabledbybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceIsDistributedEnabledByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/service_isdistributedenabledbybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/service_isdistributedenabledbybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..88b9f0068baf692a5b828c513221b9f6aa69b88d --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/service_isdistributedenabledbybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_isdistributedenabledbybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/service_isdistributedenabledbybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/service_isdistributedenabledbybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..c7019f8851c574e4626cb9483393455146481d4f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/service_isdistributedenabledbybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEDBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEDBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceisdistributedenabledbybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEDBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f097369d6ae4aea2903233ecccd27fd23eb98115 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceIsDistributedEnabledBySlotFuzzTest") { + sources_value = [ "service_isdistributedenabledbyslot_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceIsDistributedEnabledBySlotFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/service_isdistributedenabledbyslot_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/service_isdistributedenabledbyslot_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7bd99e8166bdd9bbf35bca9adf2ff52a0e066eb2 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/service_isdistributedenabledbyslot_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_isdistributedenabledbyslot_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/service_isdistributedenabledbyslot_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/service_isdistributedenabledbyslot_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..c1a5c4f7ec416498835a61f40811508ea9856fd7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/service_isdistributedenabledbyslot_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEDBYSLOT_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEDBYSLOT_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceisdistributedenabledbyslot_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISDISTRIBUTEDENABLEDBYSLOT_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..bda7c5b6666c9633d481e06ef3763ba9a551b56a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceIsNeedSilentInDoNotDisturbModeFuzzTest") { + sources_value = [ "service_isneedsilentindonotdisturbmode_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceIsNeedSilentInDoNotDisturbModeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/service_isneedsilentindonotdisturbmode_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/service_isneedsilentindonotdisturbmode_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7dc3a1027674429f2e36c6c935be958e8abcf75b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/service_isneedsilentindonotdisturbmode_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_isneedsilentindonotdisturbmode_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/service_isneedsilentindonotdisturbmode_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/service_isneedsilentindonotdisturbmode_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..0854e96bca9f778203ed27f6f1504d7bd1307469 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/service_isneedsilentindonotdisturbmode_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISNEEDSILENTINDONOTDISTURBMODE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISNEEDSILENTINDONOTDISTURBMODE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceisneedsilentindonotdisturbmode_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISNEEDSILENTINDONOTDISTURBMODE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..7c1c27390c068b921b4135a2c7f9f56236db9d50 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceIsSmartReminderEnabledFuzzTest") { + sources_value = [ "service_issmartreminderenabled_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceIsSmartReminderEnabledFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/service_issmartreminderenabled_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/service_issmartreminderenabled_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8125f9c2625abb78abb1bd37a4c9070787a60934 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/service_issmartreminderenabled_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_issmartreminderenabled_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/service_issmartreminderenabled_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/service_issmartreminderenabled_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..dbd27885a865227f718bb38c6480340294d4a2ba --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/service_issmartreminderenabled_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSMARTREMINDERENABLED_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSMARTREMINDERENABLED_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceissmartreminderenabled_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSMARTREMINDERENABLED_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..8291e70b69d2721625fc38d4930be514aa555a5f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceIsSpecialBundleAllowedNotifyFuzzTest") { + sources_value = [ "service_isspecialbundleallowednotify_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceIsSpecialBundleAllowedNotifyFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/service_isspecialbundleallowednotify_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/service_isspecialbundleallowednotify_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..190c6953ad051ee6cb305990235f48d2420a6efa --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/service_isspecialbundleallowednotify_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_isspecialbundleallowednotify_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/service_isspecialbundleallowednotify_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/service_isspecialbundleallowednotify_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..ec805bb4b2c8352b8d8e9be833c06efaf63ff8e1 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/service_isspecialbundleallowednotify_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSPECIALBUNDLEALLOWEDNOTIFY_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSPECIALBUNDLEALLOWEDNOTIFY_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceisspecialbundleallowednotify_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSPECIALBUNDLEALLOWEDNOTIFY_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..bc8e0f2ac60214a473ca35d485b8a1b3838f15d0 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceIsSpecialUserAllowedNotifyFuzzTest") { + sources_value = [ "service_isspecialuserallowednotify_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceIsSpecialUserAllowedNotifyFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/service_isspecialuserallowednotify_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/service_isspecialuserallowednotify_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ac4bd43453cf9300c0c3753c61adecb1d801814e --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/service_isspecialuserallowednotify_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_isspecialuserallowednotify_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/service_isspecialuserallowednotify_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/service_isspecialuserallowednotify_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..bd0aacc60a2a195db7053b361bd1e4f13a1358b5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/service_isspecialuserallowednotify_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSPECIALUSERALLOWEDNOTIFY_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSPECIALUSERALLOWEDNOTIFY_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceisspecialuserallowednotify_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSPECIALUSERALLOWEDNOTIFY_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e199d5d4abe87e15c5d97f919e781839689c8465 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceIsSupportTemplateFuzzTest") { + sources_value = [ "service_issupporttemplate_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceIsSupportTemplateFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4624afca3e3702c7114aac4ad6a24032ccd9689b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_issupporttemplate_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..a462c1e1c4f5a545d76ec10f035a219428e0188f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSUPPORTTEMPLATE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSUPPORTTEMPLATE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceissupporttemplate_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_ISSUPPORTTEMPLATE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublish_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicepublish_fuzzer/BUILD.gn index 8cd69c98c57aca8c6bc1cdc1740c64f3cd2ac487..854abe6df1a37318138b4647331db564ba067800 100644 --- a/test/fuzztest/advancednotificationservice/servicepublish_fuzzer/BUILD.gn +++ b/test/fuzztest/advancednotificationservice/servicepublish_fuzzer/BUILD.gn @@ -11,137 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. + #####################hydra-fuzz################### -import("//base/notification/distributed_notification_service/notification.gni") -import("//build/config/features.gni") -import("//build/test.gni") +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 ##############################fuzztest########################################## -ohos_fuzztest("ServicePublishFuzzTest") { - module_out_path = service_fuzz_test_path - fuzz_config_file = +advancednotificationservice_fuzztest_target("ServicePublishFuzzTest") { + sources_value = [ "service_publish_fuzzer.cpp" ] + fuzz_config_file_value = "${component_path}/test/fuzztest/advancednotificationservice/servicepublish_fuzzer" - include_dirs = [ "${services_path}/ans/include" ] - cflags = [ - "-fno-math-errno", - "-fno-unroll-loops", - "-fmerge-all-constants", - "-fno-ident", - "-Oz", - "-flto", - "-ffunction-sections", - "-fdata-sections", - ] - sources = [ "service_publish_fuzzer.cpp" ] - defines = [] - deps = [ - "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", - "${component_path}/test/fuzztest/fuzz_common_base:fuzz_mock_object", - "${frameworks_module_ans_path}:ans_innerkits", - "${services_path}/ans:ans_service_sources" - ] - if (is_double_framework) { - cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] - } - - if (distributed_notification_supported) { - defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] - deps += [ "${services_path}/distributed:libans_distributed" ] - include_dirs += [ "${services_path}/distributed/include" ] - } - - if (notification_smart_reminder_supported) { - defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ] - } - - external_deps = [ - "ability_base:configuration", - "ability_runtime:ability_manager", - "ability_runtime:app_manager", - "ability_runtime:appkit_native", - "ability_runtime:dataobs_manager", - "ability_runtime:extension_manager", - "ability_runtime:wantagent_innerkits", - "access_token:libaccesstoken_sdk", - "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "config_policy:configpolicy_util", - "data_share:datashare_common", - "data_share:datashare_consumer", - "data_share:datashare_permission", - "device_manager:devicemanagersdk", - "ffrt:libffrt", - "hilog:libhilog", - "i18n:intl_util", - "image_framework:image_native", - "init:libbegetutil", - "kv_store:distributeddata_inner", - "openssl:libcrypto_shared", - "os_account:os_account_innerkits", - "relational_store:native_rdb", - "resource_management:global_resmgr", - "time_service:time_client", - ] - external_deps += component_external_deps - - if (device_usage) { - external_deps += [ "device_usage_statistics:usagestatsinner" ] - defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] - } - - if (hisysevent_usage) { - cflags += [ "-DHAS_HISYSEVENT_PART" ] - external_deps += [ "hisysevent:libhisysevent" ] - } - - if (standby_enable) { - external_deps += [ "device_standby:standby_innerkits" ] - defines += [ "DEVICE_STANDBY_ENABLE" ] - } - - if (player_framework) { - external_deps += [ "player_framework:media_client" ] - defines += [ "PLAYER_FRAMEWORK_ENABLE" ] - } - - if (ans_hitrace_usage) { - external_deps += [ "hitrace:hitrace_meter" ] - defines += [ "HITRACE_METER_ENABLE" ] - } - - if (ans_config_policy_enable) { - external_deps += [ "config_policy:configpolicy_util" ] - defines += [ "CONFIG_POLICY_ENABLE" ] - } - - if (screenlock_mgr_enable) { - external_deps += [ "screenlock_mgr:screenlock_client" ] - defines += [ "SCREENLOCK_MGR_ENABLE" ] - } - - if (distributed_notification_service_feature_additional_control || - distributed_notification_service_feature_privileged_message) { - defines += [ "ENABLE_ANS_EXT_WRAPPER" ] - } - - if (distributed_notification_service_feature_additional_control) { - defines += [ "ENABLE_ANS_ADDITIONAL_CONTROL" ] - } - - if (distributed_notification_service_feature_summary) { - defines += [ "ENABLE_ANS_AGGREGATION" ] - } - - if (telephony_cust) { - defines += [ "ENABLE_ANS_TELEPHONY_CUST_WRAPPER" ] - } - - if (distributed_notification_service_feature_disable_fa_model) { - defines += [ "ANS_DISABLE_FA_MODEL" ] - } + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 } ############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicepublish_fuzzer/service_publish_fuzzer.h b/test/fuzztest/advancednotificationservice/servicepublish_fuzzer/service_publish_fuzzer.h index d6bd043726aa04d873b510d3666cc7cda25c1b63..a1615447c3e1191ac5c422c5373f99ec820ff4f2 100644 --- a/test/fuzztest/advancednotificationservice/servicepublish_fuzzer/service_publish_fuzzer.h +++ b/test/fuzztest/advancednotificationservice/servicepublish_fuzzer/service_publish_fuzzer.h @@ -13,12 +13,12 @@ * limitations under the License. */ -#ifndef TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_ADVANCEDNOTIFICATIONSERVICE_FUZZER_H -#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_ADVANCEDNOTIFICATIONSERVICE_FUZZER_H +#ifndef TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISH_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISH_FUZZER_H #include "fuzz_common_base.h" #include -#define FUZZ_PROJECT_NAME "advancednotificationservice_fuzzer" +#define FUZZ_PROJECT_NAME "advancednotificationservicepublish_fuzzer" -#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_ADVANCEDNOTIFICATIONSERVICE_FUZZER_H \ No newline at end of file +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISH_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a0078d910c9d553225a8bd25b35d39a2a789ba25 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServicePublishAsBundleFuzzTest") { + sources_value = [ "service_publishasbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServicePublishAsBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/service_publishasbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/service_publishasbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5554a30432a52726e3a2394b1980f71e5bc08e4e --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/service_publishasbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_publishasbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/service_publishasbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/service_publishasbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..d8676b1072b0fbd3329e477b5a8401cd2eef36d3 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/service_publishasbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHASBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHASBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicepublishasbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHASBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..03798b3e7523bc99ea19f01315377984f089aa3b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServicePublishAsBundleWithMaxCapacityFuzzTest") { + sources_value = [ "service_publishasbundlewithmaxcapacity_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServicePublishAsBundleWithMaxCapacityFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/service_publishasbundlewithmaxcapacity_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/service_publishasbundlewithmaxcapacity_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55b275228d0ec58a968f3118383789409123f2db --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/service_publishasbundlewithmaxcapacity_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_publishasbundlewithmaxcapacity_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/service_publishasbundlewithmaxcapacity_fuzzer.h b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/service_publishasbundlewithmaxcapacity_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..a608535bd193756bbe50b3d77056251a297222fd --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/service_publishasbundlewithmaxcapacity_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHASBUNDLEWITHMAXCAPACITY_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHASBUNDLEWITHMAXCAPACITY_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicepublishasbundlewithmaxcapacity_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHASBUNDLEWITHMAXCAPACITY_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c5d7e0e5531c2b72c519ad200f978f40f0a102db --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServicePublishContinuousTaskNotificationFuzzTest") { + sources_value = [ "service_publishcontinuoustasknotification_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServicePublishContinuousTaskNotificationFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e6c52125a2fe4e2ae54eac31ef2a257728756e43 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_publishcontinuoustasknotification_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.h b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..8b1349f85708e2a0a126e76ad6cd5fef0e870672 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHCONTINUOUSTASKNOTIFICATION_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHCONTINUOUSTASKNOTIFICATION_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicepublishcontinuoustasknotification_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHCONTINUOUSTASKNOTIFICATION_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..333149ed2d097d9dfe4acc6d22af121e8651996b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServicePublishForIndirectProxyWithMaxCapacityFuzzTest") { + sources_value = [ "service_publishforindirectproxywithmaxcapacity_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServicePublishForIndirectProxyWithMaxCapacityFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/service_publishforindirectproxywithmaxcapacity_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/service_publishforindirectproxywithmaxcapacity_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ab9560a53ff57fe377bc8a6b02e1b7c2831e00e2 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/service_publishforindirectproxywithmaxcapacity_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_publishforindirectproxywithmaxcapacity_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/service_publishforindirectproxywithmaxcapacity_fuzzer.h b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/service_publishforindirectproxywithmaxcapacity_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..c6edfd69d5d610b8c03137496c59ffe93d2b9cf4 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/service_publishforindirectproxywithmaxcapacity_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHFORINDIRECTPROXYWITHMAXCAPACITY_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHFORINDIRECTPROXYWITHMAXCAPACITY_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicepublishforindirectproxywithmaxcapacity_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHFORINDIRECTPROXYWITHMAXCAPACITY_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..b6655181ba572cd23b5fd37d5beb427de008c8c2 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServicePublishNotificationForIndirectProxyFuzzTest") { + sources_value = [ "service_publishnotificationforindirectproxy_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServicePublishNotificationForIndirectProxyFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/service_publishnotificationforindirectproxy_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/service_publishnotificationforindirectproxy_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5aafc6827343f5dcc988d7e93648c0b84bc0c278 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/service_publishnotificationforindirectproxy_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_publishnotificationforindirectproxy_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/service_publishnotificationforindirectproxy_fuzzer.h b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/service_publishnotificationforindirectproxy_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..c10c33458bd557ddb1d164d4258e6c3a4f57b6b9 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/service_publishnotificationforindirectproxy_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHNOTIFICATIONFORINDIRECTPROXY_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHNOTIFICATIONFORINDIRECTPROXY_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicepublishnotificationforindirectproxy_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHNOTIFICATIONFORINDIRECTPROXY_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..deee997c9a13cce8d8ef2a840e05221fca7c8ca7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServicePublishWithMaxCapacityFuzzTest") { + sources_value = [ "service_publishwithmaxcapacity_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServicePublishWithMaxCapacityFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/service_publishwithmaxcapacity_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/service_publishwithmaxcapacity_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e4b02db214ec01c4c7deb3663ca62aaaffccc7ea --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/service_publishwithmaxcapacity_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_publishwithmaxcapacity_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/service_publishwithmaxcapacity_fuzzer.h b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/service_publishwithmaxcapacity_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..995266495da9d304dcca6ab2ad51b701d9f90a8b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/service_publishwithmaxcapacity_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHWITHMAXCAPACITY_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHWITHMAXCAPACITY_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicepublishwithmaxcapacity_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_PUBLISHWITHMAXCAPACITY_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..4f104af735352d0cccb2d0ad3c51c6597bed89d6 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRegisterPushCallbackFuzzTest") { + sources_value = [ "service_registerpushcallback_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRegisterPushCallbackFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/service_registerpushcallback_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/service_registerpushcallback_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..56f10cddab413098edd7177d66002bfe397cd0f7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/service_registerpushcallback_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_registerpushcallback_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/service_registerpushcallback_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/service_registerpushcallback_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..0b8ee101207cbe88351e816040aa8cef5f3661a1 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/service_registerpushcallback_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REGISTERPUSHCALLBACK_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REGISTERPUSHCALLBACK_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceregisterpushcallback_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REGISTERPUSHCALLBACK_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..13a93ef98ab4cc23cdb4f857fdb06e6a05336aca --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRemoveAllNotificationsFuzzTest") { + sources_value = [ "service_removeallnotifications_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRemoveAllNotificationsFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e759156ffaf7bd25a79aba77ee0a45bb4adf37b1 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_removeallnotifications_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..566da5cd76f1d23fcfeabfe5ece6e0b1f587662b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEALLNOTIFICATIONS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEALLNOTIFICATIONS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceremoveallnotifications_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEALLNOTIFICATIONS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..04ab055a063e0c1b77e2c3cd2def110a06470a54 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRemoveDistributedNotificationsFuzzTest") { + sources_value = [ "service_removedistributednotifications_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRemoveDistributedNotificationsFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/service_removedistributednotifications_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/service_removedistributednotifications_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9152e6dd54e3803a39c99b7a2b200e81d8bc288c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/service_removedistributednotifications_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_removedistributednotifications_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/service_removedistributednotifications_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/service_removedistributednotifications_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..aee6e9338205c9348614bf38bc2e8eab37cdf31d --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/service_removedistributednotifications_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEDISTRIBUTEDNOTIFICATIONS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEDISTRIBUTEDNOTIFICATIONS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceremovedistributednotifications_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEDISTRIBUTEDNOTIFICATIONS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..cb9469d40db65b26dd4dc9ffcff29992cef197e7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRemoveDoNotDisturbProfilesFuzzTest") { + sources_value = [ "service_removedonotdisturbprofiles_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRemoveDoNotDisturbProfilesFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/service_removedonotdisturbprofiles_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/service_removedonotdisturbprofiles_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e8692ec1107efec075c159f6b5245514246a1cd7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/service_removedonotdisturbprofiles_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_removedonotdisturbprofiles_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/service_removedonotdisturbprofiles_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/service_removedonotdisturbprofiles_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..7b34246df8d5f2fadc8281821a897a08f500f37d --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/service_removedonotdisturbprofiles_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEDONOTDISTURBPROFILES_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEDONOTDISTURBPROFILES_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceremovedonotdisturbprofiles_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEDONOTDISTURBPROFILES_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..012d543f1327398fbbc6359a8aa3b8354f155429 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRemoveGroupByBundleFuzzTest") { + sources_value = [ "service_removegroupbybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRemoveGroupByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/service_removegroupbybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/service_removegroupbybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..72aa484a592767734b92d8c54ad3aaf2c5bab824 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/service_removegroupbybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_removegroupbybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/service_removegroupbybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/service_removegroupbybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..53e10ac3ba54e9a2b3e4b385d5214e50fad4d739 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/service_removegroupbybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEGROUPBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEGROUPBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceremovegroupbybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVEGROUPBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..db4262fee0a7d66ca7cf2bf003c2b29fb518daa1 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRemoveNotificationFuzzTest") { + sources_value = [ "service_removenotification_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRemoveNotificationFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/service_removenotification_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/service_removenotification_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c66de57b166d73d11e971011895c3655ee7a4b2e --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/service_removenotification_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_removenotification_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/service_removenotification_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/service_removenotification_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..e685394476ecdaa0c18d704198a14d5f00dbc73c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/service_removenotification_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVENOTIFICATION_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVENOTIFICATION_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceremovenotification_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVENOTIFICATION_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c85cb7301442e46a91baac525325e67d4859f854 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRemoveNotificationsFuzzTest") { + sources_value = [ "service_removenotifications_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRemoveNotificationsFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/service_removenotifications_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/service_removenotifications_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..855b2ecac359525f2f68dc4c4215b9c972b42e0a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/service_removenotifications_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_removenotifications_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/service_removenotifications_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/service_removenotifications_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..1374b9887e0ee591d2d356a64ad17290fb53603c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/service_removenotifications_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVENOTIFICATIONS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVENOTIFICATIONS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceremovenotifications_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVENOTIFICATIONS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..b35b29f92313d8d02d9f80e6a0390a016e0a3e11 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRemoveSlotByTypeFuzzTest") { + sources_value = [ "service_removeslotbytype_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRemoveSlotByTypeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/service_removeslotbytype_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/service_removeslotbytype_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4564b2a6ba169ebefbd3f4444819cc6d8d7251eb --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/service_removeslotbytype_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_removeslotbytype_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/service_removeslotbytype_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/service_removeslotbytype_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..76c4cd3853446b3852afc710d3779ce7bd381436 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/service_removeslotbytype_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVESLOTBYTYPE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVESLOTBYTYPE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceremoveslotbytype_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REMOVESLOTBYTYPE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5bf7cfd6eacce45d2534372b935a8e7d02bbfd97 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceReplyDistributeOperationFuzzTest") { + sources_value = [ "service_replydistributeoperation_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceReplyDistributeOperationFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/service_replydistributeoperation_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/service_replydistributeoperation_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..63d4ccdf0952236a0af66da9268a07a95bbf0013 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/service_replydistributeoperation_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_replydistributeoperation_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/service_replydistributeoperation_fuzzer.h b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/service_replydistributeoperation_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..245cd51a077a6ab7a981bfb0c6a6fb80327040b8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/service_replydistributeoperation_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REPLYDISTRIBUTEOPERATION_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REPLYDISTRIBUTEOPERATION_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicereplydistributeoperation_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REPLYDISTRIBUTEOPERATION_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..4903f70cb4e1ea7eecfdc0c5bdaa06516446c2e9 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceRequestEnableNotificationFuzzTest") { + sources_value = [ "service_requestenablenotification_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceRequestEnableNotificationFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/service_requestenablenotification_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/service_requestenablenotification_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..49d9e41e69c3618e223651ae8ab9d6f263fc8300 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/service_requestenablenotification_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_requestenablenotification_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/service_requestenablenotification_fuzzer.h b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/service_requestenablenotification_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..d62aac6125f1bf6e02d8caa4c23333245f5ed3e6 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/service_requestenablenotification_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REQUESTENABLENOTIFICATION_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REQUESTENABLENOTIFICATION_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicerequestenablenotification_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_REQUESTENABLENOTIFICATION_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..47959412e292ced5b744e017d684e2b1991d2a93 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetAdditionConfigFuzzTest") { + sources_value = [ "service_setadditionconfig_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetAdditionConfigFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/service_setadditionconfig_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/service_setadditionconfig_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..81d75e4cd18ee92a03165216ac65f2bb06aa71ec --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/service_setadditionconfig_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setadditionconfig_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/service_setadditionconfig_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/service_setadditionconfig_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..c055c79107ca1e1fb7920668af203a408263ee3e --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/service_setadditionconfig_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETADDITIONCONFIG_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETADDITIONCONFIG_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetadditionconfig_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETADDITIONCONFIG_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..0457f23ba28836c348fbbc2942aaf317be54d70c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetBadgeNumberFuzzTest") { + sources_value = [ "service_setbadgenumber_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetBadgeNumberFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1f6c7e0c0eac1b14d42fd980d61835a4ac4b87fc --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setbadgenumber_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..589c82d03e6f3c8e7572170779a2d13492e23336 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBER_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBER_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetbadgenumber_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBER_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f7a64b3f732431f6f744e9bacf2f5c072cd3ef4f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetBadgeNumberByBundleFuzzTest") { + sources_value = [ "service_setbadgenumberbybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetBadgeNumberByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/service_setbadgenumberbybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/service_setbadgenumberbybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a8124318ca74566662e361176dff9d0295334fa4 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/service_setbadgenumberbybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setbadgenumberbybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/service_setbadgenumberbybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/service_setbadgenumberbybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..1f577f50ab5e8d0abc97cdc7746d632200ec0c52 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/service_setbadgenumberbybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBERBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBERBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetbadgenumberbybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBERBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5788a06117cd97d7940d642e16b8b0496d40795a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetBadgeNumberForDhByBundleFuzzTest") { + sources_value = [ "service_setbadgenumberfordhbybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetBadgeNumberForDhByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/service_setbadgenumberfordhbybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/service_setbadgenumberfordhbybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df8ad3cc774be663696e5639dbf8a293a8a91122 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/service_setbadgenumberfordhbybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setbadgenumberfordhbybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/service_setbadgenumberfordhbybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/service_setbadgenumberfordhbybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..49bb244eb8f0655a311644ba5ed64a2feb3938ab --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/service_setbadgenumberfordhbybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBERFORDHBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBERFORDHBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetbadgenumberfordhbybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETBADGENUMBERFORDHBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..ad91b8f3c340df7e5ad54bd16fb0439e200b0cfc --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetDistributedEnabledByBundleFuzzTest") { + sources_value = [ "service_setdistributedenabledbybundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetDistributedEnabledByBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/service_setdistributedenabledbybundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/service_setdistributedenabledbybundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..466d90492a081639f181aa3ddf66be1b949099ed --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/service_setdistributedenabledbybundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setdistributedenabledbybundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/service_setdistributedenabledbybundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/service_setdistributedenabledbybundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..ed6750734b9a9fb724a5e1bf835cced1c2210844 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/service_setdistributedenabledbybundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDISTRIBUTEDENABLEDBYBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDISTRIBUTEDENABLEDBYBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetdistributedenabledbybundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDISTRIBUTEDENABLEDBYBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..b5d477651b09920ea4e4d293ddd26752faa631a7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetDistributedEnabledBySlotFuzzTest") { + sources_value = [ "service_setdistributedenabledbyslot_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetDistributedEnabledBySlotFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/service_setdistributedenabledbyslot_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/service_setdistributedenabledbyslot_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8be81f13c4b17068c5ada65fab67bf1e68078336 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/service_setdistributedenabledbyslot_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setdistributedenabledbyslot_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/service_setdistributedenabledbyslot_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/service_setdistributedenabledbyslot_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..bd0928b251eb1e7b87d8ef5d7a74e5b9ce9ce07a --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/service_setdistributedenabledbyslot_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDISTRIBUTEDENABLEDBYSLOT_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDISTRIBUTEDENABLEDBYSLOT_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetdistributedenabledbyslot_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDISTRIBUTEDENABLEDBYSLOT_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f080fce9bc79dabff47a5648896db24f5141cec9 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetDoNotDisturbDateFuzzTest") { + sources_value = [ "service_setdonotdisturbdate_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetDoNotDisturbDateFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/service_setdonotdisturbdate_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/service_setdonotdisturbdate_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..607e56a4ba5e36064b2f10962574ef682eeb9df6 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/service_setdonotdisturbdate_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setdonotdisturbdate_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/service_setdonotdisturbdate_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/service_setdonotdisturbdate_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..1dbb94705c9fe55331721f03e5b56a7c83a72f89 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/service_setdonotdisturbdate_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDONOTDISTURBDATE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDONOTDISTURBDATE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetdonotdisturbdate_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETDONOTDISTURBDATE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..d460c3c8134939c11dc90ca267e439ca7c7b8a00 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetEnabledForBundleSlotFuzzTest") { + sources_value = [ "service_setenabledforbundleslot_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetEnabledForBundleSlotFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/service_setenabledforbundleslot_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/service_setenabledforbundleslot_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2d69fed755988add6d55ea3b5de11eb4a5a27321 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/service_setenabledforbundleslot_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setenabledforbundleslot_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/service_setenabledforbundleslot_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/service_setenabledforbundleslot_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..3b6c3ee449ab02a053c45bb983ec0bbbbcd18b1f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/service_setenabledforbundleslot_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETENABLEDFORBUNDLESLOT_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETENABLEDFORBUNDLESLOT_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetenabledforbundleslot_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETENABLEDFORBUNDLESLOT_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..15ec429d81ec37b242458e6bd244c74622fa9f52 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetHashCodeRuleFuzzTest") { + sources_value = [ "service_sethashcoderule_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetHashCodeRuleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f072f76d931e40f2ccddb7d23b38eea05cd3f825 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_sethashcoderule_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..7f44085f2443b8443435f0810557728088aaec40 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETHASHCODERULE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETHASHCODERULE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesethashcoderule_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETHASHCODERULE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..578f3604babbc7fda30fe09b7abe865317342320 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetNotificationBadgeNumFuzzTest") { + sources_value = [ "service_setnotificationbadgenum_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetNotificationBadgeNumFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/service_setnotificationbadgenum_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/service_setnotificationbadgenum_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9dab544e4270e44c79c5bcb77fb8d8310e128b72 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/service_setnotificationbadgenum_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setnotificationbadgenum_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/service_setnotificationbadgenum_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/service_setnotificationbadgenum_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..b617aa2c5dffe888203d8cc3099abdb6b1534b64 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/service_setnotificationbadgenum_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONBADGENUM_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONBADGENUM_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetnotificationbadgenum_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONBADGENUM_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..04e315d60fb943c9de791cb515f8f3b61047c6d7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetNotificationsEnabledByUserFuzzTest") { + sources_value = [ "service_setnotificationsenabledbyuser_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetNotificationsEnabledByUserFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/service_setnotificationsenabledbyuser_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/service_setnotificationsenabledbyuser_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f8c4f830395c2b977090097800aa6f214b47eb5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/service_setnotificationsenabledbyuser_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setnotificationsenabledbyuser_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/service_setnotificationsenabledbyuser_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/service_setnotificationsenabledbyuser_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..eb613826288ba585861f170609675d7f2b22f982 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/service_setnotificationsenabledbyuser_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDBYUSER_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDBYUSER_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetnotificationsenabledbyuser_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDBYUSER_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..2f6faf1738cd118f160f1fd2a5f794160997b032 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetNotificationsEnabledForAllBundlesFuzzTest") { + sources_value = [ "service_setnotificationsenabledforallbundles_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetNotificationsEnabledForAllBundlesFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/service_setnotificationsenabledforallbundles_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/service_setnotificationsenabledforallbundles_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e4feac67ec5072a41e50259139f5300141ec481f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/service_setnotificationsenabledforallbundles_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setnotificationsenabledforallbundles_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/service_setnotificationsenabledforallbundles_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/service_setnotificationsenabledforallbundles_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..6d708e6563c0e179012483575ed01629d862d418 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/service_setnotificationsenabledforallbundles_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORALLBUNDLES_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORALLBUNDLES_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetnotificationsenabledforallbundles_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORALLBUNDLES_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..2b359a488f594eca964b8a8070136ffab1830cf5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetNotificationsEnabledForBundleFuzzTest") { + sources_value = [ "service_setnotificationsenabledforbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetNotificationsEnabledForBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/service_setnotificationsenabledforbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/service_setnotificationsenabledforbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e7b0cd253d2b12ec4c193684eafcefd3be90e141 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/service_setnotificationsenabledforbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setnotificationsenabledforbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/service_setnotificationsenabledforbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/service_setnotificationsenabledforbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..7c836ece2fa79c582a087c005aa5ecbfbf477dd4 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/service_setnotificationsenabledforbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetnotificationsenabledforbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e50f1166aea758ec3b8e836688669f7fea8087f3 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetNotificationsEnabledForSpecialBundleFuzzTest") { + sources_value = [ "service_setnotificationsenabledforspecialbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetNotificationsEnabledForSpecialBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/service_setnotificationsenabledforspecialbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/service_setnotificationsenabledforspecialbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cd56aa1b509c36e9a98e2c139569ecc502957203 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/service_setnotificationsenabledforspecialbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setnotificationsenabledforspecialbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/service_setnotificationsenabledforspecialbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/service_setnotificationsenabledforspecialbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..244621683b7e4533bafa119067aeb80d2cb35876 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/service_setnotificationsenabledforspecialbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORSPECIALBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORSPECIALBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetnotificationsenabledforspecialbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETNOTIFICATIONSENABLEDFORSPECIALBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f79f9715ce52bcd950cbfc3202e138588553a3c5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetShowBadgeEnabledForBundleFuzzTest") { + sources_value = [ "service_setshowbadgeenabledforbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetShowBadgeEnabledForBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/service_setshowbadgeenabledforbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/service_setshowbadgeenabledforbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3c1f6ccd66aa8dd22070c2b94f5e6a68cc1d4f8f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/service_setshowbadgeenabledforbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setshowbadgeenabledforbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/service_setshowbadgeenabledforbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/service_setshowbadgeenabledforbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..b13bf4ea8f715330f31a1448ed4e0b9548967d32 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/service_setshowbadgeenabledforbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSHOWBADGEENABLEDFORBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSHOWBADGEENABLEDFORBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetshowbadgeenabledforbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSHOWBADGEENABLEDFORBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..18283531cbfb7e040ea6494a8c73f3d58b47a0f5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetSlotFlagsAsBundleFuzzTest") { + sources_value = [ "service_setslotflagsasbundle_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetSlotFlagsAsBundleFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/service_setslotflagsasbundle_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/service_setslotflagsasbundle_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dbf0f5a5632ce8340340e9a57b368f8c026eb27d --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/service_setslotflagsasbundle_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setslotflagsasbundle_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/service_setslotflagsasbundle_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/service_setslotflagsasbundle_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..3925e0f52f8efb8069659eb975bd5c1ffced2abd --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/service_setslotflagsasbundle_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSLOTFLAGSASBUNDLE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSLOTFLAGSASBUNDLE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetslotflagsasbundle_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSLOTFLAGSASBUNDLE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..bb7e8cbe16a284741f97eb587cc90badef768f62 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetSmartReminderEnabledFuzzTest") { + sources_value = [ "service_setsmartreminderenabled_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetSmartReminderEnabledFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/service_setsmartreminderenabled_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/service_setsmartreminderenabled_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..84d14dac41d4f4eddca8e4711685534bc61777a5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/service_setsmartreminderenabled_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setsmartreminderenabled_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/service_setsmartreminderenabled_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/service_setsmartreminderenabled_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..6264607e9b7cba1540cbe53646be6625c81b70a7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/service_setsmartreminderenabled_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSMARTREMINDERENABLED_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSMARTREMINDERENABLED_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetsmartreminderenabled_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSMARTREMINDERENABLED_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f94ecc20b7209c29f46b4e088e1df73808761db6 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetSyncNotificationEnabledWithoutAppFuzzTest") { + sources_value = [ "service_setsyncnotificationenabledwithoutapp_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetSyncNotificationEnabledWithoutAppFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..461f370a08803bbeaf8ffb57099b3460715f0f8b --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_setsyncnotificationenabledwithoutapp_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..9807b345b4db1f8f344f158729f74ab10cc266b5 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSYNCNOTIFICATIONENABLEDWITHOUTAPP_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSYNCNOTIFICATIONENABLEDWITHOUTAPP_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesetsyncnotificationenabledwithoutapp_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETSYNCNOTIFICATIONENABLEDWITHOUTAPP_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..9ea55bb5af04f3b4d861fb25aadb03b194359ca9 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSetTargetDeviceStatusFuzzTest") { + sources_value = [ "service_settargetdevicestatus_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSetTargetDeviceStatusFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/service_settargetdevicestatus_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/service_settargetdevicestatus_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0fdfc728ab6dd22c667ec8b9eeeafa30d32658de --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/service_settargetdevicestatus_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_settargetdevicestatus_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/service_settargetdevicestatus_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/service_settargetdevicestatus_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..4ceabc666b086cba1690af9e858d1fb187fa3745 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/service_settargetdevicestatus_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETTARGETDEVICESTATUS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETTARGETDEVICESTATUS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesettargetdevicestatus_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SETTARGETDEVICESTATUS_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..aac2a3514b4b5817c71ae23598a6223f0daad4b9 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceShellDumpFuzzTest") { + sources_value = [ "service_shelldump_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceShellDumpFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/service_shelldump_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/service_shelldump_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..02c33df2739e58ed55f88d1830ceec2043efe388 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/service_shelldump_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_shelldump_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/service_shelldump_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/service_shelldump_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..f9e7f9544679c071c7e4e9b5050ddaf0ec866e92 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/service_shelldump_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SHELLDUMP_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SHELLDUMP_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceshelldump_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SHELLDUMP_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..7409283b60b0caab11e21bcc655a877c0563ce26 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSubscribeFuzzTest") { + sources_value = [ "service_subscribe_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSubscribeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/service_subscribe_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/service_subscribe_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..991515ae66b16dccd3827a3a582a01d06012ca89 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/service_subscribe_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_subscribe_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/service_subscribe_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/service_subscribe_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..d377576560b4cda1e36165c0c0569c3a023f2f44 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/service_subscribe_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesubscribe_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..12bab058407a8325636be42dd492c3d9aca15469 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSubscribeLocalLiveViewFuzzTest") { + sources_value = [ "service_subscribelocalliveview_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSubscribeLocalLiveViewFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/service_subscribelocalliveview_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/service_subscribelocalliveview_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e6da395d5996db0a2afdb86d826ca424569fb0c8 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/service_subscribelocalliveview_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_subscribelocalliveview_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/service_subscribelocalliveview_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/service_subscribelocalliveview_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..73e3903bfc83f735e784c4afeca005e205955190 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/service_subscribelocalliveview_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBELOCALLIVEVIEW_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBELOCALLIVEVIEW_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesubscribelocalliveview_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBELOCALLIVEVIEW_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..cfea9a13fa8b6bd5851503ccdbd5312c9716fcfb --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceSubscribeSelfFuzzTest") { + sources_value = [ "service_subscribeself_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceSubscribeSelfFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/service_subscribeself_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/service_subscribeself_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3b6f9baeeb62eef237972235608ea07814e0018f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/service_subscribeself_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_subscribeself_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/service_subscribeself_fuzzer.h b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/service_subscribeself_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..f6b29a302d7006b2ab04ecdeebf23179fc1cae33 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/service_subscribeself_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBESELF_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBESELF_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicesubscribeself_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_SUBSCRIBESELF_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..1693219724ee0960433cdab7a2819bc6e05239e3 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceTriggerLocalLiveViewFuzzTest") { + sources_value = [ "service_triggerlocalliveview_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceTriggerLocalLiveViewFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/service_triggerlocalliveview_fuzzer.cpp b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/service_triggerlocalliveview_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f2271c6a8ae4548c776d667a72ff53b46bdcb658 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/service_triggerlocalliveview_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_triggerlocalliveview_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/service_triggerlocalliveview_fuzzer.h b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/service_triggerlocalliveview_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..30095113ed16a62db5464a2a7bb52b7d8d73f9ec --- /dev/null +++ b/test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/service_triggerlocalliveview_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_TRIGGERLOCALLIVEVIEW_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_TRIGGERLOCALLIVEVIEW_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationservicetriggerlocalliveview_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_TRIGGERLOCALLIVEVIEW_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..570911011defc8b968194c31f36c740f00524795 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceUnsubscribeFuzzTest") { + sources_value = [ "service_unsubscribe_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceUnsubscribeFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f9ed56c048d08a661008f20c029004c73431e796 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_unsubscribe_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..d85e77f89da80293ff6ecd89098965661aa801b7 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UNSUBSCRIBE_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UNSUBSCRIBE_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceunsubscribe_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UNSUBSCRIBE_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..48db1e51f41cfe1d58a564e753ee7b2373b1fd21 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceUpdateNotificationTimerByUidFuzzTest") { + sources_value = [ "service_updatenotificationtimerbyuid_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceUpdateNotificationTimerByUidFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/service_updatenotificationtimerbyuid_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/service_updatenotificationtimerbyuid_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2658091199567f9aa8949132d3089b0ae85de74f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/service_updatenotificationtimerbyuid_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_updatenotificationtimerbyuid_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/service_updatenotificationtimerbyuid_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/service_updatenotificationtimerbyuid_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..15a2024218206aa1944d8fcab8844220c19e9f5c --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/service_updatenotificationtimerbyuid_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UPDATENOTIFICATIONTIMERBYUID_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UPDATENOTIFICATIONTIMERBYUID_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceupdatenotificationtimerbyuid_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UPDATENOTIFICATIONTIMERBYUID_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..801db389445a0420fea464bc4733f08ffe890d88 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/BUILD.gn @@ -0,0 +1,32 @@ +# 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 +# +# 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. + + +#####################hydra-fuzz################### +import("../advancednotificationservice_fuzztest_common.gni") # 导入公共配置 + +##############################fuzztest########################################## +advancednotificationservice_fuzztest_target("ServiceUpdateSlotsFuzzTest") { + sources_value = [ "service_updateslots_fuzzer.cpp" ] + fuzz_config_file_value = + "${component_path}/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer" + deps_value = [] # 如果不需要额外依赖,可以留空 + common_deps_value = common_deps # 使用公共依赖 +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":ServiceUpdateSlotsFuzzTest" ] +} +############################################################################### diff --git a/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/corpus/init b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/corpus/init new file mode 100644 index 0000000000000000000000000000000000000000..d9719cafab50ed61d354cfa865b56390a0df320f --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/corpus/init @@ -0,0 +1,13 @@ +# 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. +FUZZ \ No newline at end of file diff --git a/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/project.xml b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/project.xml new file mode 100644 index 0000000000000000000000000000000000000000..226522bd2ad3eaf2db4f710f1924d82d2912c235 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 10000 + + 300 + + 4096 + + diff --git a/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.cpp b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..098266716973c62b3b97b506c865e15b1ba6c6ec --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.cpp @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 "service_updateslots_fuzzer.h" + +#include +#include "advanced_notification_service.h" +#include "ans_permission_def.h" +#include "mock_notification_request.h" + +namespace OHOS { +namespace Notification { + bool DoSomethingInterestingWithMyAPI(FuzzedDataProvider *fuzzData) + { + return true; + } +} +} + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + /* Run your code on data */ + FuzzedDataProvider fdp(data, size); + OHOS::Notification::DoSomethingInterestingWithMyAPI(&fdp); + return 0; +} diff --git a/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.h b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.h new file mode 100644 index 0000000000000000000000000000000000000000..44dca2a47c6b9ba34d99fe9ae32a0a5a8a882117 --- /dev/null +++ b/test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.h @@ -0,0 +1,24 @@ +/* + * 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 + * + * 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_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UPDATESLOTS_FUZZER_H +#define TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UPDATESLOTS_FUZZER_H + +#include "fuzz_common_base.h" +#include + +#define FUZZ_PROJECT_NAME "advancednotificationserviceupdateslots_fuzzer" + +#endif // TEST_FUZZTEST_ADVANCEDNOTIFICATIONSERVICE_FUZZER_SERVICE_UPDATESLOTS_FUZZER_H \ No newline at end of file