From 0a7e4fa5cee7dcb6ce060bef37d4eae5e6f06503 Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Sun, 27 Sep 2015 13:18:12 +0200 Subject: [PATCH] tests/wipy: Improve robustness of rtc_irq test. --- tests/wipy/rtc.py | 2 ++ tests/wipy/rtc_irq.py | 6 +++--- tests/wipy/rtc_irq.py.exp | 7 ------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/wipy/rtc.py b/tests/wipy/rtc.py index 9f4a0f673e..ca6a34267f 100644 --- a/tests/wipy/rtc.py +++ b/tests/wipy/rtc.py @@ -82,6 +82,8 @@ rtc.alarm(time=(2015, 8, 29, 9, 0, 45)) time.sleep_ms(1000) left = rtc.alarm_left() print(abs(left-44000) <= 90) +rtc.alarm_cancel() +rtc.deinit() # next ones must raise try: diff --git a/tests/wipy/rtc_irq.py b/tests/wipy/rtc_irq.py index 1c9ea93f1d..2d4eaacabf 100644 --- a/tests/wipy/rtc_irq.py +++ b/tests/wipy/rtc_irq.py @@ -69,13 +69,13 @@ print(abs(t1 - t0 - 500) < 20) # deep sleep repeated mode rtc.alarm_cancel() rtc_irq_count = 0 -rtc.alarm(time=250, repeat=True) +rtc.alarm(time=500, repeat=True) t0 = rtc_ticks_ms(rtc) rtc_irq = rtc.irq(trigger=RTC.ALARM0, handler=alarm_handler, wake=Sleep.SUSPENDED) -while rtc_irq_count < 10: +while rtc_irq_count < 3: Sleep.suspend() t1 = rtc_ticks_ms(rtc) - print(abs(t1 - t0 - (250 * rtc_irq_count)) < 25) + print(abs(t1 - t0 - (500 * rtc_irq_count)) < 25) # next ones must raise try: diff --git a/tests/wipy/rtc_irq.py.exp b/tests/wipy/rtc_irq.py.exp index a9ef48c7a7..a3eebc2d11 100644 --- a/tests/wipy/rtc_irq.py.exp +++ b/tests/wipy/rtc_irq.py.exp @@ -7,12 +7,5 @@ True True True True -True -True -True -True -True -True -True Exception Exception