glib/tests/asyncqueue.c: skip test_async_queue_timed in 2038 or later

This commit is contained in:
Alexander Kanavin 2023-08-24 19:45:09 +00:00 committed by Philip Withnall
parent 5216e8c7d5
commit 9bdb19b821

View File

@ -220,6 +220,15 @@ test_async_queue_timed (void)
gint64 start, end, diff;
gpointer val;
GDateTime *dt = g_date_time_new_now_utc ();
int year = g_date_time_get_year (dt);
g_date_time_unref (dt);
if (year >= 2038)
{
g_test_skip ("Test relies on GTimeVal which is Y2038 unsafe and will cause a failure.");
return;
}
g_get_current_time (&tv);
if (g_test_undefined ())
{