summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-07-24 07:21:58 +0800
committerChromeBot <chrome-bot@google.com>2013-07-23 19:02:33 -0700
commiteda52c4ab4c8c3090a07132a4f66efd3a639badd (patch)
tree16b8981fca66b5e3194528b36f2a1c192c3b4082
parent8b816367803f9574a2176a6c21c1021512f0b5ec (diff)
downloadchrome-ec-eda52c4ab4c8c3090a07132a4f66efd3a639badd.tar.gz
Lessen timing constraints in hooks test
HOOK_TICK and HOOK_SECOND aren't firing with precise interval. Let's lessen the timing constraints. BUG=chromium:263288 TEST=Pass all tests BRANCH=None Change-Id: Ic093c2a27ed1b8621469a4097e567b80d1eeb50d Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/63144 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--test/hooks.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/hooks.c b/test/hooks.c
index 843833917a..679cf584d3 100644
--- a/test/hooks.c
+++ b/test/hooks.c
@@ -82,11 +82,11 @@ static int test_ticks(void)
interval = tick_time[1].val - tick_time[0].val;
error_pct = (interval - HOOK_TICK_INTERVAL) * 100 /
HOOK_TICK_INTERVAL;
- TEST_ASSERT_ABS_LESS(error_pct, 3);
+ TEST_ASSERT_ABS_LESS(error_pct, 10);
interval = second_time[1].val - second_time[0].val;
- error_pct = (interval - 1000 * MSEC) * 100 / (1000 * MSEC);
- TEST_ASSERT_ABS_LESS(error_pct, 3);
+ error_pct = (interval - SECOND) * 100 / SECOND;
+ TEST_ASSERT_ABS_LESS(error_pct, 10);
return EC_SUCCESS;
}