GNOME Bugzilla – Bug 511783
[API] [check] add gst_check_element_push_buffer_list() etc.
Last modified: 2008-02-13 20:15:12 UTC
I think we can use some more functions that automate the testing process. Proposed is a patch that adds two functions: * gst_check_element_push_buffer_list (const gchar *element_name, GList *buffer_in, GList *buffer_out, GstFlowReturn last_flow_return) this function creates the element with the element_name and pushes all buffers in buffer_in to the element and checks if the output of this element is the same as the buffers in buffer_out. last_flow_return is a bonus to check what the push of the last packet need to be. *gst_check_element_push_buffer (const gchar *element_name, GstBuffer *buffer_in, GstBuffer *buffer_out) a small wrapper that takes 1 buffer in and out and expect GST_FLOW_OK This can remove a lot of redundant code out of the unit test's to keep an overview.
Created attachment 103632 [details] [review] add element push buffer functions
Created attachment 103636 [details] [review] add element push buffer functions correctly check the return value for the last buffer.
Created attachment 103844 [details] [review] add element push buffer functions add more checking and logging
committed. Log message: * docs/libs/gstreamer-libs-sections.txt: * libs/gst/check/gstcheck.c: * libs/gst/check/gstcheck.h: Add more functions for unit testing: gst_check_drop_buffers, gst_check_caps_equal, gst_check_element_push_buffer_list, gst_check_element_push_buffer