From 11a3483b6497ff8e722647ab5778f4a83e46e460 Mon Sep 17 00:00:00 2001 From: hobbycao Date: Mon, 15 Apr 2024 14:22:14 +0800 Subject: [PATCH] add fuzz trigger Signed-off-by: hobbycao --- .../fileaccessextconnection_fuzzer.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/fuzztest/fileaccessextconnection_fuzzer/fileaccessextconnection_fuzzer.cpp b/test/fuzztest/fileaccessextconnection_fuzzer/fileaccessextconnection_fuzzer.cpp index bf2a97c0..d7a29ad0 100644 --- a/test/fuzztest/fileaccessextconnection_fuzzer/fileaccessextconnection_fuzzer.cpp +++ b/test/fuzztest/fileaccessextconnection_fuzzer/fileaccessextconnection_fuzzer.cpp @@ -52,3 +52,19 @@ bool GetFileExtProxyFuzzTest(shared_ptr conn) } } // namespace OHOS + +/* Fuzzer entry point */ +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + auto conn = std::make_shared(); + if (conn == nullptr) { + return 0; + } + + OHOS::OnAbilityConnectDoneFuzzTest(conn); + OHOS::OnAbilityDisconnectDoneFuzzTest(conn); + OHOS::IsExtAbilityConnectedFuzzTest(conn); + OHOS::GetFileExtProxyFuzzTest(conn); + + return 0; +} -- Gitee