Add test for decoding ID3 PRIV frame

I wrote this whilst investigating a user issue. It looks like
we don't need to do anything about the issue itself, but since
I wrote the test we may as well keep it!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143549697
This commit is contained in:
olly 2017-01-04 06:54:12 -08:00 committed by Oliver Woodman
parent 9f81b72291
commit 2512bd6e77

View file

@ -63,4 +63,15 @@ public class Id3DecoderTest extends TestCase {
assertEquals("Hello World", textInformationFrame.description);
}
public void testDecodePrivFrame() throws MetadataDecoderException {
byte[] rawId3 = new byte[] {73, 68, 51, 4, 0, 0, 0, 0, 0, 19, 80, 82, 73, 86, 0, 0, 0, 9, 0, 0,
116, 101, 115, 116, 0, 1, 2, 3, 4};
Id3Decoder decoder = new Id3Decoder();
Metadata metadata = decoder.decode(rawId3, rawId3.length);
assertEquals(1, metadata.length());
PrivFrame privFrame = (PrivFrame) metadata.get(0);
assertEquals("test", privFrame.owner);
MoreAsserts.assertEquals(new byte[] {1, 2, 3, 4}, privFrame.privateData);
}
}