Skip to content

Commit 3a9d586

Browse files
committed
test_unit_mathops: Fix values in error messages
Some fixed point values were displayed at the wrong scale in the error message displayed when the test failed.
1 parent 6dcfcbe commit 3a9d586

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

celt/tests/test_unit_mathops.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void testlog2_db(void)
301301
if (error > error_threshold)
302302
{
303303
fprintf(stderr, "celt_log2_db failed: error: [%.5e > %.5e] (x = %f)\n",
304-
error, error_threshold, FIX_INT_TO_DOUBLE(x, DB_SHIFT));
304+
error, error_threshold, FIX_INT_TO_DOUBLE(x, q_input));
305305
ret = 1;
306306
}
307307
}
@@ -492,7 +492,7 @@ void testatan_norm(void)
492492
{
493493
fprintf(stderr,
494494
"celt_atan_norm failed: error: [%.5e > %.5e] (x = %f)\n",
495-
error, error_threshold, FIX_INT_TO_DOUBLE(x, DB_SHIFT));
495+
error, error_threshold, FIX_INT_TO_DOUBLE(x, q_input));
496496
ret = 1;
497497
}
498498
}
@@ -532,8 +532,9 @@ void testatan2p_norm(void)
532532
if (error > error_threshold)
533533
{
534534
fprintf(stderr,
535-
"celt_atan2p_norm failed: error: [%.5e > %.5e] (x = %f)\n",
536-
error, error_threshold, FIX_INT_TO_DOUBLE(x, DB_SHIFT));
535+
"celt_atan2p_norm failed: error: [%.5e > %.5e] (y/x = %f/%f)\n",
536+
error, error_threshold, FIX_INT_TO_DOUBLE(y, q_input),
537+
FIX_INT_TO_DOUBLE(x, q_input));
537538
ret = 1;
538539
}
539540
}
@@ -570,7 +571,7 @@ void test_cos_norm32(void)
570571
{
571572
fprintf(stderr,
572573
"celt_cos_norm32 failed: error: [%.5e > %.5e] (x = %f)\n",
573-
error, error_threshold, FIX_INT_TO_DOUBLE(x, DB_SHIFT));
574+
error, error_threshold, FIX_INT_TO_DOUBLE(x, q_input));
574575
ret = 1;
575576
}
576577
}

0 commit comments

Comments
 (0)