Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c96b5502
authored
Nov 20, 2022
by
Alexander Capehart
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add ID3v2 multi-value tests
Add tests for ID3v2 multi-value text frames.
parent
4510210a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
library/extractor/src/test/java/com/google/android/exoplayer2/metadata/id3/Id3DecoderTest.java
library/extractor/src/test/java/com/google/android/exoplayer2/metadata/id3/Id3DecoderTest.java
View file @
c96b5502
...
@@ -69,6 +69,21 @@ public final class Id3DecoderTest {
...
@@ -69,6 +69,21 @@ public final class Id3DecoderTest {
assertThat
(
textInformationFrame
.
description
).
isEqualTo
(
"Hello World"
);
assertThat
(
textInformationFrame
.
description
).
isEqualTo
(
"Hello World"
);
assertThat
(
textInformationFrame
.
values
).
isEmpty
();
assertThat
(
textInformationFrame
.
values
).
isEmpty
();
// Test multiple values.
rawId3
=
buildSingleFrameTag
(
"TXXX"
,
new
byte
[]
{
1
,
0
,
72
,
0
,
101
,
0
,
108
,
0
,
108
,
0
,
111
,
0
,
32
,
0
,
87
,
0
,
111
,
0
,
114
,
0
,
108
,
0
,
100
,
0
,
0
,
0
,
70
,
0
,
111
,
0
,
111
,
0
,
0
,
0
,
66
,
0
,
97
,
0
,
114
,
0
,
0
});
metadata
=
decoder
.
decode
(
rawId3
,
rawId3
.
length
);
assertThat
(
metadata
.
length
()).
isEqualTo
(
1
);
textInformationFrame
=
(
TextInformationFrame
)
metadata
.
get
(
0
);
assertThat
(
textInformationFrame
.
description
).
isEqualTo
(
"Hello World"
);
assertThat
(
textInformationFrame
.
values
.
length
).
isEqualTo
(
2
);
assertThat
(
textInformationFrame
.
values
[
0
]).
isEqualTo
(
"Foo"
);
assertThat
(
textInformationFrame
.
values
[
1
]).
isEqualTo
(
"Bar"
);
// Test empty.
// Test empty.
rawId3
=
buildSingleFrameTag
(
"TXXX"
,
new
byte
[
0
]);
rawId3
=
buildSingleFrameTag
(
"TXXX"
,
new
byte
[
0
]);
metadata
=
decoder
.
decode
(
rawId3
,
rawId3
.
length
);
metadata
=
decoder
.
decode
(
rawId3
,
rawId3
.
length
);
...
@@ -98,6 +113,15 @@ public final class Id3DecoderTest {
...
@@ -98,6 +113,15 @@ public final class Id3DecoderTest {
assertThat
(
textInformationFrame
.
values
.
length
).
isEqualTo
(
1
);
assertThat
(
textInformationFrame
.
values
.
length
).
isEqualTo
(
1
);
assertThat
(
textInformationFrame
.
values
[
0
]).
isEqualTo
(
"Hello World"
);
assertThat
(
textInformationFrame
.
values
[
0
]).
isEqualTo
(
"Hello World"
);
// Test multiple values.
rawId3
=
buildSingleFrameTag
(
"TIT2"
,
new
byte
[]
{
3
,
70
,
111
,
111
,
0
,
66
,
97
,
114
,
0
});
metadata
=
decoder
.
decode
(
rawId3
,
rawId3
.
length
);
assertThat
(
metadata
.
length
()).
isEqualTo
(
1
);
textInformationFrame
=
(
TextInformationFrame
)
metadata
.
get
(
0
);
assertThat
(
textInformationFrame
.
values
.
length
).
isEqualTo
(
2
);
assertThat
(
textInformationFrame
.
values
[
0
]).
isEqualTo
(
"Foo"
);
assertThat
(
textInformationFrame
.
values
[
1
]).
isEqualTo
(
"Bar"
);
// Test empty.
// Test empty.
rawId3
=
buildSingleFrameTag
(
"TIT2"
,
new
byte
[
0
]);
rawId3
=
buildSingleFrameTag
(
"TIT2"
,
new
byte
[
0
]);
metadata
=
decoder
.
decode
(
rawId3
,
rawId3
.
length
);
metadata
=
decoder
.
decode
(
rawId3
,
rawId3
.
length
);
...
...
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