mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 07:26:29 +00:00
tests: add another adapter test
Test performance of merging
This commit is contained in:
parent
2503dcddfb
commit
fc8b28455f
1 changed files with 28 additions and 0 deletions
|
@ -805,6 +805,33 @@ GST_START_TEST (test_take_list)
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
GST_START_TEST (test_merge)
|
||||||
|
{
|
||||||
|
GstAdapter *adapter;
|
||||||
|
GstBuffer *buffer;
|
||||||
|
gint i;
|
||||||
|
|
||||||
|
adapter = gst_adapter_new ();
|
||||||
|
fail_if (adapter == NULL);
|
||||||
|
|
||||||
|
buffer = gst_buffer_new_and_alloc (10);
|
||||||
|
fail_if (buffer == NULL);
|
||||||
|
gst_adapter_push (adapter, buffer);
|
||||||
|
|
||||||
|
for (i = 0; i < 1000; i++) {
|
||||||
|
buffer = gst_buffer_new_and_alloc (10);
|
||||||
|
gst_adapter_push (adapter, buffer);
|
||||||
|
|
||||||
|
fail_unless (gst_adapter_map (adapter, 20) != NULL);
|
||||||
|
gst_adapter_unmap (adapter);
|
||||||
|
|
||||||
|
gst_adapter_flush (adapter, 10);
|
||||||
|
}
|
||||||
|
g_object_unref (adapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_END_TEST;
|
||||||
|
|
||||||
static Suite *
|
static Suite *
|
||||||
gst_adapter_suite (void)
|
gst_adapter_suite (void)
|
||||||
{
|
{
|
||||||
|
@ -823,6 +850,7 @@ gst_adapter_suite (void)
|
||||||
tcase_add_test (tc_chain, test_timestamp);
|
tcase_add_test (tc_chain, test_timestamp);
|
||||||
tcase_add_test (tc_chain, test_scan);
|
tcase_add_test (tc_chain, test_scan);
|
||||||
tcase_add_test (tc_chain, test_take_list);
|
tcase_add_test (tc_chain, test_take_list);
|
||||||
|
tcase_add_test (tc_chain, test_merge);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue