From dd8f2ec41090bd4580243572ffeb9a5d2d3927d6 Mon Sep 17 00:00:00 2001 From: wujiqin Date: Fri, 11 Nov 2022 17:13:44 +0800 Subject: [PATCH] =?UTF-8?q?IssueNo:IssueNo:https://gitee.com/openharmony/n?= =?UTF-8?q?otification=5Fdistributed=5Fnotification=5Fservice/issues/I60KB?= =?UTF-8?q?Q=3Ffrom=3Dproject-issue=20Description:fuzz=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Sig:SIG=5FApplicationFramework=20Feature?= =?UTF-8?q?=20or=20Bugfix:Bugfix=20Binary=20Source:=20No=20Description:?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E9=80=9A=E7=9F=A5fuzz=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E7=8E=87=E6=8F=90=E5=8D=8702=20Sig:SIG=5FApplicationFramework?= =?UTF-8?q?=20Feature=20or=20Bugfix:Bugfix=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wujiqin Change-Id: I4e2f99a201c0484b23efcab5be79b323164d3a67 --- .../filedescriptorlistener_fuzzer.cpp | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/test/fuzztest/filedescriptorlistener_fuzzer/filedescriptorlistener_fuzzer.cpp b/test/fuzztest/filedescriptorlistener_fuzzer/filedescriptorlistener_fuzzer.cpp index 5c07156..fe9e125 100644 --- a/test/fuzztest/filedescriptorlistener_fuzzer/filedescriptorlistener_fuzzer.cpp +++ b/test/fuzztest/filedescriptorlistener_fuzzer/filedescriptorlistener_fuzzer.cpp @@ -13,7 +13,11 @@ * limitations under the License. */ +#define private public +#define protected public #include "file_descriptor_listener.h" +#undef private +#undef protected #include "filedescriptorlistener_fuzzer.h" #include "securec.h" @@ -21,26 +25,10 @@ namespace OHOS { namespace { constexpr size_t U32_AT_SIZE = 4; } - -class MyFileDescriptorListener : public AppExecFwk::FileDescriptorListener { -public: - MyFileDescriptorListener() = default; - virtual ~MyFileDescriptorListener() - {}; - void OnReadable(int32_t fileDescriptor) override - {} - void OnWritable(int32_t fileDescriptor) override - {} - void OnShutdown(int32_t fileDescriptor) override - {} - void OnException(int32_t fileDescriptor) override - {} -}; - bool DoSomethingInterestingWithMyAPI(const char* data, size_t size) { int32_t fileDescriptor = U32_AT(reinterpret_cast(data)); - auto listener = std::make_shared(); + auto listener = std::make_shared(); listener -> OnReadable(fileDescriptor); listener -> OnWritable(fileDescriptor); listener -> OnShutdown(fileDescriptor); -- Gitee