Mistake on this page?
Report an issue in GitHub or email us
Watchdog_tests.h
1 /*
2  * Copyright (c) 2018-2019 Arm Limited and affiliates.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef MBED_DRIVERS_WATCHDOG_TESTS_H
19 #define MBED_DRIVERS_WATCHDOG_TESTS_H
20 
21 #if DEVICE_WATCHDOG
22 
23 /** Test Watchdog max_timeout validity
24  *
25  * Given a device supporting Watchdog driver API,
26  * when @a Watchdog::get_max_timeout() is called,
27  * then the returned value is greater than 1.
28  */
30 
31 /** Test Watchdog stop
32  *
33  * Given a device without a support for the @a disable_watchdog feature,
34  * when @a Watchdog::stop() is called,
35  * then false is returned.
36  *
37  * Otherwise, given the device with @a disable_watchdog feature support:
38  *
39  * Given the Watchdog is *NOT* running,
40  * when @a Watchdog::stop() is called,
41  * then false is returned.
42  *
43  * Given the Watchdog is running,
44  * when @a Watchdog::stop() is called before the timeout expires,
45  * then true is returned and the device is not restarted.
46  *
47  * Given the Watchdog is *NOT* running (it has already been stopped),
48  * when @a Watchdog::stop() is called,
49  * then false is returned.
50  */
51 void test_stop();
52 
53 /** Test Watchdog start multiple times
54  *
55  * Given a set of unique timeout values,
56  * when Watchdog::start(T) is called for each value T,
57  * then, for every T, Watchdog::start() returns true
58  * and Watchdog::get_timeout() returns an actual timeout value R
59  * and T <= R < 2 * T.
60  */
61 void test_restart();
62 
63 /** Test Watchdog start with a valid config
64  *
65  * Given a value of T ms which is within supported Watchdog timeout range,
66  * when Watchdog::start(T) is called,
67  * then true is returned
68  * and Watchdog::get_timeout() returns an actual timeout value R
69  * and T <= R < 2 * T.
70  */
71 template<uint32_t timeout_ms>
72 void test_start();
73 
74 /** Test Watchdog start with max_timeout
75  *
76  * Given max_timeout value returned by @a Watchdog::get_max_timeout(),
77  * when @a Watchdog::start(max_timeout) is called,
78  * then true is returned
79  * and @a Watchdog::get_timeout() returns max_timeout.
80  */
81 void test_start_max_timeout();
82 
83 #endif
84 
85 #endif
void test_stop()
Test Watchdog stop.
void test_max_timeout_is_valid()
Test max_timeout validity.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.