• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 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 "test_framework.h"
17 #include "calc_multi.h"
18 
19 /**
20  * @tc.register: register a test suit named "CalcMultiTest"
21  * @param: test subsystem name
22  * @param: c_example module name
23  * @param: CalcMultiTest test suit name
24  */
25 LITE_TEST_SUIT(test, c_example, CalcMultiTest);
26 
27 /**
28  * @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
29  * @return: true——setup success
30  */
CalcMultiTestSetUp()31 static BOOL CalcMultiTestSetUp()
32 {
33     LiteTestPrint("setup\n");
34     return TRUE;
35 }
36 
37 /**
38  * @tc.teardown: define a setup for test suit, format:"CalcMultiTest + TearDown"
39  * @return: true——teardown success
40  */
CalcMultiTestTearDown()41 static BOOL CalcMultiTestTearDown()
42 {
43     LiteTestPrint("tearDown\n");
44     return TRUE;
45 }
46 
47 /**
48  * @tc.name: calcMultiTest001
49  * @tc.desc: Verify calc_multi function, not equal.
50  * @tc.type: FUNC
51  * @tc.require: require id
52  * @tc.author: xxx
53  */
LITE_TEST_CASE(CalcMultiTest,calcMultiTest001,Level1)54 LITE_TEST_CASE(CalcMultiTest, calcMultiTest001, Level1)
55 {
56     TEST_ASSERT_EQUAL_INT(2, calc_multi(2, 2));
57 };
58 
59 /**
60  * @tc.name: calcMultiTest002
61  * @tc.desc: Verify calc_multi function, equal.
62  * @tc.type: FUNC
63  * @tc.require: require id
64  * @tc.author: xxx
65  */
LITE_TEST_CASE(CalcMultiTest,calcMultiTest002,Level1)66 LITE_TEST_CASE(CalcMultiTest, calcMultiTest002, Level1)
67 {
68     TEST_ASSERT_EQUAL_INT(2, calc_multi(2, 1));
69 };