diff options
-rw-r--r-- | test/utils.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/test/utils.c b/test/utils.c index c46b6ab192..5b76ab8de5 100644 --- a/test/utils.c +++ b/test/utils.c @@ -157,14 +157,23 @@ static int test_memset(void) TEST_ASSERT_MEMSET(buf, (char)1, len); ccprintf(" %" PRId64 " us) ", t3.val-t2.val); - /* 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. + * Expected about 4x speed gain. Use smaller value since it + * fluctuates. */ - 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_STM32F4)) + expected_speedup = 2; + + TEST_ASSERT((t1.val - t0.val) > + (unsigned int)(t3.val - t2.val) * expected_speedup); + } memset(buf, 128, len); TEST_ASSERT_MEMSET(buf, (char)128, len); |