mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 18:51:11 +00:00
tests: Check return value of byte write methods
This commit is contained in:
parent
32c617c867
commit
8d90932ad4
1 changed files with 9 additions and 6 deletions
|
@ -1314,26 +1314,29 @@ GST_START_TEST (test_exif_parsing)
|
|||
GstTagList *taglist;
|
||||
GstBuffer *buf;
|
||||
GstByteWriter writer;
|
||||
gboolean res = TRUE;
|
||||
const gchar *str = NULL;
|
||||
|
||||
gst_byte_writer_init (&writer);
|
||||
|
||||
/* write the IFD */
|
||||
/* 1 entry */
|
||||
gst_byte_writer_put_uint16_le (&writer, 1);
|
||||
res &= gst_byte_writer_put_uint16_le (&writer, 1);
|
||||
|
||||
/* copyright tag */
|
||||
/* tag id */
|
||||
gst_byte_writer_put_uint16_le (&writer, 0x8298);
|
||||
res &= gst_byte_writer_put_uint16_le (&writer, 0x8298);
|
||||
/* tag type */
|
||||
gst_byte_writer_put_uint16_le (&writer, 0x2);
|
||||
res &= gst_byte_writer_put_uint16_le (&writer, 0x2);
|
||||
/* count */
|
||||
gst_byte_writer_put_uint32_le (&writer, strlen ("my copyright") + 1);
|
||||
res &= gst_byte_writer_put_uint32_le (&writer, strlen ("my copyright") + 1);
|
||||
/* offset */
|
||||
gst_byte_writer_put_uint32_le (&writer, 8 + 14);
|
||||
res &= gst_byte_writer_put_uint32_le (&writer, 8 + 14);
|
||||
|
||||
/* data */
|
||||
gst_byte_writer_put_string (&writer, "my copyright");
|
||||
res &= gst_byte_writer_put_string (&writer, "my copyright");
|
||||
|
||||
fail_unless (res, "Failed to write tag");
|
||||
|
||||
buf = gst_byte_writer_reset_and_get_buffer (&writer);
|
||||
|
||||
|
|
Loading…
Reference in a new issue