• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 #include "cm_log.h"
19 
20 using namespace testing::ext;
21 namespace {
22 class CmLogTest : public testing::Test {
23 public:
24     static void SetUpTestCase(void);
25 
26     static void TearDownTestCase(void);
27 
28     void SetUp();
29 
30     void TearDown();
31 };
32 
SetUpTestCase(void)33 void CmLogTest::SetUpTestCase(void)
34 {
35 }
36 
TearDownTestCase(void)37 void CmLogTest::TearDownTestCase(void)
38 {
39 }
40 
SetUp()41 void CmLogTest::SetUp()
42 {
43 }
44 
TearDown()45 void CmLogTest::TearDown()
46 {
47 }
48 
49 /**
50 * @tc.name: CmLogTest001
51 * @tc.desc: Test Log Warn
52 * @tc.type: FUNC
53 * @tc.require: AR000H0MIA /SR000H09NA
54 */
55 HWTEST_F(CmLogTest, CmLogTest001, TestSize.Level0)
56 {
57     CM_LOG_W("this is test for log");
58 }
59 
60 /**
61 * @tc.name: CmLogTest002
62 * @tc.desc: Test Log ID INVALID
63 * @tc.type: FUNC
64 * @tc.require: AR000H0MIA /SR000H09NA
65 */
66 HWTEST_F(CmLogTest, CmLogTest002, TestSize.Level0)
67 {
68     CmLog(CM_LOG_LEVEL_D + 1, __func__, __LINE__, "this is test for default branch");
69 }
70 
71 /**
72 * @tc.name: CmLogTest003
73 * @tc.desc: Test Log info length more than 512
74 * @tc.type: FUNC
75 * @tc.require: AR000H0MIA /SR000H09NA
76 */
77 HWTEST_F(CmLogTest, CmLogTest003, TestSize.Level0)
78 {
79     CM_LOG_W("MoreThan512Bytes................................................"
80         "................................................................"
81         "................................................................"
82         "................................................................"
83         "................................................................"
84         "................................................................"
85         "................................................................"
86         "..................................................................");
87 }
88 } // end of namespace
89