mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
Merge branch 'bugfix/fix_abs_using' into 'master'
build: fix abs() use See merge request espressif/esp-idf!16952
This commit is contained in:
@@ -123,7 +123,7 @@ TEST_CASE("getting the time works", "[test_utils][ccomp_timer]")
|
||||
int64_t t_2 = esp_timer_get_time() - start;
|
||||
|
||||
// The times should at least be in the same ballpark (at least within 10%)
|
||||
float diff = (abs(t_1 - t_2)) / ((float)t_2);
|
||||
float diff = (llabs(t_1 - t_2)) / ((float)t_2);
|
||||
TEST_ASSERT(diff <= 10.0f);
|
||||
|
||||
// Since the timer was already stopped, test that ccomp_timer_get_time
|
||||
|
@@ -162,7 +162,7 @@ TEST_CASE("data cache hit rate sweep", "[test_utils][ccomp_timer]")
|
||||
for (int i = 0; i <= 100; i += 5)
|
||||
{
|
||||
t_hr = perform_test_at_hit_rate(i, flash_mem);
|
||||
float error = (abs(t_ref.ccomp - t_hr.ccomp) / (float)t_ref.ccomp) * 100.0f;
|
||||
float error = (llabs(t_ref.ccomp - t_hr.ccomp) / (float)t_ref.ccomp) * 100.0f;
|
||||
|
||||
ESP_LOGI(TAG, "Hit Rate(%%): %d Wall Time(us): %lld Compensated Time(us): %lld Error(%%): %f", i, (long long)t_hr.wall, (long long)t_hr.ccomp, error);
|
||||
|
||||
|
@@ -221,7 +221,7 @@ TEST_CASE("instruction cache hit rate sweep test", "[test_utils][ccomp_timer]")
|
||||
for (int i = 0; i <= 100; i += 5)
|
||||
{
|
||||
t_hr = perform_test_at_hit_rate(i);
|
||||
float error = (abs(t_ref.ccomp - t_hr.ccomp) / (float)t_ref.wall) * 100.0f;
|
||||
float error = (llabs(t_ref.ccomp - t_hr.ccomp) / (float)t_ref.wall) * 100.0f;
|
||||
|
||||
ESP_LOGI(TAG, "Hit Rate(%%): %d Wall Time(us): %lld Compensated Time(us): %lld Error(%%): %f", i, (long long)t_hr.wall, (long long)t_hr.ccomp, error);
|
||||
|
||||
|
Reference in New Issue
Block a user