[glib] Improve GAsyncQueue test coverage
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Improve GAsyncQueue test coverage
- Date: Wed, 1 Jan 2014 23:03:58 +0000 (UTC)
commit 6d3b83a8c131e190da5db10d81c0d3cc0e3c6768
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Dec 30 09:49:30 2013 -0500
Improve GAsyncQueue test coverage
glib/tests/asyncqueue.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/asyncqueue.c b/glib/tests/asyncqueue.c
index fce411b..5ccbb23 100644
--- a/glib/tests/asyncqueue.c
+++ b/glib/tests/asyncqueue.c
@@ -204,6 +204,19 @@ test_async_queue_timed (void)
g_assert_cmpint (diff, >=, G_USEC_PER_SEC / 10);
g_assert_cmpint (diff, <, G_USEC_PER_SEC);
+ start = end;
+ g_get_current_time (&tv);
+ g_time_val_add (&tv, G_USEC_PER_SEC / 10);
+ g_async_queue_lock (q);
+ val = g_async_queue_timed_pop_unlocked (q, &tv);
+ g_async_queue_unlock (q);
+ g_assert (val == NULL);
+
+ end = g_get_monotonic_time ();
+ diff = end - start;
+ g_assert_cmpint (diff, >=, G_USEC_PER_SEC / 10);
+ g_assert_cmpint (diff, <, G_USEC_PER_SEC);
+
g_async_queue_unref (q);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]