1 /*
2 * Copyright (c) 2020-2021 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 "hctest.h"
17
18 /**
19 * @tc.name: register a test suite named "StringTestSuite"
20 * @param: test subsystem name
21 * @param: example module name
22 * @param: StringTestSuite test suit name
23 */
24 LITE_TEST_SUIT(test, example, StringTestSuite);
25
26 /**
27 * @tc.setup: define a setup for test suite, format:"StringTestSuite + SetUp"
28 * @return: true——setup success
29 */
StringTestSuiteSetUp()30 static BOOL StringTestSuiteSetUp()
31 {
32 LiteTestPrint("test_demo2 setup\n");
33 return TRUE;
34 }
35
36 /**
37 * @tc.teardown: define a setup for test suite, format:"StringTestSuite + TearDown"
38 * @return: true——teardown success
39 */
StringTestSuiteTearDown()40 static BOOL StringTestSuiteTearDown()
41 {
42 LiteTestPrint("test_demo2 tearDown\n");
43 return TRUE;
44 }
45
46 /**
47 * @tc.number : Test_Case_300
48 * @tc.name : Verify string check function
49 * @tc.desc : [C- SOFTWARE -0200]
50 */
51 LITE_TEST_CASE(StringTestSuite, TestCase003, Function | MediumTest | Level1)
52 {
53 const char* value = "testing";
54 TEST_ASSERT_EQUAL_STRING(value, "testing1");
55 };
56
57 /**
58 * @tc.number : Test_Case_400
59 * @tc.name : Verify string check function
60 * @tc.desc : [C- SOFTWARE -0200]
61 */
62 LITE_TEST_CASE(StringTestSuite, TestCase004, Function | MediumTest | Level2)
63 {
64 const char* value = "testing";
65 TEST_ASSERT_EQUAL_STRING(value, "testing");
66 };
67
68 RUN_TEST_SUITE(StringTestSuite);