File tree Expand file tree Collapse file tree 2 files changed +8
-24
lines changed Expand file tree Collapse file tree 2 files changed +8
-24
lines changed Original file line number Diff line number Diff line change @@ -35,34 +35,16 @@ class TestWatchdog : public testing::Test {
35
35
};
36
36
// *INDENT-ON*
37
37
38
- TEST_F (TestWatchdog, test_watchdog_start_pass)
39
- {
40
- EXPECT_TRUE (Watchdog::get_instance ().start ());
41
- }
42
-
43
- TEST_F (TestWatchdog, test_watchdog_start_fail)
44
- {
45
- EXPECT_FALSE (Watchdog::get_instance ().start ());
46
- }
47
-
48
- TEST_F (TestWatchdog, test_watchdog_stop_pass)
38
+ TEST_F (TestWatchdog, test_watchdog_start_stop_get_timeout)
49
39
{
40
+ EXPECT_TRUE (Watchdog::get_instance ().start (500 ));
41
+ EXPECT_FALSE (Watchdog::get_instance ().start (2000 ));
50
42
EXPECT_TRUE (Watchdog::get_instance ().stop ());
51
- }
52
-
53
- TEST_F (TestWatchdog, test_watchdog_stop_fail)
54
- {
55
43
EXPECT_FALSE (Watchdog::get_instance ().stop ());
44
+ EXPECT_EQ (500 , Watchdog::get_instance ().get_timeout ());
56
45
}
57
46
58
47
TEST_F (TestWatchdog, test_watchdog_get_max_timeout)
59
48
{
60
49
EXPECT_EQ (0xFFFFFFFF , Watchdog::get_instance ().get_max_timeout ());
61
50
}
62
-
63
-
64
- TEST_F (TestWatchdog, test_watchdog_get_timeout)
65
- {
66
- EXPECT_EQ (Watchdog::watchdog_timeout, Watchdog::get_instance ().get_timeout ());
67
- }
68
-
Original file line number Diff line number Diff line change 17
17
18
18
#if DEVICE_WATCHDOG
19
19
20
+ static uint32_t _timeout = 0 ;
21
+
20
22
watchdog_status_t hal_watchdog_init (const watchdog_config_t * config )
21
23
{
24
+ _timeout = config -> timeout_ms ;
22
25
return WATCHDOG_STATUS_OK ;
23
26
}
24
27
@@ -34,10 +37,9 @@ watchdog_status_t hal_watchdog_stop(void)
34
37
35
38
uint32_t hal_watchdog_get_reload_value (void )
36
39
{
37
- return ( 500 ) ;
40
+ return _timeout ;
38
41
}
39
42
40
-
41
43
watchdog_features_t hal_watchdog_get_platform_features (void )
42
44
{
43
45
watchdog_features_t features ;
You can’t perform that action at this time.
0 commit comments