diff options
author | Tom Hughes <tomhughes@chromium.org> | 2020-10-06 17:26:24 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-09 04:04:43 +0000 |
commit | eadfb75ab5a43fd3b82c78c1b65f1b5623847cf4 (patch) | |
tree | 411a04969de35d8d1c0e84a01e84b670e0e87061 | |
parent | 61c3590ddefc3e5119bad6e0a8d3c27921537e00 (diff) | |
download | chrome-ec-eadfb75ab5a43fd3b82c78c1b65f1b5623847cf4.tar.gz |
test/utils.c: Adjust expected speedup for STM32H743
BRANCH=none
BUG=b:158580909, b:170432597
TEST=On Icetower v0.1 connected to servo_micro:
./test/run_device_tests.py -b dartmonkey -t utils
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: If5dcd7ade6397611b40b9c7a6f9560402a11c042
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2459229
Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r-- | test/utils.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/test/utils.c b/test/utils.c index 92643980d5..66f6a13957 100644 --- a/test/utils.c +++ b/test/utils.c @@ -45,13 +45,19 @@ static int test_memmove(void) TEST_ASSERT_ARRAY_EQ(buf + 100, buf, len); /* Expected about 4x speed gain. Use 3x because it fluctuates */ -#ifndef EMU_BUILD - /* - * The speed gain is too unpredictable on host, especially on - * buildbots. Skip it if we are running in the emulator. - */ - TEST_ASSERT((t1.val-t0.val) > (unsigned)(t3.val-t2.val) * 3); -#endif + if (!IS_ENABLED(EMU_BUILD)) { + /* + * The speed gain is too unpredictable on host, especially on + * buildbots. Skip it if we are running in the emulator. + */ + int expected_speedup = 3; + + if (IS_ENABLED(CHIP_FAMILY_STM32H7)) + expected_speedup = 2; + + TEST_ASSERT((t1.val - t0.val) > + (unsigned int)(t3.val - t2.val) * expected_speedup); + } /* Test small moves */ memmove(buf + 1, buf, 1); @@ -168,7 +174,8 @@ static int test_memset(void) */ int expected_speedup = 3; - if (IS_ENABLED(CHIP_FAMILY_STM32F4)) + if (IS_ENABLED(CHIP_FAMILY_STM32F4) || + IS_ENABLED(CHIP_FAMILY_STM32H7)) expected_speedup = 2; TEST_ASSERT((t1.val - t0.val) > |