mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
buffer: Add test to ensure that memories in a non-writable buffer are not writable
https://bugzilla.gnome.org/show_bug.cgi?id=796692
This commit is contained in:
parent
13a45c0a38
commit
111faa58c0
1 changed files with 18 additions and 0 deletions
|
@ -887,6 +887,23 @@ GST_START_TEST (test_parent_buffer_meta)
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
GST_START_TEST (test_writable_memory)
|
||||||
|
{
|
||||||
|
GstBuffer *buf;
|
||||||
|
GstMemory *mem;
|
||||||
|
|
||||||
|
buf = gst_buffer_new_and_alloc (10);
|
||||||
|
/* make buffer read-only */
|
||||||
|
gst_buffer_ref (buf);
|
||||||
|
|
||||||
|
mem = gst_buffer_peek_memory (buf, 0);
|
||||||
|
fail_if (gst_memory_is_writable (mem));
|
||||||
|
|
||||||
|
gst_buffer_unref (buf);
|
||||||
|
gst_buffer_unref (buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_END_TEST;
|
||||||
|
|
||||||
static Suite *
|
static Suite *
|
||||||
gst_buffer_suite (void)
|
gst_buffer_suite (void)
|
||||||
|
@ -911,6 +928,7 @@ gst_buffer_suite (void)
|
||||||
tcase_add_test (tc_chain, test_find);
|
tcase_add_test (tc_chain, test_find);
|
||||||
tcase_add_test (tc_chain, test_fill);
|
tcase_add_test (tc_chain, test_fill);
|
||||||
tcase_add_test (tc_chain, test_parent_buffer_meta);
|
tcase_add_test (tc_chain, test_parent_buffer_meta);
|
||||||
|
tcase_add_test (tc_chain, test_writable_memory);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue