From 6f6c7822ecd76ad2524ca5ca9d80b48d6cfeda29 Mon Sep 17 00:00:00 2001 From: zhupu1122 Date: Sat, 19 Jul 2025 15:53:58 +0800 Subject: [PATCH] optimized unit test Signed-off-by: zhupu1122 --- test/unittest/dump_catcher/dumpcatcher_interfaces_test.cpp | 2 +- tools/crasher_cpp/dfx_crasher.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/unittest/dump_catcher/dumpcatcher_interfaces_test.cpp b/test/unittest/dump_catcher/dumpcatcher_interfaces_test.cpp index 61727796c..5f129d1f6 100644 --- a/test/unittest/dump_catcher/dumpcatcher_interfaces_test.cpp +++ b/test/unittest/dump_catcher/dumpcatcher_interfaces_test.cpp @@ -1156,7 +1156,7 @@ HWTEST_F(DumpCatcherInterfacesTest, DumpCatcherInterfacesTest043, TestSize.Level } const int checkCnt = 500; // 500 : check processdump start in 500ms const int waitForkPidStartTime = 50; // 50 : 50ms - const int hungUpProcessdumpTime = 2900; // 2900 : 2.9s + const int hungUpProcessdumpTime = 2880; // 2880 : 2.88s int timeStart = static_cast(GetAbsTimeMilliSeconds()); pid_t pidCheck = fork(); if (pidCheck < 0) { diff --git a/tools/crasher_cpp/dfx_crasher.cpp b/tools/crasher_cpp/dfx_crasher.cpp index f609f16d9..6a4a1e950 100644 --- a/tools/crasher_cpp/dfx_crasher.cpp +++ b/tools/crasher_cpp/dfx_crasher.cpp @@ -334,11 +334,9 @@ NOINLINE int DfxCrasher::MaxMethodNameTest12345678901234567890123456789012345678 return 0; } -static void *DoStackOverflow(void * inputArg) +static void *DoStackOverflow(void * inputArg) __attribute__((optnone)) { int b[10] = {1}; - int *c = nullptr; - (void)memcpy_s(c, sizeof(int), b, sizeof(int)); if (b[0] == 0) { return static_cast(b + 9); // 9: last element of array } -- Gitee