From e3d11b6a6e101b55aae5907539a3a8d9fd432721 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 4 Mar 2018 00:17:33 +1100 Subject: [PATCH] tests/extmod/time_ms_us: Add test for calling ticks_cpu(). This is just to test that the function exists and returns some kind of valid value. Although this file is for testing ms/us functions, put the ticks_cpu() test here so not to add a new test file. --- tests/extmod/time_ms_us.py | 3 +++ tests/extmod/time_ms_us.py.exp | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/extmod/time_ms_us.py b/tests/extmod/time_ms_us.py index 31f07d31ba..4d0287da31 100644 --- a/tests/extmod/time_ms_us.py +++ b/tests/extmod/time_ms_us.py @@ -9,3 +9,6 @@ utime.sleep_ms(1) utime.sleep_us(1) print(utime.ticks_diff(utime.ticks_ms(), utime.ticks_ms()) <= 1) print(utime.ticks_diff(utime.ticks_us(), utime.ticks_us()) <= 500) + +# ticks_cpu may not be implemented, at least make sure it doesn't decrease +print(utime.ticks_diff(utime.ticks_cpu(), utime.ticks_cpu()) >= 0) diff --git a/tests/extmod/time_ms_us.py.exp b/tests/extmod/time_ms_us.py.exp index dbde422651..b8ca7e7ef0 100644 --- a/tests/extmod/time_ms_us.py.exp +++ b/tests/extmod/time_ms_us.py.exp @@ -1,2 +1,3 @@ True True +True