mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-26 20:22:11 +01:00
Merge branch 'asyncqueue-test-timing' into 'master'
tests: Be more lenient with timing checks on asyncqueue pops See merge request GNOME/glib!1808
This commit is contained in:
commit
4fb3b6aa37
@ -193,7 +193,7 @@ test_async_queue_timed (void)
|
|||||||
/* diff should be only a little bit more than G_USEC_PER_SEC/10, but
|
/* diff should be only a little bit more than G_USEC_PER_SEC/10, but
|
||||||
* we have to leave some wiggle room for heavily-loaded machines...
|
* we have to leave some wiggle room for heavily-loaded machines...
|
||||||
*/
|
*/
|
||||||
g_assert_cmpint (diff, <, G_USEC_PER_SEC);
|
g_assert_cmpint (diff, <, 2 * G_USEC_PER_SEC);
|
||||||
|
|
||||||
start = end;
|
start = end;
|
||||||
g_get_current_time (&tv);
|
g_get_current_time (&tv);
|
||||||
@ -204,7 +204,7 @@ test_async_queue_timed (void)
|
|||||||
end = g_get_monotonic_time ();
|
end = g_get_monotonic_time ();
|
||||||
diff = end - start;
|
diff = end - start;
|
||||||
g_assert_cmpint (diff, >=, G_USEC_PER_SEC / 10);
|
g_assert_cmpint (diff, >=, G_USEC_PER_SEC / 10);
|
||||||
g_assert_cmpint (diff, <, G_USEC_PER_SEC);
|
g_assert_cmpint (diff, <, 2 * G_USEC_PER_SEC);
|
||||||
|
|
||||||
start = end;
|
start = end;
|
||||||
g_get_current_time (&tv);
|
g_get_current_time (&tv);
|
||||||
@ -217,7 +217,7 @@ test_async_queue_timed (void)
|
|||||||
end = g_get_monotonic_time ();
|
end = g_get_monotonic_time ();
|
||||||
diff = end - start;
|
diff = end - start;
|
||||||
g_assert_cmpint (diff, >=, G_USEC_PER_SEC / 10);
|
g_assert_cmpint (diff, >=, G_USEC_PER_SEC / 10);
|
||||||
g_assert_cmpint (diff, <, G_USEC_PER_SEC);
|
g_assert_cmpint (diff, <, 2 * G_USEC_PER_SEC);
|
||||||
|
|
||||||
g_async_queue_unref (q);
|
g_async_queue_unref (q);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user