From df9cf1cc08d73af765f0f434909295ac6fed2c4b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 9 Dec 2018 17:11:10 -0700 Subject: test: dm: regmap: Fix the long test delay At present one of the regmap tests takes 5 seconds to run since it waits for a timeout. This should be handled using sandbox_timer_add_offset() which advances time for test purposes. This requires a little change to make the regmap_read_poll_timeout() testable. Update the macro and the test. Fixes: ebe3497c9c ("test: regmap: add regmap_read_poll_timeout test") Signed-off-by: Simon Glass --- test/dm/regmap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/dm/regmap.c b/test/dm/regmap.c index 9a70c15..82de295 100644 --- a/test/dm/regmap.c +++ b/test/dm/regmap.c @@ -160,9 +160,10 @@ static int dm_test_regmap_poll(struct unit_test_state *uts) start = get_timer(0); ut_asserteq(-ETIMEDOUT, - regmap_read_poll_timeout(map, 0, reg, - (reg == 0xcacafafa), - 1, 5 * CONFIG_SYS_HZ)); + regmap_read_poll_timeout_test(map, 0, reg, + (reg == 0xcacafafa), + 1, 5 * CONFIG_SYS_HZ, + 5 * CONFIG_SYS_HZ)); ut_assert(get_timer(start) > (5 * CONFIG_SYS_HZ)); -- cgit v1.1