]> granicus.if.org Git - taglib/commitdiff
We've moved away from including the null byte in the returned value
authorScott Wheeler <scott@directededge.com>
Mon, 18 May 2015 15:29:52 +0000 (17:29 +0200)
committerScott Wheeler <scott@directededge.com>
Mon, 18 May 2015 15:29:52 +0000 (17:29 +0200)
This does change previous behavior, but the previous behavior was
particularly stupid and inconsistent with everything else in TagLib.

It should be possible to mitigate this by putting the same safety
guards in the TableOfContents

tests/test_id3v2.cpp

index 3a18939384fdc2b2a96ab3427055d1ea90c5aea9..be16fd0bf69eab4ac1096a501ed80386c94dc215 100644 (file)
@@ -895,7 +895,7 @@ public:
       ByteVector("CHAP"                     // Frame ID
                  "\x00\x00\x00\x20"         // Frame size
                  "\x00\x00"                 // Frame flags
-                 "\x43\x00"                 // Element ID
+                 "\x43\x00"                 // Element ID ("C")
                  "\x00\x00\x00\x03"         // Start time
                  "\x00\x00\x00\x05"         // End time
                  "\x00\x00\x00\x02"         // Start offset
@@ -909,7 +909,7 @@ public:
 
     ID3v2::ChapterFrame f1(&header, chapterData);
 
-    CPPUNIT_ASSERT_EQUAL(ByteVector("\x43\x00", 2), f1.elementID());
+    CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f1.elementID());
     CPPUNIT_ASSERT((uint)0x03 == f1.startTime());
     CPPUNIT_ASSERT((uint)0x05 == f1.endTime());
     CPPUNIT_ASSERT((uint)0x02 == f1.startOffset());
@@ -918,7 +918,7 @@ public:
 
     ID3v2::ChapterFrame f2(&header, chapterData + embeddedFrameData);
 
-    CPPUNIT_ASSERT_EQUAL(ByteVector("\x43\x00", 2), f2.elementID());
+    CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f2.elementID());
     CPPUNIT_ASSERT((uint)0x03 == f2.startTime());
     CPPUNIT_ASSERT((uint)0x05 == f2.endTime());
     CPPUNIT_ASSERT((uint)0x02 == f2.startOffset());