History

tests/callback_test.c : Work around rounding error in termination test on x86_64.

Erik de Castro Lopo committed 17 years ago

Commit 71776af1 parent 98d19631 file · +3 −3Browse files

Unified · Split

tests/callback_test.c+3−3
@@ -137,11 +137,11 @@ callback_test (int converter, double src_ratio) · 136 unmodified lines
137 137
138 src_state = src_delete (src_state) ;138 src_state = src_delete (src_state) ;
139 139
140 if (fabs (read_total - src_ratio * ARRAY_LEN (test_callback_data.data)) > src_ratio)140 if (fabs (read_total / src_ratio - ARRAY_LEN (test_callback_data.data)) > 2.0)
141 { printf ("\n\nLine %d : input / output length mismatch.\n\n", __LINE__) ;141 { printf ("\n\nLine %d : input / output length mismatch.\n\n", __LINE__) ;
142 printf (" input len : %d\n", ARRAY_LEN (test_callback_data.data)) ;142 printf (" input len : %d\n", ARRAY_LEN (test_callback_data.data)) ;
143 printf (" output len : %ld (should be %g +/- %g)\n\n", read_total,143 printf (" output len : %ld (should be %g +/- 2)\n\n", read_total,
144 floor (0.5 + src_ratio * ARRAY_LEN (test_callback_data.data)), ceil (src_ratio)) ;144 floor (0.5 + src_ratio * ARRAY_LEN (test_callback_data.data))) ;
145 exit (1) ;145 exit (1) ;
146 } ;146 } ;
147 147

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t