tests: check return value of gst_queue_array_drop_element() too
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 30 Jan 2013 11:34:15 +0000 (11:34 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 30 Jan 2013 11:34:15 +0000 (11:34 +0000)
Was added when the API was made public in git master.

https://bugzilla.gnome.org/show_bug.cgi?id=692691

tests/check/libs/queuearray.c

index 8844e69..0141a11 100644 (file)
@@ -229,10 +229,13 @@ GST_START_TEST (test_array_drop2)
 
   while (gst_queue_array_get_length (array) > 0) {
     for (i = 0; i < NUM_QA_ELEMENTS; i++) {
+      gpointer dropped;
+
       if (g_random_boolean () && g_random_boolean () && in_array[i]) {
         idx = gst_queue_array_find (array, compare_pointer_value,
             GUINT_TO_POINTER (i));
-        gst_queue_array_drop_element (array, idx);
+        dropped = gst_queue_array_drop_element (array, idx);
+        fail_unless_equals_int (i, GPOINTER_TO_INT (dropped));
         in_array[i] = FALSE;
       }
     }