From dd45ea7e7042952a4f9cfc2ee25131357c780823 Mon Sep 17 00:00:00 2001 From: zhangjian22 Date: Fri, 11 Nov 2022 17:23:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8E=A5=E5=8F=A3=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B=20Signed-off-by:=20=E5=BC=A0?= =?UTF-8?q?=E5=BB=BA=20=20#I60QR8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/native/hichecker_native_test.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/unittest/common/native/hichecker_native_test.cpp b/test/unittest/common/native/hichecker_native_test.cpp index 643d425..89a8089 100644 --- a/test/unittest/common/native/hichecker_native_test.cpp +++ b/test/unittest/common/native/hichecker_native_test.cpp @@ -16,6 +16,7 @@ #include #include +#include "caution.h" #include "hichecker.h" using namespace testing::ext; @@ -211,4 +212,19 @@ HWTEST_F(HiCheckerNativeTest, ContainsTest002, TestSize.Level1) ASSERT_FALSE(HiChecker::Contains(RULE_ERROR0)); ASSERT_FALSE(HiChecker::Contains(RULE_ERROR1)); ASSERT_FALSE(HiChecker::Contains(RULE_ERROR2)); +} + +/** + * @tc.name: CautionTest001 + * @tc.desc: test Caution + * @tc.type: FUNC +*/ +HWTEST(HiCheckerNativeTest, CautionTest001, TestSize.Level1) +{ + Caution caution; + caution.SetTriggerRule(Rule::RULE_CAUTION_PRINT_LOG); + EXPECT_EQ(caution.GetTriggerRule(), Rule::RULE_CAUTION_PRINT_LOG); + + caution.SetStackTrace("stack_trace"); + EXPECT_EQ(caution.GetStackTrace(), "stack_trace"); } \ No newline at end of file -- Gitee