1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <gtest/gtest.h>
17 
18 #define private public
19 #define protected public
20 #include "want_agent_log_wrapper.h"
21 #undef private
22 #undef protected
23 
24 using namespace testing::ext;
25 using namespace OHOS::AbilityRuntime::WantAgent;
26 
27 namespace OHOS::AbilityRuntime::WantAgent {
28 class WantAgentLogWrapperTest : public testing::Test {
29 public:
WantAgentLogWrapperTest()30     WantAgentLogWrapperTest()
31     {}
~WantAgentLogWrapperTest()32     ~WantAgentLogWrapperTest()
33     {}
34     static void SetUpTestCase(void);
35     static void TearDownTestCase(void);
36     void SetUp();
37     void TearDown();
38 };
39 
SetUpTestCase(void)40 void WantAgentLogWrapperTest::SetUpTestCase(void)
41 {}
42 
TearDownTestCase(void)43 void WantAgentLogWrapperTest::TearDownTestCase(void)
44 {}
45 
SetUp(void)46 void WantAgentLogWrapperTest::SetUp(void)
47 {}
48 
TearDown(void)49 void WantAgentLogWrapperTest::TearDown(void)
50 {}
51 
52 /*
53  * @tc.number    : SetLogLevel_0100
54  * @tc.name      : SetLogLevel
55  * @tc.desc      : Test SetLogLevel
56  */
57 HWTEST_F(WantAgentLogWrapperTest, SetLogLevel_0100, Function | MediumTest | Level1)
58 {
59     WantAgentLogLevel level = WantAgentLogLevel::ERROR;
60     WantAgentLogWrapper::SetLogLevel(level);
61     EXPECT_EQ(WantAgentLogWrapper::GetLogLevel(), level);
62 }
63 
64 }  // namespace OHOS::AbilityRuntime::WantAgent
65