1 /*
2 * Copyright (c) 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 #include "iot_errno.h"
18 #include "iot_watchdog.h"
19
20 void (*g_watchDogfunc)(void);
21
22 /**
23 * @tc.desc : register a test suite, this suite is used to test basic flow and interface dependency
24 * @param : subsystem name is wifiiot
25 * @param : module name is wifiiotlite
26 * @param : test suit name is UtilsFileFuncTestSuite
27 */
28 LITE_TEST_SUIT(wifiiot, wifiiotlite, IotWatchDogTestSuite);
29
30 /**
31 * @tc.setup : setup for all testcases
32 * @return : setup result, TRUE is success, FALSE is fail
33 */
IotWatchDogTestSuiteSetUp(void)34 static BOOL IotWatchDogTestSuiteSetUp(void)
35 {
36 return TRUE;
37 }
38
39 /**
40 * @tc.teardown : teardown for all testcases
41 * @return : teardown result, TRUE is success, FALSE is fail
42 */
IotWatchDogTestSuiteTearDown(void)43 static BOOL IotWatchDogTestSuiteTearDown(void)
44 {
45 printf("+-------------------------------------------+\n");
46 return TRUE;
47 }
48
49 /**
50 * @tc.number : SUB_UTILS_WIFIIOT_API_6000
51 * @tc.name : UART operation with IoTWatchDogEnable
52 * @tc.desc : [C- SOFTWARE -0200]
53 */
54 LITE_TEST_CASE(IotWatchDogTestSuite, testIotWatchDog001, Function | MediumTest | Level1)
55 {
56 g_watchDogfunc = IoTWatchDogEnable;
57 };
58
59 /**
60 * @tc.number : SUB_UTILS_WIFIIOT_API_6100
61 * @tc.name : UART operation with IoTWatchDogKick
62 * @tc.desc : [C- SOFTWARE -0200]
63 */
64 LITE_TEST_CASE(IotWatchDogTestSuite, testIotWatchDog002, Function | MediumTest | Level1)
65 {
66 g_watchDogfunc = IoTWatchDogKick;
67 };
68
69 /**
70 * @tc.number : SUB_UTILS_WIFIIOT_API_6200
71 * @tc.name : UART operation with IoTWatchDogDisable
72 * @tc.desc : [C- SOFTWARE -0200]
73 */
74 LITE_TEST_CASE(IotWatchDogTestSuite, testIotWatchDog003, Function | MediumTest | Level1)
75 {
76 g_watchDogfunc = IoTWatchDogDisable;
77 };
78
79 RUN_TEST_SUITE(IotWatchDogTestSuite);
80
81