From 4e197c122566883856ac75b49f2e8042681bf9bf Mon Sep 17 00:00:00 2001 From: ganchuantao Date: Tue, 22 Oct 2024 11:21:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0param=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ganchuantao Change-Id: I369744d8dfc1e5ba28a2b41db3facac90e76c9ab --- frameworks/native/hichecker.cpp | 2 +- .../common/native/hichecker_native_test.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/frameworks/native/hichecker.cpp b/frameworks/native/hichecker.cpp index 0858436..8a32226 100644 --- a/frameworks/native/hichecker.cpp +++ b/frameworks/native/hichecker.cpp @@ -250,7 +250,7 @@ void HiChecker::InitHicheckerParam(const char *processName) HILOG_ERROR(LOG_CORE, "not allowed param."); return; } - AddRule(rule); + AddRule(rule & ALLOWED_RULE); return; } } // HiviewDFX diff --git a/test/unittest/common/native/hichecker_native_test.cpp b/test/unittest/common/native/hichecker_native_test.cpp index 4840519..8bd144d 100644 --- a/test/unittest/common/native/hichecker_native_test.cpp +++ b/test/unittest/common/native/hichecker_native_test.cpp @@ -396,6 +396,19 @@ HWTEST_F(HiCheckerNativeTest, InitHicheckerParamTest003, TestSize.Level1) ASSERT_FALSE(HiChecker::Contains(Rule::RULE_CHECK_ARKUI_PERFORMANCE)); } +/** + * @tc.name: InitHicheckerParamTest004 + * @tc.desc: test InitHicheckerParam + * @tc.type: FUNC +*/ +HWTEST_F(HiCheckerNativeTest, InitHicheckerParamTest004, TestSize.Level1) +{ + system("param set hiviewdfx.hichecker.checker_test 1024"); + const char *processName = "checker_test"; + HiChecker::InitHicheckerParam(processName); + ASSERT_FALSE(HiChecker::Contains(Rule::RULE_CHECK_ARKUI_PERFORMANCE)); +} + /** * @tc.name: HicheckerRomTest001 * @tc.desc: test hichecker rom -- Gitee