From 7a93b8fba900f09a2b05b1d72fbbe00ac95afcac Mon Sep 17 00:00:00 2001 From: wangdi Date: Fri, 27 Jun 2025 12:59:03 +0800 Subject: [PATCH] add advancednotificationservice fuzz template Signed-off-by: wangdi --- .../advancednotificationservice/BUILD.gn | 93 +++++++++- ...cednotificationservice_fuzztest_common.gni | 161 ++++++++++++++++++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...service_adddonotdisturbprofiles_fuzzer.cpp | 38 +++++ .../service_adddonotdisturbprofiles_fuzzer.h | 24 +++ .../serviceaddslotbytype_fuzzer/BUILD.gn | 32 ++++ .../serviceaddslotbytype_fuzzer/corpus/init | 13 ++ .../serviceaddslotbytype_fuzzer/project.xml | 25 +++ .../service_addslotbytype_fuzzer.cpp | 38 +++++ .../service_addslotbytype_fuzzer.h | 24 +++ .../serviceaddslots_fuzzer/BUILD.gn | 32 ++++ .../serviceaddslots_fuzzer/corpus/init | 13 ++ .../serviceaddslots_fuzzer/project.xml | 25 +++ .../service_addslots_fuzzer.cpp | 38 +++++ .../service_addslots_fuzzer.h | 24 +++ .../serviceallowusereminder_fuzzer/BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_allowusereminder_fuzzer.cpp | 38 +++++ .../service_allowusereminder_fuzzer.h | 24 +++ .../servicecancel_fuzzer/BUILD.gn | 32 ++++ .../servicecancel_fuzzer/corpus/init | 13 ++ .../servicecancel_fuzzer/project.xml | 25 +++ .../service_cancel_fuzzer.cpp | 38 +++++ .../service_cancel_fuzzer.h | 24 +++ .../servicecancelall_fuzzer/BUILD.gn | 32 ++++ .../servicecancelall_fuzzer/corpus/init | 13 ++ .../servicecancelall_fuzzer/project.xml | 25 +++ .../service_cancelall_fuzzer.cpp | 38 +++++ .../service_cancelall_fuzzer.h | 24 +++ .../servicecancelasbundle_fuzzer/BUILD.gn | 32 ++++ .../servicecancelasbundle_fuzzer/corpus/init | 13 ++ .../servicecancelasbundle_fuzzer/project.xml | 25 +++ .../service_cancelasbundle_fuzzer.cpp | 38 +++++ .../service_cancelasbundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...service_cancelasbundlewithagent_fuzzer.cpp | 38 +++++ .../service_cancelasbundlewithagent_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ancelcontinuoustasknotification_fuzzer.cpp | 38 +++++ ..._cancelcontinuoustasknotification_fuzzer.h | 24 +++ .../servicecancelgroup_fuzzer/BUILD.gn | 32 ++++ .../servicecancelgroup_fuzzer/corpus/init | 13 ++ .../servicecancelgroup_fuzzer/project.xml | 25 +++ .../service_cancelgroup_fuzzer.cpp | 38 +++++ .../service_cancelgroup_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ..._canpopenablenotificationdialog_fuzzer.cpp | 38 +++++ ...ce_canpopenablenotificationdialog_fuzzer.h | 24 +++ .../servicecanpublishasbundle_fuzzer/BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_canpublishasbundle_fuzzer.cpp | 38 +++++ .../service_canpublishasbundle_fuzzer.h | 24 +++ .../servicedelete_fuzzer/BUILD.gn | 32 ++++ .../servicedelete_fuzzer/corpus/init | 13 ++ .../servicedelete_fuzzer/project.xml | 25 +++ .../service_delete_fuzzer.cpp | 38 +++++ .../service_delete_fuzzer.h | 24 +++ .../servicedeleteallbyuser_fuzzer/BUILD.gn | 32 ++++ .../servicedeleteallbyuser_fuzzer/corpus/init | 13 ++ .../servicedeleteallbyuser_fuzzer/project.xml | 25 +++ .../service_deleteallbyuser_fuzzer.cpp | 38 +++++ .../service_deleteallbyuser_fuzzer.h | 24 +++ .../servicedeletebybundle_fuzzer/BUILD.gn | 32 ++++ .../servicedeletebybundle_fuzzer/corpus/init | 13 ++ .../servicedeletebybundle_fuzzer/project.xml | 25 +++ .../service_deletebybundle_fuzzer.cpp | 38 +++++ .../service_deletebybundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...vice_disablenotificationfeature_fuzzer.cpp | 38 +++++ ...ervice_disablenotificationfeature_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_distributeoperation_fuzzer.cpp | 38 +++++ .../service_distributeoperation_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...rvice_enabledistributedbybundle_fuzzer.cpp | 38 +++++ ...service_enabledistributedbybundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...e_getactivenotificationbyfilter_fuzzer.cpp | 38 +++++ ...ice_getactivenotificationbyfilter_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_getactivenotifications_fuzzer.cpp | 38 +++++ .../service_getactivenotifications_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ..._getalldistribuedenabledbundles_fuzzer.cpp | 38 +++++ ...ce_getalldistribuedenabledbundles_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ce_getallliveviewenabledbundles_fuzzer.cpp | 38 +++++ ...vice_getallliveviewenabledbundles_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...e_getallnotificationsbyslottype_fuzzer.cpp | 38 +++++ ...ice_getallnotificationsbyslottype_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_getbundleimportance_fuzzer.cpp | 38 +++++ .../service_getbundleimportance_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_getdeviceremindtype_fuzzer.cpp | 38 +++++ .../service_getdeviceremindtype_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_getdonotdisturbdate_fuzzer.cpp | 38 +++++ .../service_getdonotdisturbdate_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_getdonotdisturbprofile_fuzzer.cpp | 38 +++++ .../service_getdonotdisturbprofile_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...service_getenabledforbundleslot_fuzzer.cpp | 38 +++++ .../service_getenabledforbundleslot_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ice_getenabledforbundleslotself_fuzzer.cpp | 38 +++++ ...rvice_getenabledforbundleslotself_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...etnotificationrequestbyhashcode_fuzzer.cpp | 38 +++++ ..._getnotificationrequestbyhashcode_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ce_getshowbadgeenabledforbundle_fuzzer.cpp | 38 +++++ ...vice_getshowbadgeenabledforbundle_fuzzer.h | 24 +++ .../servicegetslotbybundle_fuzzer/BUILD.gn | 32 ++++ .../servicegetslotbybundle_fuzzer/corpus/init | 13 ++ .../servicegetslotbybundle_fuzzer/project.xml | 25 +++ .../service_getslotbybundle_fuzzer.cpp | 38 +++++ .../service_getslotbybundle_fuzzer.h | 24 +++ .../servicegetslotbytype_fuzzer/BUILD.gn | 32 ++++ .../servicegetslotbytype_fuzzer/corpus/init | 13 ++ .../servicegetslotbytype_fuzzer/project.xml | 25 +++ .../service_getslotbytype_fuzzer.cpp | 38 +++++ .../service_getslotbytype_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_getslotflagsasbundle_fuzzer.cpp | 38 +++++ .../service_getslotflagsasbundle_fuzzer.h | 24 +++ .../servicegetslotnumasbundle_fuzzer/BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_getslotnumasbundle_fuzzer.cpp | 38 +++++ .../service_getslotnumasbundle_fuzzer.h | 24 +++ .../servicegetslots_fuzzer/BUILD.gn | 32 ++++ .../servicegetslots_fuzzer/corpus/init | 13 ++ .../servicegetslots_fuzzer/project.xml | 25 +++ .../service_getslots_fuzzer.cpp | 38 +++++ .../service_getslots_fuzzer.h | 24 +++ .../servicegetslotsbybundle_fuzzer/BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_getslotsbybundle_fuzzer.cpp | 38 +++++ .../service_getslotsbybundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...e_getspecialactivenotifications_fuzzer.cpp | 38 +++++ ...ice_getspecialactivenotifications_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ncnotificationenabledwithoutapp_fuzzer.cpp | 38 +++++ ...syncnotificationenabledwithoutapp_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_gettargetdevicestatus_fuzzer.cpp | 38 +++++ .../service_gettargetdevicestatus_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ice_isdistributedenablebybundle_fuzzer.cpp | 38 +++++ ...rvice_isdistributedenablebybundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ce_isdistributedenabledbybundle_fuzzer.cpp | 38 +++++ ...vice_isdistributedenabledbybundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...vice_isdistributedenabledbyslot_fuzzer.cpp | 38 +++++ ...ervice_isdistributedenabledbyslot_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ..._isneedsilentindonotdisturbmode_fuzzer.cpp | 38 +++++ ...ce_isneedsilentindonotdisturbmode_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_issmartreminderenabled_fuzzer.cpp | 38 +++++ .../service_issmartreminderenabled_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ce_isspecialbundleallowednotify_fuzzer.cpp | 38 +++++ ...vice_isspecialbundleallowednotify_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...vice_isspecialuserallowednotify_fuzzer.cpp | 38 +++++ ...ervice_isspecialuserallowednotify_fuzzer.h | 24 +++ .../serviceissupporttemplate_fuzzer/BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_issupporttemplate_fuzzer.cpp | 38 +++++ .../service_issupporttemplate_fuzzer.h | 24 +++ .../servicepublish_fuzzer/BUILD.gn | 134 +-------------- .../service_publish_fuzzer.h | 8 +- .../servicepublishasbundle_fuzzer/BUILD.gn | 32 ++++ .../servicepublishasbundle_fuzzer/corpus/init | 13 ++ .../servicepublishasbundle_fuzzer/project.xml | 25 +++ .../service_publishasbundle_fuzzer.cpp | 38 +++++ .../service_publishasbundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ..._publishasbundlewithmaxcapacity_fuzzer.cpp | 38 +++++ ...ce_publishasbundlewithmaxcapacity_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...blishcontinuoustasknotification_fuzzer.cpp | 38 +++++ ...publishcontinuoustasknotification_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...forindirectproxywithmaxcapacity_fuzzer.cpp | 38 +++++ ...shforindirectproxywithmaxcapacity_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ishnotificationforindirectproxy_fuzzer.cpp | 38 +++++ ...blishnotificationforindirectproxy_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_publishwithmaxcapacity_fuzzer.cpp | 38 +++++ .../service_publishwithmaxcapacity_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_registerpushcallback_fuzzer.cpp | 38 +++++ .../service_registerpushcallback_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_removeallnotifications_fuzzer.cpp | 38 +++++ .../service_removeallnotifications_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ..._removedistributednotifications_fuzzer.cpp | 38 +++++ ...ce_removedistributednotifications_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...vice_removedonotdisturbprofiles_fuzzer.cpp | 38 +++++ ...ervice_removedonotdisturbprofiles_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_removegroupbybundle_fuzzer.cpp | 38 +++++ .../service_removegroupbybundle_fuzzer.h | 24 +++ .../serviceremovenotification_fuzzer/BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_removenotification_fuzzer.cpp | 38 +++++ .../service_removenotification_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_removenotifications_fuzzer.cpp | 38 +++++ .../service_removenotifications_fuzzer.h | 24 +++ .../serviceremoveslotbytype_fuzzer/BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_removeslotbytype_fuzzer.cpp | 38 +++++ .../service_removeslotbytype_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ervice_replydistributeoperation_fuzzer.cpp | 38 +++++ .../service_replydistributeoperation_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...rvice_requestenablenotification_fuzzer.cpp | 38 +++++ ...service_requestenablenotification_fuzzer.h | 24 +++ .../servicesetadditionconfig_fuzzer/BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_setadditionconfig_fuzzer.cpp | 38 +++++ .../service_setadditionconfig_fuzzer.h | 24 +++ .../servicesetbadgenumber_fuzzer/BUILD.gn | 32 ++++ .../servicesetbadgenumber_fuzzer/corpus/init | 13 ++ .../servicesetbadgenumber_fuzzer/project.xml | 25 +++ .../service_setbadgenumber_fuzzer.cpp | 38 +++++ .../service_setbadgenumber_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_setbadgenumberbybundle_fuzzer.cpp | 38 +++++ .../service_setbadgenumberbybundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ice_setbadgenumberfordhbybundle_fuzzer.cpp | 38 +++++ ...rvice_setbadgenumberfordhbybundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...e_setdistributedenabledbybundle_fuzzer.cpp | 38 +++++ ...ice_setdistributedenabledbybundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ice_setdistributedenabledbyslot_fuzzer.cpp | 38 +++++ ...rvice_setdistributedenabledbyslot_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_setdonotdisturbdate_fuzzer.cpp | 38 +++++ .../service_setdonotdisturbdate_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...service_setenabledforbundleslot_fuzzer.cpp | 38 +++++ .../service_setenabledforbundleslot_fuzzer.h | 24 +++ .../servicesethashcoderule_fuzzer/BUILD.gn | 32 ++++ .../servicesethashcoderule_fuzzer/corpus/init | 13 ++ .../servicesethashcoderule_fuzzer/project.xml | 25 +++ .../service_sethashcoderule_fuzzer.cpp | 38 +++++ .../service_sethashcoderule_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...service_setnotificationbadgenum_fuzzer.cpp | 38 +++++ .../service_setnotificationbadgenum_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...e_setnotificationsenabledbyuser_fuzzer.cpp | 38 +++++ ...ice_setnotificationsenabledbyuser_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...tificationsenabledforallbundles_fuzzer.cpp | 38 +++++ ...notificationsenabledforallbundles_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...etnotificationsenabledforbundle_fuzzer.cpp | 38 +++++ ..._setnotificationsenabledforbundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...icationsenabledforspecialbundle_fuzzer.cpp | 38 +++++ ...ificationsenabledforspecialbundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ce_setshowbadgeenabledforbundle_fuzzer.cpp | 38 +++++ ...vice_setshowbadgeenabledforbundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_setslotflagsasbundle_fuzzer.cpp | 38 +++++ .../service_setslotflagsasbundle_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...service_setsmartreminderenabled_fuzzer.cpp | 38 +++++ .../service_setsmartreminderenabled_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ncnotificationenabledwithoutapp_fuzzer.cpp | 38 +++++ ...syncnotificationenabledwithoutapp_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_settargetdevicestatus_fuzzer.cpp | 38 +++++ .../service_settargetdevicestatus_fuzzer.h | 24 +++ .../serviceshelldump_fuzzer/BUILD.gn | 32 ++++ .../serviceshelldump_fuzzer/corpus/init | 13 ++ .../serviceshelldump_fuzzer/project.xml | 25 +++ .../service_shelldump_fuzzer.cpp | 38 +++++ .../service_shelldump_fuzzer.h | 24 +++ .../servicesubscribe_fuzzer/BUILD.gn | 32 ++++ .../servicesubscribe_fuzzer/corpus/init | 13 ++ .../servicesubscribe_fuzzer/project.xml | 25 +++ .../service_subscribe_fuzzer.cpp | 38 +++++ .../service_subscribe_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_subscribelocalliveview_fuzzer.cpp | 38 +++++ .../service_subscribelocalliveview_fuzzer.h | 24 +++ .../servicesubscribeself_fuzzer/BUILD.gn | 32 ++++ .../servicesubscribeself_fuzzer/corpus/init | 13 ++ .../servicesubscribeself_fuzzer/project.xml | 25 +++ .../service_subscribeself_fuzzer.cpp | 38 +++++ .../service_subscribeself_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ .../service_triggerlocalliveview_fuzzer.cpp | 38 +++++ .../service_triggerlocalliveview_fuzzer.h | 24 +++ .../serviceunsubscribe_fuzzer/BUILD.gn | 32 ++++ .../serviceunsubscribe_fuzzer/corpus/init | 13 ++ .../serviceunsubscribe_fuzzer/project.xml | 25 +++ .../service_unsubscribe_fuzzer.cpp | 38 +++++ .../service_unsubscribe_fuzzer.h | 24 +++ .../BUILD.gn | 32 ++++ .../corpus/init | 13 ++ .../project.xml | 25 +++ ...ce_updatenotificationtimerbyuid_fuzzer.cpp | 38 +++++ ...vice_updatenotificationtimerbyuid_fuzzer.h | 24 +++ .../serviceupdateslots_fuzzer/BUILD.gn | 32 ++++ .../serviceupdateslots_fuzzer/corpus/init | 13 ++ .../serviceupdateslots_fuzzer/project.xml | 25 +++ .../service_updateslots_fuzzer.cpp | 38 +++++ .../service_updateslots_fuzzer.h | 24 +++ 459 files changed, 12276 insertions(+), 132 deletions(-) create mode 100644 test/fuzztest/advancednotificationservice/advancednotificationservice_fuzztest_common.gni create mode 100644 test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/service_adddonotdisturbprofiles_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceadddonotdisturbprofiles_fuzzer/service_adddonotdisturbprofiles_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/service_addslotbytype_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslotbytype_fuzzer/service_addslotbytype_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/service_addslots_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceaddslots_fuzzer/service_addslots_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/service_allowusereminder_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceallowusereminder_fuzzer/service_allowusereminder_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicecancel_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicecancel_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicecancel_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicecancel_fuzzer/service_cancel_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicecancel_fuzzer/service_cancel_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/service_cancelall_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicecancelall_fuzzer/service_cancelall_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/service_cancelasbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundle_fuzzer/service_cancelasbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/service_cancelasbundlewithagent_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicecancelasbundlewithagent_fuzzer/service_cancelasbundlewithagent_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/service_cancelcontinuoustasknotification_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicecancelcontinuoustasknotification_fuzzer/service_cancelcontinuoustasknotification_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicecancelgroup_fuzzer/service_cancelgroup_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/service_canpopenablenotificationdialog_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicecanpopenablenotificationdialog_fuzzer/service_canpopenablenotificationdialog_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicecanpublishasbundle_fuzzer/service_canpublishasbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicedelete_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicedelete_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicedelete_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicedelete_fuzzer/service_delete_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicedelete_fuzzer/service_delete_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/service_deleteallbyuser_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicedeleteallbyuser_fuzzer/service_deleteallbyuser_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/service_deletebybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicedeletebybundle_fuzzer/service_deletebybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/service_disablenotificationfeature_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicedisablenotificationfeature_fuzzer/service_disablenotificationfeature_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/service_distributeoperation_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicedistributeoperation_fuzzer/service_distributeoperation_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/service_enabledistributedbybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceenabledistributedbybundle_fuzzer/service_enabledistributedbybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/service_getactivenotificationbyfilter_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotificationbyfilter_fuzzer/service_getactivenotificationbyfilter_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/service_getactivenotifications_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetactivenotifications_fuzzer/service_getactivenotifications_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/service_getalldistribuedenabledbundles_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetalldistribuedenabledbundles_fuzzer/service_getalldistribuedenabledbundles_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/service_getallliveviewenabledbundles_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetallliveviewenabledbundles_fuzzer/service_getallliveviewenabledbundles_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/service_getallnotificationsbyslottype_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetallnotificationsbyslottype_fuzzer/service_getallnotificationsbyslottype_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/service_getbundleimportance_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetbundleimportance_fuzzer/service_getbundleimportance_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/service_getdeviceremindtype_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetdeviceremindtype_fuzzer/service_getdeviceremindtype_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/service_getdonotdisturbdate_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbdate_fuzzer/service_getdonotdisturbdate_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/service_getdonotdisturbprofile_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetdonotdisturbprofile_fuzzer/service_getdonotdisturbprofile_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslot_fuzzer/service_getenabledforbundleslot_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetenabledforbundleslotself_fuzzer/service_getenabledforbundleslotself_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/service_getnotificationrequestbyhashcode_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetnotificationrequestbyhashcode_fuzzer/service_getnotificationrequestbyhashcode_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/service_getshowbadgeenabledforbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetshowbadgeenabledforbundle_fuzzer/service_getshowbadgeenabledforbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/service_getslotbybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbybundle_fuzzer/service_getslotbybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/service_getslotbytype_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotbytype_fuzzer/service_getslotbytype_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/service_getslotflagsasbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotflagsasbundle_fuzzer/service_getslotflagsasbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/service_getslotnumasbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotnumasbundle_fuzzer/service_getslotnumasbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetslots_fuzzer/service_getslots_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/service_getslotsbybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetslotsbybundle_fuzzer/service_getslotsbybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/service_getspecialactivenotifications_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetspecialactivenotifications_fuzzer/service_getspecialactivenotifications_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/service_getsyncnotificationenabledwithoutapp_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegetsyncnotificationenabledwithoutapp_fuzzer/service_getsyncnotificationenabledwithoutapp_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/service_gettargetdevicestatus_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicegettargetdevicestatus_fuzzer/service_gettargetdevicestatus_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/service_isdistributedenablebybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenablebybundle_fuzzer/service_isdistributedenablebybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/service_isdistributedenabledbybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbybundle_fuzzer/service_isdistributedenabledbybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/service_isdistributedenabledbyslot_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceisdistributedenabledbyslot_fuzzer/service_isdistributedenabledbyslot_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/service_isneedsilentindonotdisturbmode_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceisneedsilentindonotdisturbmode_fuzzer/service_isneedsilentindonotdisturbmode_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/service_issmartreminderenabled_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceissmartreminderenabled_fuzzer/service_issmartreminderenabled_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/service_isspecialbundleallowednotify_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialbundleallowednotify_fuzzer/service_isspecialbundleallowednotify_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/service_isspecialuserallowednotify_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceisspecialuserallowednotify_fuzzer/service_isspecialuserallowednotify_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceissupporttemplate_fuzzer/service_issupporttemplate_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/service_publishasbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundle_fuzzer/service_publishasbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/service_publishasbundlewithmaxcapacity_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicepublishasbundlewithmaxcapacity_fuzzer/service_publishasbundlewithmaxcapacity_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicepublishcontinuoustasknotification_fuzzer/service_publishcontinuoustasknotification_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/service_publishforindirectproxywithmaxcapacity_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicepublishforindirectproxywithmaxcapacity_fuzzer/service_publishforindirectproxywithmaxcapacity_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/service_publishnotificationforindirectproxy_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicepublishnotificationforindirectproxy_fuzzer/service_publishnotificationforindirectproxy_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/service_publishwithmaxcapacity_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicepublishwithmaxcapacity_fuzzer/service_publishwithmaxcapacity_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/service_registerpushcallback_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceregisterpushcallback_fuzzer/service_registerpushcallback_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveallnotifications_fuzzer/service_removeallnotifications_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/service_removedistributednotifications_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedistributednotifications_fuzzer/service_removedistributednotifications_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/service_removedonotdisturbprofiles_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceremovedonotdisturbprofiles_fuzzer/service_removedonotdisturbprofiles_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/service_removegroupbybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceremovegroupbybundle_fuzzer/service_removegroupbybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/service_removenotification_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotification_fuzzer/service_removenotification_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/service_removenotifications_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceremovenotifications_fuzzer/service_removenotifications_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/service_removeslotbytype_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceremoveslotbytype_fuzzer/service_removeslotbytype_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/service_replydistributeoperation_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicereplydistributeoperation_fuzzer/service_replydistributeoperation_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/service_requestenablenotification_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicerequestenablenotification_fuzzer/service_requestenablenotification_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/service_setadditionconfig_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetadditionconfig_fuzzer/service_setadditionconfig_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumber_fuzzer/service_setbadgenumber_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/service_setbadgenumberbybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberbybundle_fuzzer/service_setbadgenumberbybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/service_setbadgenumberfordhbybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetbadgenumberfordhbybundle_fuzzer/service_setbadgenumberfordhbybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/service_setdistributedenabledbybundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbybundle_fuzzer/service_setdistributedenabledbybundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/service_setdistributedenabledbyslot_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetdistributedenabledbyslot_fuzzer/service_setdistributedenabledbyslot_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/service_setdonotdisturbdate_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetdonotdisturbdate_fuzzer/service_setdonotdisturbdate_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/service_setenabledforbundleslot_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetenabledforbundleslot_fuzzer/service_setenabledforbundleslot_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesethashcoderule_fuzzer/service_sethashcoderule_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/service_setnotificationbadgenum_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationbadgenum_fuzzer/service_setnotificationbadgenum_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/service_setnotificationsenabledbyuser_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledbyuser_fuzzer/service_setnotificationsenabledbyuser_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/service_setnotificationsenabledforallbundles_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforallbundles_fuzzer/service_setnotificationsenabledforallbundles_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/service_setnotificationsenabledforbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforbundle_fuzzer/service_setnotificationsenabledforbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/service_setnotificationsenabledforspecialbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetnotificationsenabledforspecialbundle_fuzzer/service_setnotificationsenabledforspecialbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/service_setshowbadgeenabledforbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetshowbadgeenabledforbundle_fuzzer/service_setshowbadgeenabledforbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/service_setslotflagsasbundle_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetslotflagsasbundle_fuzzer/service_setslotflagsasbundle_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/service_setsmartreminderenabled_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetsmartreminderenabled_fuzzer/service_setsmartreminderenabled_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesetsyncnotificationenabledwithoutapp_fuzzer/service_setsyncnotificationenabledwithoutapp_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/service_settargetdevicestatus_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesettargetdevicestatus_fuzzer/service_settargetdevicestatus_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/service_shelldump_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceshelldump_fuzzer/service_shelldump_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/service_subscribe_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribe_fuzzer/service_subscribe_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/service_subscribelocalliveview_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribelocalliveview_fuzzer/service_subscribelocalliveview_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/service_subscribeself_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicesubscribeself_fuzzer/service_subscribeself_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/service_triggerlocalliveview_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/servicetriggerlocalliveview_fuzzer/service_triggerlocalliveview_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceunsubscribe_fuzzer/service_unsubscribe_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/service_updatenotificationtimerbyuid_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceupdatenotificationtimerbyuid_fuzzer/service_updatenotificationtimerbyuid_fuzzer.h create mode 100644 test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/BUILD.gn create mode 100644 test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/corpus/init create mode 100644 test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/project.xml create mode 100644 test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.cpp create mode 100644 test/fuzztest/advancednotificationservice/serviceupdateslots_fuzzer/service_updateslots_fuzzer.h diff --git a/test/fuzztest/advancednotificationservice/BUILD.gn b/test/fuzztest/advancednotificationservice/BUILD.gn index d2ce258a4..544826e87 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 000000000..b0faf95a7 --- /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 000000000..4dc4628e6 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..4e21d92e4 --- /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 000000000..7ab675b5b --- /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 000000000..434900cb1 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e9f337907 --- /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 000000000..821c09e94 --- /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 000000000..0d3f5912b --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..c6e81bdc7 --- /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 000000000..61bf0bfad --- /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 000000000..042e3ef7b --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..5a8bc01e7 --- /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 000000000..067be7b75 --- /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 000000000..9a4da9de6 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..3dace1401 --- /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 000000000..2b4361c1e --- /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 000000000..ef5e11dc2 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e3198ba83 --- /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 000000000..d2f471d7b --- /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 000000000..bd95f631a --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..ddae103e7 --- /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 000000000..16db997cf --- /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 000000000..71c5232d9 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..6e1dab8d7 --- /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 000000000..557b7a385 --- /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 000000000..e0e73ae8c --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..f831c2400 --- /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 000000000..a9d18f38d --- /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 000000000..25a9a6467 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..9e0e85332 --- /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 000000000..03acaa5c9 --- /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 000000000..d36613cab --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..ee5e5168e --- /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 000000000..23bc1a6df --- /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 000000000..9809a8094 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..a14eb0e92 --- /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 000000000..ba14dd71f --- /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 000000000..3c1b479b0 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..f20581c84 --- /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 000000000..b9db3e145 --- /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 000000000..9537b63ca --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..79b8e652a --- /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 000000000..a5dc6584c --- /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 000000000..1794f55ad --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..3c1e1beba --- /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 000000000..3ca9a0419 --- /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 000000000..dbbf05fdf --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..b3c136406 --- /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 000000000..b71bcd186 --- /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 000000000..f9c923edf --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..7e110d46b --- /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 000000000..e908c0eee --- /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 000000000..037385a0b --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..9e8ee7340 --- /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 000000000..92ae7416a --- /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 000000000..3bee6856f --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..9ddf5e7a2 --- /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 000000000..290025e59 --- /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 000000000..5993ad766 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..9ce782576 --- /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 000000000..55670f2b0 --- /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 000000000..a3afe329f --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..effe2d044 --- /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 000000000..4f3a9665c --- /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 000000000..e9911463d --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..d3fd0620d --- /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 000000000..6e6d0fefe --- /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 000000000..01eeb72c1 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..10f2c6df0 --- /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 000000000..0a01b91fc --- /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 000000000..71752c6c8 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..3718993e6 --- /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 000000000..a10702949 --- /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 000000000..a8f2a7338 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..2ba549f41 --- /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 000000000..7785bafa8 --- /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 000000000..97b8f7aea --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..275c98fc8 --- /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 000000000..35c335ea0 --- /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 000000000..181ddf684 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..589fe2098 --- /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 000000000..01b436317 --- /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 000000000..c8aa77cb2 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..9c1a454e4 --- /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 000000000..f5efd9e60 --- /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 000000000..a6734fb67 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e531760e0 --- /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 000000000..8227b08da --- /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 000000000..9d6d8bf0c --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..eb3146dfc --- /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 000000000..3fe498ebe --- /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 000000000..374c9674c --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..27f21b34b --- /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 000000000..fc82cd545 --- /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 000000000..cbec4ab4d --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..91f472ca6 --- /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 000000000..9e047f50c --- /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 000000000..c81944996 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..78e94faeb --- /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 000000000..2d983a905 --- /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 000000000..d07bce0ff --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..f7678c9b4 --- /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 000000000..9e8c906c0 --- /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 000000000..4b0c36317 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..413992351 --- /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 000000000..9cfba785f --- /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 000000000..27fd2cb23 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..27524e679 --- /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 000000000..ef2854289 --- /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 000000000..58731cc0a --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..136a30d5f --- /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 000000000..d919a9356 --- /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 000000000..ad24ee045 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..ff9661159 --- /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 000000000..b8b6dead5 --- /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 000000000..5ebbf78dd --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..216c80c33 --- /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 000000000..86b0860f8 --- /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 000000000..8d6c4b7b7 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..d0c2626b1 --- /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 000000000..b6d4d4a62 --- /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 000000000..5549e2950 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..bf25add01 --- /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 000000000..439fefdd4 --- /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 000000000..0480f7d26 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..88b9f0068 --- /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 000000000..c7019f885 --- /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 000000000..f097369d6 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..7bd99e816 --- /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 000000000..c1a5c4f7e --- /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 000000000..bda7c5b66 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..7dc3a1027 --- /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 000000000..0854e96bc --- /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 000000000..7c1c27390 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..8125f9c26 --- /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 000000000..dbd27885a --- /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 000000000..8291e70b6 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..190c6953a --- /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 000000000..ec805bb4b --- /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 000000000..bc8e0f2ac --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..ac4bd4345 --- /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 000000000..bd0aacc60 --- /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 000000000..e199d5d4a --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..4624afca3 --- /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 000000000..a462c1e1c --- /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 8cd69c98c..854abe6df 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 d6bd04372..a1615447c 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 000000000..a0078d910 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..5554a3043 --- /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 000000000..d8676b107 --- /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 000000000..03798b3e7 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..55b275228 --- /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 000000000..a608535bd --- /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 000000000..c5d7e0e55 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e6c52125a --- /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 000000000..8b1349f85 --- /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 000000000..333149ed2 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..ab9560a53 --- /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 000000000..c6edfd69d --- /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 000000000..b6655181b --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..5aafc6827 --- /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 000000000..c10c33458 --- /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 000000000..deee997c9 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e4b02db21 --- /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 000000000..995266495 --- /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 000000000..4f104af73 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..56f10cdda --- /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 000000000..0b8ee1012 --- /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 000000000..13a93ef98 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e759156ff --- /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 000000000..566da5cd7 --- /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 000000000..04ab055a0 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..9152e6dd5 --- /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 000000000..aee6e9338 --- /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 000000000..cb9469d40 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e8692ec11 --- /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 000000000..7b34246df --- /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 000000000..012d543f1 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..72aa484a5 --- /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 000000000..53e10ac3b --- /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 000000000..db4262fee --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..c66de57b1 --- /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 000000000..e68539447 --- /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 000000000..c85cb7301 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..855b2ecac --- /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 000000000..1374b9887 --- /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 000000000..b35b29f92 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..4564b2a6b --- /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 000000000..76c4cd385 --- /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 000000000..5bf7cfd6e --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..63d4ccdf0 --- /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 000000000..245cd51a0 --- /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 000000000..4903f70cb --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..49d9e41e6 --- /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 000000000..d62aac612 --- /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 000000000..47959412e --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..81d75e4cd --- /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 000000000..c055c7910 --- /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 000000000..0457f23ba --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..1f6c7e0c0 --- /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 000000000..589c82d03 --- /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 000000000..f7a64b3f7 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..a8124318c --- /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 000000000..1f577f50a --- /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 000000000..5788a0611 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..df8ad3cc7 --- /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 000000000..49bb244eb --- /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 000000000..ad91b8f3c --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..466d90492 --- /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 000000000..ed6750734 --- /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 000000000..b5d477651 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..8be81f13c --- /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 000000000..bd0928b25 --- /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 000000000..f080fce9b --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..607e56a4b --- /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 000000000..1dbb94705 --- /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 000000000..d460c3c81 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..2d69fed75 --- /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 000000000..3b6c3ee44 --- /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 000000000..15ec429d8 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..f072f76d9 --- /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 000000000..7f44085f2 --- /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 000000000..578f3604b --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..9dab544e4 --- /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 000000000..b617aa2c5 --- /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 000000000..04e315d60 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..0f8c4f830 --- /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 000000000..eb6138262 --- /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 000000000..2f6faf173 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e4feac67e --- /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 000000000..6d708e656 --- /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 000000000..2b359a488 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e7b0cd253 --- /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 000000000..7c836ece2 --- /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 000000000..e50f1166a --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..cd56aa1b5 --- /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 000000000..244621683 --- /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 000000000..f79f9715c --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..3c1f6ccd6 --- /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 000000000..b13bf4ea8 --- /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 000000000..18283531c --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..dbf0f5a56 --- /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 000000000..3925e0f52 --- /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 000000000..bb7e8cbe1 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..84d14dac4 --- /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 000000000..6264607e9 --- /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 000000000..f94ecc20b --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..461f370a0 --- /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 000000000..9807b345b --- /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 000000000..9ea55bb5a --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..0fdfc728a --- /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 000000000..4ceabc666 --- /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 000000000..aac2a3514 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..02c33df27 --- /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 000000000..f9e7f9544 --- /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 000000000..7409283b6 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..991515ae6 --- /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 000000000..d37757656 --- /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 000000000..12bab0584 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..e6da395d5 --- /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 000000000..73e3903bf --- /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 000000000..cfea9a13f --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..3b6f9baee --- /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 000000000..f6b29a302 --- /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 000000000..169321972 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..f2271c6a8 --- /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 000000000..30095113e --- /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 000000000..570911011 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..f9ed56c04 --- /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 000000000..d85e77f89 --- /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 000000000..48db1e51f --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..265809119 --- /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 000000000..15a202421 --- /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 000000000..801db3894 --- /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 000000000..d9719cafa --- /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 000000000..226522bd2 --- /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 000000000..098266716 --- /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 000000000..44dca2a47 --- /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 -- Gitee