tests: Fix level test in CK_FORK=no mode

The tests accumulate buffers in GstCheck's buffers list, and the list is
not (consistently) reset between tests. Do that and remove the now
conflicting unrefs for outbuffers.

https://bugzilla.gnome.org/show_bug.cgi?id=772644
This commit is contained in:
Jan Alexander Steffens (heftig) 2016-10-09 15:23:51 +02:00 committed by Sebastian Dröge
parent 1950b72e2b
commit 22ced681af

View file

@ -96,6 +96,7 @@ cleanup_level (GstElement * level)
{
GST_DEBUG ("cleanup_level");
gst_check_drop_buffers ();
gst_pad_set_active (mysrcpad, FALSE);
gst_pad_set_active (mysinkpad, FALSE);
gst_check_teardown_src_pad (level);
@ -194,7 +195,6 @@ GST_START_TEST (test_ref_counts)
gst_element_set_bus (level, NULL);
ASSERT_OBJECT_REFCOUNT (bus, "bus", 1);
gst_object_unref (bus);
gst_buffer_unref (outbuffer);
fail_unless (gst_element_set_state (level,
GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null");
ASSERT_OBJECT_REFCOUNT (level, "level", 1);
@ -241,7 +241,6 @@ GST_START_TEST (test_message_is_valid)
gst_object_unref (bus);
gst_element_set_state (level, GST_STATE_NULL);
cleanup_level (level);
gst_check_drop_buffers ();
}
GST_END_TEST;
@ -298,7 +297,6 @@ GST_START_TEST (test_int16)
gst_message_unref (message);
gst_element_set_bus (level, NULL);
gst_object_unref (bus);
gst_buffer_unref (outbuffer);
gst_element_set_state (level, GST_STATE_NULL);
cleanup_level (level);
}
@ -377,7 +375,6 @@ GST_START_TEST (test_int16_panned)
gst_bus_set_flushing (bus, TRUE);
gst_element_set_bus (level, NULL);
gst_object_unref (bus);
gst_buffer_unref (outbuffer);
gst_element_set_state (level, GST_STATE_NULL);
cleanup_level (level);
}
@ -436,7 +433,6 @@ GST_START_TEST (test_float)
gst_message_unref (message);
gst_element_set_bus (level, NULL);
gst_object_unref (bus);
gst_buffer_unref (outbuffer);
gst_element_set_state (level, GST_STATE_NULL);
cleanup_level (level);
}
@ -503,7 +499,6 @@ GST_START_TEST (test_message_on_eos)
gst_message_unref (message);
gst_element_set_bus (level, NULL);
gst_object_unref (bus);
gst_buffer_unref (outbuffer);
gst_element_set_state (level, GST_STATE_NULL);
cleanup_level (level);
}
@ -543,7 +538,6 @@ GST_START_TEST (test_message_count)
gst_element_set_bus (level, NULL);
gst_object_unref (bus);
gst_buffer_unref (outbuffer);
gst_element_set_state (level, GST_STATE_NULL);
cleanup_level (level);
}
@ -591,7 +585,6 @@ GST_START_TEST (test_message_timestamps)
gst_element_set_bus (level, NULL);
gst_object_unref (bus);
gst_buffer_unref (outbuffer);
gst_element_set_state (level, GST_STATE_NULL);
cleanup_level (level);
}