Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
George Kiagiadakis
gst-plugins-base
Commits
556bc04f
Commit
556bc04f
authored
Mar 01, 2018
by
Tim-Philipp Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: tags: add unit test for ID3 v2.4 extended headers
https://bugzilla.gnome.org/show_bug.cgi?id=792983
parent
6f5c9db1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
tests/check/libs/tag.c
tests/check/libs/tag.c
+26
-1
No files found.
tests/check/libs/tag.c
View file @
556bc04f
...
...
@@ -764,6 +764,25 @@ parse_id3v2_tag_from_data (const guint8 * id3v2, gsize id3v2_size)
GST_START_TEST
(
test_id3v2_extended_header
)
{
const
guint8
id3v24_exthdr
[
1024
]
=
{
0x49
,
0x44
,
0x33
,
0x04
,
0x00
,
0x40
,
0x00
,
0x00
,
0x07
,
0x76
,
0x00
,
0x00
,
0x00
,
0x0c
,
0x01
,
0x20
,
0x05
,
0x0b
,
0x7f
,
0x06
,
0x43
,
0x22
,
0x54
,
0x53
,
0x53
,
0x45
,
0x00
,
0x00
,
0x00
,
0x0e
,
0x00
,
0x00
,
0x03
,
0x4c
,
0x61
,
0x76
,
0x66
,
0x35
,
0x37
,
0x2e
,
0x37
,
0x31
,
0x2e
,
0x31
,
0x30
,
0x30
,
0x54
,
0x49
,
0x54
,
0x32
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x00
,
0x03
,
0x53
,
0x69
,
0x6c
,
0x65
,
0x6e
,
0x63
,
0x65
,
0x54
,
0x50
,
0x45
,
0x31
,
0x00
,
0x00
,
0x00
,
0x07
,
0x00
,
0x00
,
0x03
,
0x4e
,
0x6f
,
0x20
,
0x6f
,
0x6e
,
0x65
,
0x54
,
0x50
,
0x45
,
0x32
,
0x00
,
0x00
,
0x00
,
0x05
,
0x00
,
0x00
,
0x03
,
0x4e
,
0x6f
,
0x6e
,
0x65
,
0x54
,
0x41
,
0x4c
,
0x42
,
0x00
,
0x00
,
0x00
,
0x08
,
0x00
,
0x00
,
0x03
,
0x4e
,
0x65
,
0x69
,
0x74
,
0x68
,
0x65
,
0x72
,
0x54
,
0x44
,
0x52
,
0x43
,
0x00
,
0x00
,
0x00
,
0x05
,
0x00
,
0x00
,
0x03
,
0x32
,
0x30
,
0x31
,
0x38
,
0x54
,
0x52
,
0x43
,
0x4b
,
0x00
,
0x00
,
0x00
,
0x06
,
0x00
,
0x00
,
0x03
,
0x30
,
0x31
,
0x2f
,
0x30
,
0x31
,
0x54
,
0x43
,
0x4f
,
0x4e
,
0x00
,
0x00
,
0x00
,
0x06
,
0x00
,
0x00
,
0x03
,
0x28
,
0x31
,
0x34
,
0x38
,
0x29
,
};
const
guint8
id3v2_exthdr
[]
=
{
0x49
,
0x44
,
0x33
,
0x03
,
0x00
,
0x40
,
0x00
,
0x00
,
0x00
,
0x1b
,
0x00
,
0x00
,
0x00
,
0x06
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
...
...
@@ -778,11 +797,17 @@ GST_START_TEST (test_id3v2_extended_header)
GstTagList
*
tags
;
tags
=
parse_id3v2_tag_from_data
(
id3v2_exthdr
,
sizeof
(
id3v2_exthdr
));
fail_if
(
tags
==
NULL
,
"Failed to parse ID3 tag with extension header"
);
fail_if
(
tags
==
NULL
,
"Failed to parse ID3
v2.3
tag with extension header"
);
GST_LOG
(
"tags: %"
GST_PTR_FORMAT
,
tags
);
fail_unless_equals_int
(
gst_tag_list_n_tags
(
tags
),
1
);
gst_tag_list_unref
(
tags
);
tags
=
parse_id3v2_tag_from_data
(
id3v24_exthdr
,
sizeof
(
id3v24_exthdr
));
fail_if
(
tags
==
NULL
,
"Failed to parse ID3 v2.4 tag with extension header"
);
GST_LOG
(
"tags: %"
GST_PTR_FORMAT
,
tags
);
fail_unless_equals_int
(
gst_tag_list_n_tags
(
tags
),
9
);
gst_tag_list_unref
(
tags
);
tags
=
parse_id3v2_tag_from_data
(
id3v2_no_exthdr
,
sizeof
(
id3v2_no_exthdr
));
fail_if
(
tags
==
NULL
,
"Failed to parse ID3 tag without extension header"
);
GST_LOG
(
"tags: %"
GST_PTR_FORMAT
,
tags
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment