From 480e151c5437d732fd90af91233b52936b6857f9 Mon Sep 17 00:00:00 2001 From: "liuyanzhi3@huawei.com" Date: Fri, 11 Nov 2022 08:00:14 +0800 Subject: [PATCH] fix fuzz test Signed-off-by: liuyanzhi3@huawei.com Change-Id: Idad2ba770e167430d0d51a3323f61a379e8c09f5 --- .../notificationconversationalcontent_fuzzer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/fuzztest/notificationconversationalcontent_fuzzer/notificationconversationalcontent_fuzzer.cpp b/test/fuzztest/notificationconversationalcontent_fuzzer/notificationconversationalcontent_fuzzer.cpp index d84384286..1139f3189 100644 --- a/test/fuzztest/notificationconversationalcontent_fuzzer/notificationconversationalcontent_fuzzer.cpp +++ b/test/fuzztest/notificationconversationalcontent_fuzzer/notificationconversationalcontent_fuzzer.cpp @@ -20,6 +20,7 @@ #undef protected #include "notificationconversationalcontent_fuzzer.h" +#define DISABLE_FUZZ namespace OHOS { namespace { constexpr uint8_t ENABLE = 2; @@ -54,7 +55,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) /* Run your code on data */ char *ch = ParseData(data, size); if (ch != nullptr && size >= GetU32Size()) { +#ifndef DISABLE_FUZZ OHOS::DoSomethingInterestingWithMyAPI(ch, size); +#endif free(ch); ch = nullptr; } -- Gitee