ID3v2 FrameID + Tests suite

Scott Wheeler wheeler at kde.org
Mon Feb 13 22:42:29 CET 2006


On Monday 13 February 2006 21:31, nerochiaro wrote:
> Hi,
> I have a question about the method frameID from ID3v2::Frame.
> Why does it return a ByteVector ?
> Unless i'm reading the ID3v2 standard incorrectly the frame ID is 4
> characters long and each character can be any of "capital A-Z and
> 0-9".
> And with "character" the standard seems to really mean "byte".
>
> So, is there a reason for not using just a Latin-1-encoded
> TagLib::String there ?
> Just curious.

A char in C/C++ is always a byte.  ByteVector is really just an abstraction 
for an array of characters and for the way that the frame ID is used it makes 
more sense as a ByteVector.

A String is always converted to use 32-bit (wide character) unicode 
internally, so it would be slightly slower since it would all have to pass 
through the string conversion stuff.

> Also, since i'm posting, i'll throw in another question.
> Is there any test suite available to exercise the full TagLib API ?
>
> I can see only a file with some tests for some toolkit classes in the
> tests directory in 1.4 release, but basically nothing to test the
> tagging-specific functionality, especially the more messy aspects like
> ID3v2 frames.
> I ask this because in the ruby bindings I wrapped basically all of
> TagLib's functionality.
> I just need to test that everything was done correctly before releasing
> them. Having a good test suite that I can take as a base to check that
> everything is ok would really help.

Actually the best testing of the whole thing was when Dongxu did the Perl 
bindings.  There is no real test suite for the tagging specific stuff.  I 
kind of put things through a trial of running TagLib against all of my MP3s 
before releasing, plus every one that's ever come in through a bug report 
(about 20 weird or corrupted mp3s).  If anyone wants to write a test suite, 
well, great, but I probably won't do anything really systematic.

Cheers,

-Scott

-- 
Bronfman isn’t known for being the brightest crayon in the sandwich, if you 
get my drift.
-Slashdot


More information about the taglib-devel mailing list