From c4fd91dc725277922d1fed75cc88c20e4f26c78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E5=87=AF=E6=98=8E?= Date: Thu, 25 Jul 2024 08:51:10 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9UT=E7=94=A8=E4=BE=8B=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E8=A6=86=E7=9B=96=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 谢凯明 --- test/unittest/config_policy_utils_test.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/unittest/config_policy_utils_test.cpp b/test/unittest/config_policy_utils_test.cpp index 8c1878c..d7cba83 100644 --- a/test/unittest/config_policy_utils_test.cpp +++ b/test/unittest/config_policy_utils_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -39,8 +39,6 @@ void ConfigPolicyUtilsTest::SetUpTestCase(void) { SystemSetParameter(CUST_OPKEY0, "46060"); SystemSetParameter(CUST_OPKEY1, "46061"); - SystemSetParameter(CUST_FOLLOW_X_RULES, - ":etc/custxmltest/user.xml,10:etc/custxmltest/both.xml,100,etc/carrier/${test:-46061}"); } #endif @@ -182,8 +180,16 @@ HWTEST_F(ConfigPolicyUtilsTest, CfgPolicyUtilsFuncTest008, TestSize.Level1) */ HWTEST_F(ConfigPolicyUtilsTest, CfgPolicyUtilsFuncTest009, TestSize.Level1) { - EXPECT_TRUE(TestGetCfgFile("etc/custxmltest/user.xml", FOLLOWX_MODE_DEFAULT, NULL)); - EXPECT_TRUE(TestGetCfgFile("etc/custxmltest/both.xml", FOLLOWX_MODE_DEFAULT, NULL)); + int ret = SystemSetParameter(CUST_FOLLOW_X_RULES, + ":etc/custxmltest/user.xml,10:etc/custxmltest/both.xml,100,etc/carrier/${test:-46061}"); + if (ret == 0) { + std::cout << "set " << CUST_FOLLOW_X_RULES << " success." << std::endl; + EXPECT_TRUE(TestGetCfgFile("etc/custxmltest/user.xml", FOLLOWX_MODE_DEFAULT, NULL)); + EXPECT_TRUE(TestGetCfgFile("etc/custxmltest/both.xml", FOLLOWX_MODE_DEFAULT, NULL)); + } else { + std::cout << "set " << CUST_FOLLOW_X_RULES << " failed, use OpkeyInfo.json for test." << std::endl; + EXPECT_TRUE(TestGetCfgFile("etc/telephony/OpkeyInfo.json", FOLLOWX_MODE_DEFAULT, NULL)); + } } /** -- Gitee