mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-02 02:40:07 +02:00
tests: Add some explicit float → int casts
This avoids some false positive warnings from `-Wfloat-conversion`. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
7a7d8d548a
commit
e888e7d497
@ -837,7 +837,7 @@ cancellable_thread_cb (gpointer data)
|
|||||||
{
|
{
|
||||||
GCancellable *cancellable = data;
|
GCancellable *cancellable = data;
|
||||||
|
|
||||||
g_usleep (0.1 * G_USEC_PER_SEC);
|
g_usleep ((guint64) (0.1 * G_USEC_PER_SEC));
|
||||||
g_cancellable_cancel (cancellable);
|
g_cancellable_cancel (cancellable);
|
||||||
g_object_unref (cancellable);
|
g_object_unref (cancellable);
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ static void
|
|||||||
test_fork_timeout (void)
|
test_fork_timeout (void)
|
||||||
{
|
{
|
||||||
/* allow child to run for only a fraction of a second */
|
/* allow child to run for only a fraction of a second */
|
||||||
if (g_test_trap_fork (0.11 * 1000000, G_TEST_TRAP_DEFAULT))
|
if (g_test_trap_fork ((guint64) (0.11 * G_USEC_PER_SEC), G_TEST_TRAP_DEFAULT))
|
||||||
{
|
{
|
||||||
/* loop and sleep forever */
|
/* loop and sleep forever */
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
@ -399,7 +399,7 @@ test_subprocess_timeout (void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* allow child to run for only a fraction of a second */
|
/* allow child to run for only a fraction of a second */
|
||||||
g_test_trap_subprocess (NULL, 0.05 * G_USEC_PER_SEC, G_TEST_SUBPROCESS_DEFAULT);
|
g_test_trap_subprocess (NULL, (guint64) (0.05 * G_USEC_PER_SEC), G_TEST_SUBPROCESS_DEFAULT);
|
||||||
g_test_trap_assert_failed ();
|
g_test_trap_assert_failed ();
|
||||||
g_assert_true (g_test_trap_reached_timeout ());
|
g_assert_true (g_test_trap_reached_timeout ());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user