mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-13 12:56:15 +01:00
Merge branch 'timeout-test-fix' into 'master'
tests: Add some rounding tolerance in timeout test See merge request GNOME/glib!1806
This commit is contained in:
commit
06511b16fa
@ -152,11 +152,13 @@ test_func (gpointer data)
|
|||||||
|
|
||||||
/* We accept 2 on the first iteration because _add_seconds() can
|
/* We accept 2 on the first iteration because _add_seconds() can
|
||||||
* have an initial latency of 1 second, see its documentation.
|
* have an initial latency of 1 second, see its documentation.
|
||||||
|
*
|
||||||
|
* Allow up to 500ms leeway for rounding and scheduling.
|
||||||
*/
|
*/
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
g_assert (current_time / 1000000 - last_time / 1000000 <= 2);
|
g_assert_cmpint (current_time / 1000 - last_time / 1000, <=, 2500);
|
||||||
else
|
else
|
||||||
g_assert (current_time / 1000000 - last_time / 1000000 == 1);
|
g_assert_cmpint (current_time / 1000 - last_time / 1000, <=, 1500);
|
||||||
|
|
||||||
last_time = current_time;
|
last_time = current_time;
|
||||||
count++;
|
count++;
|
||||||
|
Loading…
Reference in New Issue
Block a user