From d9ee728499f876e6b23888824662bd1615e6d026 Mon Sep 17 00:00:00 2001 From: ZLJUN Date: Fri, 2 Aug 2024 15:07:41 +0800 Subject: [PATCH] =?UTF-8?q?RSCommonToolsFuzzTest=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ZLJUN --- .../rscommontools_fuzzer.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/rosen/test/render_service/render_service_base/fuzztest/rscommontools_fuzzer/rscommontools_fuzzer.cpp b/rosen/test/render_service/render_service_base/fuzztest/rscommontools_fuzzer/rscommontools_fuzzer.cpp index 7dc0c37d18..95698c22e8 100755 --- a/rosen/test/render_service/render_service_base/fuzztest/rscommontools_fuzzer/rscommontools_fuzzer.cpp +++ b/rosen/test/render_service/render_service_base/fuzztest/rscommontools_fuzzer/rscommontools_fuzzer.cpp @@ -68,10 +68,20 @@ bool DoSavePixelmapToFile(const uint8_t* data, size_t size) opts.size.width = g_iSize; opts.size.height = g_iSize; opts.editable = true; - auto pixelMap = Media::PixelMap::Create(opts); - auto shpPixelMap = std::shared_ptr(pixelMap.release()); - std::string dst = ""; - CommonTools::SavePixelmapToFile(shpPixelMap, dst); + return true; +} +bool DoGetLocalTime(const uint8_t* data, size_t size) +{ + if (data == nullptr) { + return false; + } + + // initialize + g_data = data; + g_size = size; + g_pos = 0; + + CommonTools::GetLocalTime(); return true; } @@ -83,5 +93,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Run your code on data */ OHOS::Rosen::DoSavePixelmapToFile(data, size); // SavePixelmapToFile + OHOS::Rosen::DoGetLocalTime(data, size); // GetLocalTime return 0; } \ No newline at end of file