Skip to content

Flash test: fix the time over a longer range #6225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions TESTS/mbed_hal/flash/functional_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

using namespace utest::v1;

#define TEST_CYCLES 1000000
#define ALLOWED_DRIFT_PPM 5000 //0.5%
#define TEST_CYCLES 10000000
#define ALLOWED_DRIFT_PPM (1000000/5000) //0.5%

/*
return values to be checked are documented at:
Expand Down Expand Up @@ -269,7 +269,7 @@ void flash_buffer_alignment_test()
void flash_clock_and_cache_test()
{
const int timer_diff_end = time_cpu_cycles(TEST_CYCLES);
const int acceptable_range = timer_diff_start / (1000000 / ALLOWED_DRIFT_PPM);
const int acceptable_range = timer_diff_start / (ALLOWED_DRIFT_PPM);
TEST_ASSERT_UINT32_WITHIN(acceptable_range, timer_diff_start, timer_diff_end);
}

Expand Down