Skip to content

Commit 105b0ab

Browse files
mprsebulislaw
authored andcommitted
HAL rtc test: check only if rtc_isenabled() returns 1 in case when init is done.
Since some platforms use RTC for low power timer RTC may be already enabled. Because of that we will only verify if rtc_isenabled() returns 1 in case when init is done and RTC time is set.
1 parent c93ab16 commit 105b0ab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

TESTS/mbed_hal/rtc/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,15 @@ void rtc_write_read_test()
217217
rtc_free();
218218
}
219219

220-
/* Test that ::is_enabled function returns 1 if the RTC is counting and the time has been set, 0 otherwise. */
220+
/* Test that ::is_enabled function returns 1 if the RTC is counting and the time has been set. */
221221
void rtc_enabled_test()
222222
{
223+
/* Since some platforms use RTC for low power timer RTC may be already enabled.
224+
* Because of that we will only verify if rtc_isenabled() returns 1 in case when init is done
225+
* and RTC time is set.
226+
*/
227+
223228
rtc_init();
224-
TEST_ASSERT_EQUAL_INT(0, rtc_isenabled());
225229
rtc_write(0);
226230
TEST_ASSERT_EQUAL_INT(1, rtc_isenabled());
227231
rtc_free();

0 commit comments

Comments
 (0)