mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Use static_cast instead of C-style casts
This commit is contained in:
parent
d314bfa06a
commit
c54c924333
@ -565,7 +565,8 @@ void XM::File::read(bool)
|
||||
pattern.byte(packingType).u16L(rowCount).u16L(dataSize);
|
||||
|
||||
unsigned int count = pattern.read(*this, patternHeaderLength - 4U);
|
||||
READ_ASSERT(count == std::min(patternHeaderLength - 4U, (unsigned long)pattern.size()));
|
||||
READ_ASSERT(count == std::min(patternHeaderLength - 4U,
|
||||
static_cast<unsigned long>(pattern.size())));
|
||||
|
||||
seek(patternHeaderLength - (4 + count) + dataSize, Current);
|
||||
}
|
||||
@ -588,7 +589,8 @@ void XM::File::read(bool)
|
||||
|
||||
// 4 for instrumentHeaderSize
|
||||
unsigned int count = 4 + instrument.read(*this, instrumentHeaderSize - 4U);
|
||||
READ_ASSERT(count == std::min(instrumentHeaderSize, (unsigned long)instrument.size() + 4));
|
||||
READ_ASSERT(count == std::min(instrumentHeaderSize,
|
||||
static_cast<unsigned long>(instrument.size() + 4)));
|
||||
|
||||
offset_t offset = 0;
|
||||
if(sampleCount > 0) {
|
||||
@ -623,7 +625,8 @@ void XM::File::read(bool)
|
||||
.string(sampleName, 22);
|
||||
|
||||
unsigned int count = sample.read(*this, sampleHeaderSize);
|
||||
READ_ASSERT(count == std::min(sampleHeaderSize, (unsigned long)sample.size()));
|
||||
READ_ASSERT(count == std::min(sampleHeaderSize,
|
||||
static_cast<unsigned long>(sample.size())));
|
||||
// skip unhandled header proportion:
|
||||
seek(sampleHeaderSize - count, Current);
|
||||
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
}
|
||||
{
|
||||
RIFF::AIFF::File f2(newname.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, f2.tag()->header()->majorVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), f2.tag()->header()->majorVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title());
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ public:
|
||||
APE::Item item3 = APE::Item("TRACKNUMBER", String("29"));
|
||||
tag.setItem("TRACKNUMBER", item3);
|
||||
properties = tag.properties();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, properties["TRACKNUMBER"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), properties["TRACKNUMBER"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("17"), properties["TRACKNUMBER"][0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("29"), properties["TRACKNUMBER"][1]);
|
||||
|
||||
@ -138,16 +138,16 @@ public:
|
||||
|
||||
APE::Tag tag;
|
||||
PropertyMap unsuccessful = tag.setProperties(properties);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, unsuccessful.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), unsuccessful.size());
|
||||
CPPUNIT_ASSERT(unsuccessful.contains("A"));
|
||||
CPPUNIT_ASSERT(unsuccessful.contains("MP+"));
|
||||
CPPUNIT_ASSERT(unsuccessful.contains(L"\x1234\x3456"));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, tag.itemListMap().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), tag.itemListMap().size());
|
||||
tag.addValue("VALID KEY", "Test Value 1");
|
||||
tag.addValue("INVALID KEY \x7f", "Test Value 2");
|
||||
tag.addValue(L"INVALID KEY \x1234\x3456", "Test Value 3");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, tag.itemListMap().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), tag.itemListMap().size());
|
||||
}
|
||||
|
||||
void testTextBinary()
|
||||
|
@ -109,7 +109,8 @@ public:
|
||||
}
|
||||
{
|
||||
ASF::File f(newname.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(2, (int)f.tag()->attributeListMap()["WM/AlbumTitle"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(
|
||||
f.tag()->attributeListMap()["WM/AlbumTitle"].size()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,7 +122,7 @@ public:
|
||||
{
|
||||
ASF::File f(newname.c_str());
|
||||
CPPUNIT_ASSERT(!f.tag()->contains("WM/TrackNumber"));
|
||||
f.tag()->setAttribute("WM/TrackNumber", (unsigned int)(123));
|
||||
f.tag()->setAttribute("WM/TrackNumber", static_cast<unsigned int>(123));
|
||||
f.save();
|
||||
}
|
||||
{
|
||||
@ -129,7 +130,7 @@ public:
|
||||
CPPUNIT_ASSERT(f.tag()->contains("WM/TrackNumber"));
|
||||
CPPUNIT_ASSERT_EQUAL(ASF::Attribute::DWordType,
|
||||
f.tag()->attribute("WM/TrackNumber").front().type());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)123, f.tag()->track());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(123), f.tag()->track());
|
||||
f.tag()->setTrack(234);
|
||||
f.save();
|
||||
}
|
||||
@ -138,7 +139,7 @@ public:
|
||||
CPPUNIT_ASSERT(f.tag()->contains("WM/TrackNumber"));
|
||||
CPPUNIT_ASSERT_EQUAL(ASF::Attribute::UnicodeType,
|
||||
f.tag()->attribute("WM/TrackNumber").front().type());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)234, f.tag()->track());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(234), f.tag()->track());
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,7 +218,7 @@ public:
|
||||
{
|
||||
ASF::File f(newname.c_str());
|
||||
ASF::AttributeList values2 = f.tag()->attribute("WM/Picture");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, values2.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), values2.size());
|
||||
ASF::Attribute attr2 = values2.front();
|
||||
ASF::Picture picture2 = attr2.toPicture();
|
||||
CPPUNIT_ASSERT(picture2.isValid());
|
||||
@ -254,7 +255,7 @@ public:
|
||||
{
|
||||
ASF::File f(newname.c_str());
|
||||
ASF::AttributeList values2 = f.tag()->attribute("WM/Picture");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, values2.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), values2.size());
|
||||
ASF::Picture picture3 = values2[1].toPicture();
|
||||
CPPUNIT_ASSERT(picture3.isValid());
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), picture3.mimeType());
|
||||
|
@ -182,19 +182,19 @@ public:
|
||||
{
|
||||
const ByteVector data("\x00\xff\x01\xff\x00\xff\x01\xff\x00\xff\x01\xff\x00\xff", 14);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((short)0x00ff, data.toShort());
|
||||
CPPUNIT_ASSERT_EQUAL((short)0xff00, data.toShort(false));
|
||||
CPPUNIT_ASSERT_EQUAL((short)0xff01, data.toShort(5U));
|
||||
CPPUNIT_ASSERT_EQUAL((short)0x01ff, data.toShort(5U, false));
|
||||
CPPUNIT_ASSERT_EQUAL((short)0xff, data.toShort(13U));
|
||||
CPPUNIT_ASSERT_EQUAL((short)0xff, data.toShort(13U, false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<short>(0x00ff), data.toShort());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<short>(0xff00), data.toShort(false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<short>(0xff01), data.toShort(5U));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<short>(0x01ff), data.toShort(5U, false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<short>(0xff), data.toShort(13U));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<short>(0xff), data.toShort(13U, false));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)0x00ff, data.toUShort());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)0xff00, data.toUShort(false));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)0xff01, data.toUShort(5U));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)0x01ff, data.toUShort(5U, false));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)0xff, data.toUShort(13U));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)0xff, data.toUShort(13U, false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0x00ff), data.toUShort());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0xff00), data.toUShort(false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0xff01), data.toUShort(5U));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0x01ff), data.toUShort(5U, false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0xff), data.toUShort(13U));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0xff), data.toUShort(13U, false));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0x00ff01ffU, data.toUInt());
|
||||
CPPUNIT_ASSERT_EQUAL(0xff01ff00U, data.toUInt(false));
|
||||
@ -210,12 +210,12 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(0x00ffU, data.toUInt(12U, 3U));
|
||||
CPPUNIT_ASSERT_EQUAL(0xff00U, data.toUInt(12U, 3U, false));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((long long)0x00ff01ff00ff01ffULL, data.toLongLong());
|
||||
CPPUNIT_ASSERT_EQUAL((long long)0xff01ff00ff01ff00ULL, data.toLongLong(false));
|
||||
CPPUNIT_ASSERT_EQUAL((long long)0xff01ff00ff01ff00ULL, data.toLongLong(5U));
|
||||
CPPUNIT_ASSERT_EQUAL((long long)0x00ff01ff00ff01ffULL, data.toLongLong(5U, false));
|
||||
CPPUNIT_ASSERT_EQUAL((long long)0x00ffU, data.toLongLong(12U));
|
||||
CPPUNIT_ASSERT_EQUAL((long long)0xff00U, data.toLongLong(12U, false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<long long>(0x00ff01ff00ff01ffULL), data.toLongLong());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<long long>(0xff01ff00ff01ff00ULL), data.toLongLong(false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<long long>(0xff01ff00ff01ff00ULL), data.toLongLong(5U));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<long long>(0x00ff01ff00ff01ffULL), data.toLongLong(5U, false));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<long long>(0x00ffU), data.toLongLong(12U));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<long long>(0xff00U), data.toLongLong(12U, false));
|
||||
}
|
||||
|
||||
void testFloatingPointConversion()
|
||||
@ -404,24 +404,24 @@ public:
|
||||
ByteVector a = ByteVector("0123456789");
|
||||
ByteVector b = a.mid(3, 4);
|
||||
b.resize(6, 'A');
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)6, b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(6), b.size());
|
||||
CPPUNIT_ASSERT_EQUAL('6', b[3]);
|
||||
CPPUNIT_ASSERT_EQUAL('A', b[4]);
|
||||
CPPUNIT_ASSERT_EQUAL('A', b[5]);
|
||||
b.resize(10, 'B');
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)10, b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(10), b.size());
|
||||
CPPUNIT_ASSERT_EQUAL('6', b[3]);
|
||||
CPPUNIT_ASSERT_EQUAL('B', b[6]);
|
||||
CPPUNIT_ASSERT_EQUAL('B', b[9]);
|
||||
b.resize(3, 'C');
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(-1, b.find('C'));
|
||||
b.resize(3);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), b.size());
|
||||
|
||||
// Check if a and b were properly detached.
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)10, a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(10), a.size());
|
||||
CPPUNIT_ASSERT_EQUAL('3', a[3]);
|
||||
CPPUNIT_ASSERT_EQUAL('5', a[5]);
|
||||
|
||||
@ -429,17 +429,17 @@ public:
|
||||
|
||||
ByteVector c = ByteVector("0123456789").mid(3, 4);
|
||||
c.resize(6, 'A');
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)6, c.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(6), c.size());
|
||||
CPPUNIT_ASSERT_EQUAL('6', c[3]);
|
||||
CPPUNIT_ASSERT_EQUAL('A', c[4]);
|
||||
CPPUNIT_ASSERT_EQUAL('A', c[5]);
|
||||
c.resize(10, 'B');
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)10, c.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(10), c.size());
|
||||
CPPUNIT_ASSERT_EQUAL('6', c[3]);
|
||||
CPPUNIT_ASSERT_EQUAL('B', c[6]);
|
||||
CPPUNIT_ASSERT_EQUAL('B', c[9]);
|
||||
c.resize(3, 'C');
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, c.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), c.size());
|
||||
CPPUNIT_ASSERT_EQUAL(-1, c.find('C'));
|
||||
}
|
||||
|
||||
@ -524,12 +524,12 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(t2, ByteVector::fromBase64(s2.toBase64()));
|
||||
CPPUNIT_ASSERT_EQUAL(t3, ByteVector::fromBase64(s3.toBase64()));
|
||||
|
||||
ByteVector all((unsigned int)256);
|
||||
ByteVector all(static_cast<unsigned int>(256));
|
||||
|
||||
// in order
|
||||
{
|
||||
for(int i = 0; i < 256; i++){
|
||||
all[i]=(unsigned char)i;
|
||||
all[i]=static_cast<unsigned char>(i);
|
||||
}
|
||||
ByteVector b64 = all.toBase64();
|
||||
ByteVector original = ByteVector::fromBase64(b64);
|
||||
@ -539,7 +539,7 @@ public:
|
||||
// reverse
|
||||
{
|
||||
for(int i = 0; i < 256; i++){
|
||||
all[i]=(unsigned char)255-i;
|
||||
all[i]=static_cast<unsigned char>(255)-i;
|
||||
}
|
||||
ByteVector b64 = all.toBase64();
|
||||
ByteVector original = ByteVector::fromBase64(b64);
|
||||
@ -559,7 +559,7 @@ public:
|
||||
// all ones
|
||||
{
|
||||
for(int i = 0; i < 256; i++){
|
||||
all[i]=(unsigned char)0xff;
|
||||
all[i]=static_cast<unsigned char>(0xff);
|
||||
}
|
||||
ByteVector b64 = all.toBase64();
|
||||
ByteVector original = ByteVector::fromBase64(b64);
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
ByteVector v("a b");
|
||||
|
||||
ByteVectorList l = ByteVectorList::split(v, " ");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("a"), l[0]);
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("b"), l[1]);
|
||||
}
|
||||
@ -54,7 +54,7 @@ public:
|
||||
ByteVector v("a");
|
||||
|
||||
ByteVectorList l = ByteVectorList::split(v, " ");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("a"), l[0]);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
|
||||
file.seek(0);
|
||||
const ByteVector v = file.readBlock(file.length());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)10, v.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(10), v.size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(v.find("23")), file.find("23"));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(v.find("23", 2)), file.find("23", 2));
|
||||
@ -89,7 +89,7 @@ public:
|
||||
|
||||
file.seek(0);
|
||||
const ByteVector v = file.readBlock(file.length());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)10, v.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(10), v.size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(v.rfind("23")), file.rfind("23"));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(v.rfind("23", 7)), file.rfind("23", 7));
|
||||
|
@ -134,8 +134,8 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("Test!"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("albummmm"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->comment(), String("a comment"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)5);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2020);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), static_cast<unsigned int>(5));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), static_cast<unsigned int>(2020));
|
||||
f.tag()->setArtist("ttest artist");
|
||||
f.tag()->setTitle("ytest title");
|
||||
f.tag()->setGenre("uTest!");
|
||||
@ -153,8 +153,8 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("uTest!"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("ialbummmm"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->comment(), String("another comment"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)7);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2080);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), static_cast<unsigned int>(7));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), static_cast<unsigned int>(2080));
|
||||
}
|
||||
|
||||
{
|
||||
@ -167,8 +167,8 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("uTest!"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("ialbummmm"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->comment(), String("another comment"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)7);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2080);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), static_cast<unsigned int>(7));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), static_cast<unsigned int>(2080));
|
||||
f.tag()->setArtist("test artist");
|
||||
f.tag()->setTitle("test title");
|
||||
f.tag()->setGenre("Test!");
|
||||
@ -190,8 +190,8 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("Test!"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("albummmm"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->comment(), String("a comment"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)5);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2020);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), static_cast<unsigned int>(5));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), static_cast<unsigned int>(2020));
|
||||
|
||||
fs.seek(0);
|
||||
fileContent = fs.readBlock(fs.length());
|
||||
@ -207,8 +207,8 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("Test!"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("albummmm"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->comment(), String("a comment"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)5);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2020);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), static_cast<unsigned int>(5));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), static_cast<unsigned int>(2020));
|
||||
f.tag()->setArtist("ttest artist");
|
||||
f.tag()->setTitle("ytest title");
|
||||
f.tag()->setGenre("uTest!");
|
||||
@ -230,8 +230,8 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->genre(), String("uTest!"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->album(), String("ialbummmm"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->comment(), String("another comment"));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), (unsigned int)7);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), (unsigned int)2080);
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->track(), static_cast<unsigned int>(7));
|
||||
CPPUNIT_ASSERT_EQUAL(f.tag()->year(), static_cast<unsigned int>(2080));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
|
||||
FLAC::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), lst.size());
|
||||
|
||||
FLAC::Picture *pic = lst.front();
|
||||
CPPUNIT_ASSERT_EQUAL(FLAC::Picture::FrontCover, pic->type());
|
||||
@ -113,7 +113,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(0, pic->numColors());
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/png"), pic->mimeType());
|
||||
CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic->description());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic->data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(150), pic->data().size());
|
||||
}
|
||||
|
||||
void testAddPicture()
|
||||
@ -124,7 +124,7 @@ public:
|
||||
{
|
||||
FLAC::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), lst.size());
|
||||
|
||||
auto newpic = new FLAC::Picture();
|
||||
newpic->setType(FLAC::Picture::BackCover);
|
||||
@ -141,7 +141,7 @@ public:
|
||||
{
|
||||
FLAC::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), lst.size());
|
||||
|
||||
FLAC::Picture *pic = lst[0];
|
||||
CPPUNIT_ASSERT_EQUAL(FLAC::Picture::FrontCover, pic->type());
|
||||
@ -151,7 +151,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(0, pic->numColors());
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/png"), pic->mimeType());
|
||||
CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic->description());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic->data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(150), pic->data().size());
|
||||
|
||||
pic = lst[1];
|
||||
CPPUNIT_ASSERT_EQUAL(FLAC::Picture::BackCover, pic->type());
|
||||
@ -173,7 +173,7 @@ public:
|
||||
{
|
||||
FLAC::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), lst.size());
|
||||
|
||||
auto newpic = new FLAC::Picture();
|
||||
newpic->setType(FLAC::Picture::BackCover);
|
||||
@ -191,7 +191,7 @@ public:
|
||||
{
|
||||
FLAC::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), lst.size());
|
||||
|
||||
FLAC::Picture *pic = lst[0];
|
||||
CPPUNIT_ASSERT_EQUAL(FLAC::Picture::BackCover, pic->type());
|
||||
@ -213,7 +213,7 @@ public:
|
||||
{
|
||||
FLAC::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), lst.size());
|
||||
|
||||
f.removePictures();
|
||||
f.save();
|
||||
@ -221,7 +221,7 @@ public:
|
||||
{
|
||||
FLAC::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), lst.size());
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ public:
|
||||
{
|
||||
FLAC::File f(newname.c_str());
|
||||
Ogg::FieldListMap m = f.xiphComment()->fieldListMap();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, m["ARTIST"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), m["ARTIST"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("artist 1"), m["ARTIST"][0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("artist 2"), m["ARTIST"][1]);
|
||||
}
|
||||
@ -308,7 +308,7 @@ public:
|
||||
{
|
||||
FLAC::File f(newname.c_str());
|
||||
PropertyMap dict = f.properties();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["ARTIST"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), dict["ARTIST"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("artøst 1"), dict["ARTIST"][0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("artöst 2"), dict["ARTIST"][1]);
|
||||
}
|
||||
@ -375,8 +375,8 @@ public:
|
||||
map[L"H\x00c4\x00d6"] = String("bla");
|
||||
FLAC::File f(copy.fileName().c_str());
|
||||
PropertyMap invalid = f.setProperties(map);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, invalid.size());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.properties().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), invalid.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.properties().size());
|
||||
}
|
||||
|
||||
void testAudioProperties()
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(0, pic.numColors());
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/png"), pic.mimeType());
|
||||
CPPUNIT_ASSERT_EQUAL(String("A pixel."), pic.description());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)150, pic.data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(150), pic.data().size());
|
||||
}
|
||||
|
||||
void testPassThrough()
|
||||
|
@ -166,7 +166,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(true, file.hasID3v2Tag());
|
||||
|
||||
ByteVector data = f->render();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4+4+2+1+6+2), data.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4+4+2+1+6+2), data.size());
|
||||
|
||||
ID3v2::TextIdentificationFrame f2(data);
|
||||
CPPUNIT_ASSERT_EQUAL(sl, f2.fieldList());
|
||||
@ -186,7 +186,7 @@ public:
|
||||
CPPUNIT_ASSERT(file.hasID3v2Tag());
|
||||
|
||||
ByteVector data = f->render();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4+4+2+1+3+2+2+6+2), data.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4+4+2+1+3+2+2+6+2), data.size());
|
||||
|
||||
ID3v2::UnsynchronizedLyricsFrame f2(data);
|
||||
CPPUNIT_ASSERT_EQUAL(String("Foo"), f2.text());
|
||||
@ -201,7 +201,7 @@ public:
|
||||
sl.append("Bar");
|
||||
f.setText(sl);
|
||||
ByteVector data = f.render();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4+4+2+1+6+2+6), data.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4+4+2+1+6+2+6), data.size());
|
||||
ByteVector noBomBeData("TPE1\x00\x00\x00\x0f\x00\x00\x02"
|
||||
"\0F\0o\0o\0\0"
|
||||
"\0B\0a\0r", 25);
|
||||
@ -218,7 +218,7 @@ public:
|
||||
sl.append("Bar");
|
||||
f.setText(sl);
|
||||
ByteVector data = f.render();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4+4+2+1+8+2+8), data.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4+4+2+1+8+2+8), data.size());
|
||||
ByteVector multiBomLeData("TPE1\x00\x00\x00\x13\x00\x00\x01\xff\xfe"
|
||||
"F\0o\0o\0\0\0" "\xff\xfe"
|
||||
"B\0a\0r\0", 29);
|
||||
@ -351,7 +351,7 @@ public:
|
||||
|
||||
ID3v2::Tag tag;
|
||||
tag.addFrame(frame);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1034, tag.render().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1034), tag.render().size());
|
||||
}
|
||||
|
||||
// http://bugs.kde.org/show_bug.cgi?id=151078
|
||||
@ -400,7 +400,7 @@ public:
|
||||
"\x00\x00\x00\x03", 33));
|
||||
CPPUNIT_ASSERT_EQUAL(String("email@example.com"), f.email());
|
||||
CPPUNIT_ASSERT_EQUAL(2, f.rating());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, f.counter());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), f.counter());
|
||||
}
|
||||
|
||||
void testParsePOPMWithoutCounter()
|
||||
@ -412,7 +412,7 @@ public:
|
||||
"\x02", 29));
|
||||
CPPUNIT_ASSERT_EQUAL(String("email@example.com"), f.email());
|
||||
CPPUNIT_ASSERT_EQUAL(2, f.rating());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.counter());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.counter());
|
||||
}
|
||||
|
||||
void testRenderPOPM()
|
||||
@ -480,7 +480,7 @@ public:
|
||||
f.volumeAdjustment(ID3v2::RelativeVolumeFrame::FrontRight));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<short>(15),
|
||||
f.volumeAdjustmentIndex(ID3v2::RelativeVolumeFrame::FrontRight));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char)8,
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(8),
|
||||
f.peakVolume(ID3v2::RelativeVolumeFrame::FrontRight).bitsRepresentingPeak);
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("\x45"),
|
||||
f.peakVolume(ID3v2::RelativeVolumeFrame::FrontRight).peakVolume);
|
||||
@ -654,11 +654,11 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchronizedLyricsFrame::Lyrics, f.type());
|
||||
CPPUNIT_ASSERT_EQUAL(String("foo"), f.description());
|
||||
ID3v2::SynchronizedLyricsFrame::SynchedTextList stl = f.synchedText();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, stl.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), stl.size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Example"), stl[0].text);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1234, stl[0].time);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1234), stl[0].time);
|
||||
CPPUNIT_ASSERT_EQUAL(String("Lyrics"), stl[1].text);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)4567, stl[1].time);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4567), stl[1].time);
|
||||
}
|
||||
|
||||
void testParseSynchronizedLyricsFrameWithEmptyDescritpion()
|
||||
@ -683,11 +683,11 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchronizedLyricsFrame::Lyrics, f.type());
|
||||
CPPUNIT_ASSERT(f.description().isEmpty());
|
||||
ID3v2::SynchronizedLyricsFrame::SynchedTextList stl = f.synchedText();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, stl.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), stl.size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Example"), stl[0].text);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1234, stl[0].time);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1234), stl[0].time);
|
||||
CPPUNIT_ASSERT_EQUAL(String("Lyrics"), stl[1].text);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)4567, stl[1].time);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4567), stl[1].time);
|
||||
}
|
||||
|
||||
void testRenderSynchronizedLyricsFrame()
|
||||
@ -732,11 +732,11 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::AbsoluteMilliseconds,
|
||||
f.timestampFormat());
|
||||
ID3v2::EventTimingCodesFrame::SynchedEventList sel = f.synchedEvents();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, sel.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), sel.size());
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::IntroStart, sel[0].type);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)62300, sel[0].time);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(62300), sel[0].time);
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::EventTimingCodesFrame::AudioFileEnds, sel[1].type);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3600000, sel[1].time);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3600000), sel[1].time);
|
||||
}
|
||||
|
||||
void testRenderEventTimingCodesFrame()
|
||||
@ -927,7 +927,7 @@ public:
|
||||
header.setMajorVersion(3);
|
||||
auto frame =
|
||||
dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, frame->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), frame->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Death Metal"), frame->fieldList()[0]);
|
||||
|
||||
ID3v2::Tag tag;
|
||||
@ -948,7 +948,7 @@ public:
|
||||
header.setMajorVersion(3);
|
||||
auto frame =
|
||||
dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, frame->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), frame->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("4"), frame->fieldList()[0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("Eurodisco"), frame->fieldList()[1]);
|
||||
|
||||
@ -991,7 +991,7 @@ public:
|
||||
ID3v2::Header header;
|
||||
auto frame =
|
||||
dynamic_cast<TagLib::ID3v2::TextIdentificationFrame*>(factory->createFrame(data, &header));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, frame->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), frame->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("14"), frame->fieldList()[0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("Eurodisco"), frame->fieldList()[1]);
|
||||
|
||||
@ -1004,7 +1004,7 @@ public:
|
||||
{
|
||||
MPEG::File f(TEST_FILE_PATH_C("id3v22-tda.mp3"), false);
|
||||
CPPUNIT_ASSERT(f.tag());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2010, f.tag()->year());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2010), f.tag()->year());
|
||||
}
|
||||
|
||||
void testUpdateFullDate22()
|
||||
@ -1051,15 +1051,15 @@ public:
|
||||
MPEG::File bar(newname.c_str());
|
||||
tf = dynamic_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDOR").front());
|
||||
CPPUNIT_ASSERT(tf);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, tf->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), tf->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("2011"), tf->fieldList().front());
|
||||
tf = dynamic_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TDRC").front());
|
||||
CPPUNIT_ASSERT(tf);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, tf->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), tf->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("2012-04-17T12:01"), tf->fieldList().front());
|
||||
tf = dynamic_cast<ID3v2::TextIdentificationFrame *>(bar.ID3v2Tag()->frameList("TIPL").front());
|
||||
CPPUNIT_ASSERT(tf);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)8, tf->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(8), tf->fieldList().size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Guitar"), tf->fieldList()[0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("Artist 1"), tf->fieldList()[1]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("Drums"), tf->fieldList()[2]);
|
||||
@ -1126,7 +1126,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/bmp"), frame->mimeType());
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::Other, frame->type());
|
||||
CPPUNIT_ASSERT_EQUAL(String(""), frame->description());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)86414, frame->picture().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(86414), frame->picture().size());
|
||||
}
|
||||
else {
|
||||
// Skip the test if ZLIB is not installed.
|
||||
@ -1154,12 +1154,12 @@ public:
|
||||
string newname = copy.fileName();
|
||||
MPEG::File f(newname.c_str());
|
||||
PropertyMap dict = f.ID3v2Tag(false)->properties();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)6, dict.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(6), dict.size());
|
||||
|
||||
CPPUNIT_ASSERT(dict.contains("USERTEXTDESCRIPTION1"));
|
||||
CPPUNIT_ASSERT(dict.contains("QuodLibet::USERTEXTDESCRIPTION2"));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["USERTEXTDESCRIPTION1"].size());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, dict["QuodLibet::USERTEXTDESCRIPTION2"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), dict["USERTEXTDESCRIPTION1"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), dict["QuodLibet::USERTEXTDESCRIPTION2"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("userTextData1"), dict["USERTEXTDESCRIPTION1"][0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("userTextData2"), dict["USERTEXTDESCRIPTION1"][1]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("userTextData1"), dict["QuodLibet::USERTEXTDESCRIPTION2"][0]);
|
||||
@ -1241,7 +1241,7 @@ public:
|
||||
tag.removeUnsupportedProperties(properties.unsupportedData());
|
||||
CPPUNIT_ASSERT(tag.frameList("APIC").isEmpty());
|
||||
CPPUNIT_ASSERT(tag.frameList("TIPL").isEmpty());
|
||||
CPPUNIT_ASSERT_EQUAL((ID3v2::UniqueFileIdentifierFrame *)nullptr, ID3v2::UniqueFileIdentifierFrame::findByOwner(&tag, "http://example.com"));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<ID3v2::UniqueFileIdentifierFrame *>(nullptr), ID3v2::UniqueFileIdentifierFrame::findByOwner(&tag, "http://example.com"));
|
||||
CPPUNIT_ASSERT_EQUAL(frame6, ID3v2::UniqueFileIdentifierFrame::findByOwner(&tag, "http://musicbrainz.org"));
|
||||
}
|
||||
|
||||
@ -1383,20 +1383,20 @@ public:
|
||||
ID3v2::ChapterFrame f1(&header, chapterData);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f1.elementID());
|
||||
CPPUNIT_ASSERT((unsigned int)0x03 == f1.startTime());
|
||||
CPPUNIT_ASSERT((unsigned int)0x05 == f1.endTime());
|
||||
CPPUNIT_ASSERT((unsigned int)0x02 == f1.startOffset());
|
||||
CPPUNIT_ASSERT((unsigned int)0x03 == f1.endOffset());
|
||||
CPPUNIT_ASSERT((unsigned int)0x00 == f1.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x03) == f1.startTime());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x05) == f1.endTime());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x02) == f1.startOffset());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x03) == f1.endOffset());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x00) == f1.embeddedFrameList().size());
|
||||
|
||||
ID3v2::ChapterFrame f2(&header, chapterData + embeddedFrameData);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f2.elementID());
|
||||
CPPUNIT_ASSERT((unsigned int)0x03 == f2.startTime());
|
||||
CPPUNIT_ASSERT((unsigned int)0x05 == f2.endTime());
|
||||
CPPUNIT_ASSERT((unsigned int)0x02 == f2.startOffset());
|
||||
CPPUNIT_ASSERT((unsigned int)0x03 == f2.endOffset());
|
||||
CPPUNIT_ASSERT((unsigned int)0x01 == f2.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x03) == f2.startTime());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x05) == f2.endTime());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x02) == f2.startOffset());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x03) == f2.endOffset());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x01) == f2.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT(f2.embeddedFrameList("TIT2").size() == 1);
|
||||
CPPUNIT_ASSERT(f2.embeddedFrameList("TIT2")[0]->toString() == "CH1");
|
||||
}
|
||||
@ -1489,10 +1489,10 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("T"), f.elementID());
|
||||
CPPUNIT_ASSERT(!f.isTopLevel());
|
||||
CPPUNIT_ASSERT(f.isOrdered());
|
||||
CPPUNIT_ASSERT((unsigned int)0x02 == f.entryCount());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x02) == f.entryCount());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f.childElements()[0]);
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("D"), f.childElements()[1]);
|
||||
CPPUNIT_ASSERT((unsigned int)0x01 == f.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT(static_cast<unsigned int>(0x01) == f.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT(f.embeddedFrameList("TIT2").size() == 1);
|
||||
CPPUNIT_ASSERT(f.embeddedFrameList("TIT2")[0]->toString() == "TC1");
|
||||
|
||||
@ -1604,7 +1604,7 @@ public:
|
||||
// Sample rate will be 32000 if we can't skip the second tag.
|
||||
|
||||
CPPUNIT_ASSERT(f.hasID3v2Tag());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)8049, f.ID3v2Tag()->header()->completeTagSize());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(8049), f.ID3v2Tag()->header()->completeTagSize());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
|
||||
|
||||
@ -1615,7 +1615,7 @@ public:
|
||||
MPEG::File f(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT(f.hasID3v2Tag());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(3594), f.length());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1505, f.ID3v2Tag()->header()->completeTagSize());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1505), f.ID3v2Tag()->header()->completeTagSize());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f.ID3v2Tag()->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
|
||||
|
||||
|
@ -59,14 +59,14 @@ public:
|
||||
{
|
||||
RIFF::Info::Tag tag;
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0, tag.track());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), tag.track());
|
||||
tag.setTrack(1234);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1234, tag.track());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1234), tag.track());
|
||||
CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("IPRT"));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0, tag.year());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), tag.year());
|
||||
tag.setYear(1234);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1234, tag.year());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1234), tag.year());
|
||||
CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("ICRD"));
|
||||
}
|
||||
};
|
||||
|
@ -111,20 +111,20 @@ private:
|
||||
CPPUNIT_ASSERT_EQUAL( 0, p->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL( 0, p->sampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(64, p->channels());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0), p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL(true, p->stereo());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->instrumentCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 5, p->sampleCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->patternCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)535, p->version());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)532, p->compatibleVersion());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 9, p->flags());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char)128, p->globalVolume());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char) 48, p->mixVolume());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char)125, p->tempo());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char) 6, p->bpmSpeed());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char)128, p->panningSeparation());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char) 0, p->pitchWheelDepth());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0), p->instrumentCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(5), p->sampleCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(1), p->patternCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(535), p->version());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(532), p->compatibleVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(9), p->flags());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(128), p->globalVolume());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(48), p->mixVolume());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(125), p->tempo());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(6), p->bpmSpeed());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(128), p->panningSeparation());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(0), p->pitchWheelDepth());
|
||||
CPPUNIT_ASSERT_EQUAL(title, t->title());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->album());
|
||||
|
@ -118,7 +118,7 @@ private:
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->sampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(8, p->channels());
|
||||
CPPUNIT_ASSERT_EQUAL(31U, p->instrumentCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char)1, p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(1), p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL(title, t->title());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->album());
|
||||
|
@ -326,11 +326,11 @@ public:
|
||||
MP4::File f(TEST_FILE_PATH_C("has-tags.m4a"));
|
||||
CPPUNIT_ASSERT(f.tag()->contains("covr"));
|
||||
MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(79), l[0].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(287), l[1].data().size());
|
||||
}
|
||||
|
||||
void testCovrWrite()
|
||||
@ -350,13 +350,13 @@ public:
|
||||
MP4::File f(filename.c_str());
|
||||
CPPUNIT_ASSERT(f.tag()->contains("covr"));
|
||||
MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(79), l[0].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(287), l[1].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[2].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, l[2].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), l[2].data().size());
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,11 +365,11 @@ public:
|
||||
MP4::File f(TEST_FILE_PATH_C("covr-junk.m4a"));
|
||||
CPPUNIT_ASSERT(f.tag()->contains("covr"));
|
||||
MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(79), l[0].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(287), l[1].data().size());
|
||||
}
|
||||
|
||||
void testProperties()
|
||||
@ -700,11 +700,11 @@ public:
|
||||
|
||||
CPPUNIT_ASSERT(f.tag()->contains("covr"));
|
||||
MP4::CoverArtList l = f.tag()->item("covr").toCoverArtList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), l.size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::PNG, l[0].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)79, l[0].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(79), l[0].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(MP4::CoverArt::JPEG, l[1].format());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)287, l[1].data().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(287), l[1].data().size());
|
||||
|
||||
PropertyMap properties = f.properties();
|
||||
CPPUNIT_ASSERT_EQUAL(StringList("Test Artist!!!!"), properties["ARTIST"]);
|
||||
|
@ -186,7 +186,7 @@ public:
|
||||
}
|
||||
{
|
||||
MPEG::File f2(newname.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)4, f2.ID3v2Tag()->header()->majorVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4), f2.ID3v2Tag()->header()->majorVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title());
|
||||
}
|
||||
@ -209,7 +209,7 @@ public:
|
||||
}
|
||||
{
|
||||
MPEG::File f2(newname.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, f2.ID3v2Tag()->header()->majorVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), f2.ID3v2Tag()->header()->majorVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title());
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public:
|
||||
|
||||
Vorbis::File f(newname.c_str());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0, f.tag()->properties().size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.tag()->properties().size());
|
||||
|
||||
PropertyMap newTags;
|
||||
StringList values("value 1");
|
||||
@ -155,8 +155,8 @@ public:
|
||||
f.tag()->setProperties(newTags);
|
||||
|
||||
PropertyMap map = f.tag()->properties();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, map.size());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, map["ARTIST"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), map.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), map["ARTIST"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("value 1"), map["ARTIST"][0]);
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ public:
|
||||
Vorbis::File f(newname.c_str());
|
||||
PropertyMap tags = f.tag()->properties();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, tags["UNUSUALTAG"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), tags["UNUSUALTAG"].size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("usual value"), tags["UNUSUALTAG"][0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("another value"), tags["UNUSUALTAG"][1]);
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
@ -210,7 +210,7 @@ public:
|
||||
f.save();
|
||||
|
||||
f.seek(0x50);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0x3d3bd92d, f.readBlock(4).toUInt(0, true));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0x3d3bd92d), f.readBlock(4).toUInt(0, true));
|
||||
}
|
||||
{
|
||||
Vorbis::File f(copy.fileName().c_str());
|
||||
@ -218,7 +218,7 @@ public:
|
||||
f.save();
|
||||
|
||||
f.seek(0x50);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0xd985291c, f.readBlock(4).toUInt(0, true));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0xd985291c), f.readBlock(4).toUInt(0, true));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public:
|
||||
PublicRIFF f(filename.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("foo"), f.chunkData(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(0x1728 + 8), f.chunkOffset(2));
|
||||
|
||||
f.setChunkData("SSND", "abcd");
|
||||
@ -121,32 +121,32 @@ public:
|
||||
{
|
||||
PublicRIFF f(filename.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(0xff0 + 8), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4400), f.length());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4399 - 8), f.riffSize());
|
||||
f.setChunkData("TEST", "abcd");
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4088), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4408), f.chunkOffset(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4412 - 8), f.riffSize());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4412 - 8), f.riffSize());
|
||||
}
|
||||
{
|
||||
PublicRIFF f(filename.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4088), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4408), f.chunkOffset(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4412), f.length());
|
||||
}
|
||||
}
|
||||
@ -159,32 +159,32 @@ public:
|
||||
{
|
||||
PublicRIFF f(filename.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(0xff0 + 8), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4399), f.length());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4399 - 8), f.riffSize());
|
||||
f.setChunkData("TEST", "abcd");
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4088), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4408), f.chunkOffset(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4412 - 8), f.riffSize());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4412 - 8), f.riffSize());
|
||||
}
|
||||
{
|
||||
PublicRIFF f(filename.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4088), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4408), f.chunkOffset(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4412), f.length());
|
||||
}
|
||||
}
|
||||
@ -197,32 +197,32 @@ public:
|
||||
{
|
||||
PublicRIFF f(filename.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(0xff0 + 8), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(0), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4399), f.length());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4399 - 8), f.riffSize());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4399 - 8), f.riffSize());
|
||||
f.setChunkData("TEST", "abc");
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4088), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4408), f.chunkOffset(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(4412 - 8), f.riffSize());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(4412 - 8), f.riffSize());
|
||||
}
|
||||
{
|
||||
PublicRIFF f(filename.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4088), f.chunkOffset(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(311), f.chunkDataSize(2));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("SSND"), f.chunkName(2));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(2));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4408), f.chunkOffset(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(3), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), f.chunkDataSize(3));
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("TEST"), f.chunkName(3));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)(1), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), f.chunkPadding(3));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<offset_t>(4412), f.length());
|
||||
}
|
||||
}
|
||||
|
@ -102,17 +102,17 @@ private:
|
||||
CPPUNIT_ASSERT_EQUAL( 0, p->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL( 0, p->sampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(16, p->channels());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0), p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL(false, p->stereo());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 5, p->sampleCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->patternCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->flags());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)4896, p->trackerVersion());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 2, p->fileFormatVersion());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char) 64, p->globalVolume());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char) 48, p->masterVolume());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char)125, p->tempo());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned char) 6, p->bpmSpeed());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(5), p->sampleCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(1), p->patternCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0), p->flags());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(4896), p->trackerVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(2), p->fileFormatVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(64), p->globalVolume());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(48), p->masterVolume());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(125), p->tempo());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(6), p->bpmSpeed());
|
||||
CPPUNIT_ASSERT_EQUAL(title, t->title());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->album());
|
||||
|
@ -276,9 +276,9 @@ public:
|
||||
ByteVector lf("abc\x0axyz", 7);
|
||||
ByteVector crlf("abc\x0d\x0axyz", 8);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)7, String(cr).size());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)7, String(lf).size());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)8, String(crlf).size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(7), String(cr).size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(7), String(lf).size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(8), String(crlf).size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(L'\x0d', String(cr)[3]);
|
||||
CPPUNIT_ASSERT_EQUAL(L'\x0a', String(lf)[3]);
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
char data[] = { 0, 0, 0, 127 };
|
||||
ByteVector v(data, 4);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)127);
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), static_cast<unsigned int>(127));
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(127), v);
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ public:
|
||||
char data[] = { 0, 0, 1, 0 };
|
||||
ByteVector v(data, 4);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)128);
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), static_cast<unsigned int>(128));
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(128), v);
|
||||
}
|
||||
|
||||
@ -69,32 +69,32 @@ public:
|
||||
char data[] = { 0, 0, 1, 1 };
|
||||
ByteVector v(data, 4);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), (unsigned int)129);
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), static_cast<unsigned int>(129));
|
||||
CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(129), v);
|
||||
}
|
||||
|
||||
void testToUIntBroken()
|
||||
{
|
||||
char data[] = { 0, 0, 0, (char)-1 };
|
||||
char data2[] = { 0, 0, (char)-1, (char)-1 };
|
||||
char data[] = { 0, 0, 0, static_cast<char>(-1) };
|
||||
char data2[] = { 0, 0, static_cast<char>(-1), static_cast<char>(-1) };
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)255, ID3v2::SynchData::toUInt(ByteVector(data, 4)));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)65535, ID3v2::SynchData::toUInt(ByteVector(data2, 4)));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(255), ID3v2::SynchData::toUInt(ByteVector(data, 4)));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(65535), ID3v2::SynchData::toUInt(ByteVector(data2, 4)));
|
||||
}
|
||||
|
||||
void testToUIntBrokenAndTooLarge()
|
||||
{
|
||||
char data[] = { 0, 0, 0, (char)-1, 0 };
|
||||
char data[] = { 0, 0, 0, static_cast<char>(-1), 0 };
|
||||
ByteVector v(data, 5);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)255, ID3v2::SynchData::toUInt(v));
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(255), ID3v2::SynchData::toUInt(v));
|
||||
}
|
||||
|
||||
void testDecode1()
|
||||
{
|
||||
ByteVector a("\xff\x00\x00", 3);
|
||||
a = ID3v2::SynchData::decode(a);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\x00", 2), a);
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ public:
|
||||
{
|
||||
ByteVector a("\xff\x44", 2);
|
||||
a = ID3v2::SynchData::decode(a);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\x44", 2), a);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ public:
|
||||
{
|
||||
ByteVector a("\xff\xff\x00", 3);
|
||||
a = ID3v2::SynchData::decode(a);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2, a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2), a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\xff", 2), a);
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ public:
|
||||
{
|
||||
ByteVector a("\xff\xff\xff", 3);
|
||||
a = ID3v2::SynchData::decode(a);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\xff\xff", 3), a);
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ public:
|
||||
}
|
||||
{
|
||||
RIFF::WAV::File f2(newname.c_str());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)3, f2.ID3v2Tag()->header()->majorVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(3), f2.ID3v2Tag()->header()->majorVersion());
|
||||
CPPUNIT_ASSERT_EQUAL(String("Artist A"), f2.tag()->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(xxx, f2.tag()->title());
|
||||
}
|
||||
|
@ -55,11 +55,11 @@ public:
|
||||
void testYear()
|
||||
{
|
||||
Ogg::XiphComment cmt;
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0, cmt.year());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), cmt.year());
|
||||
cmt.addField("YEAR", "2009");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2009, cmt.year());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2009), cmt.year());
|
||||
cmt.addField("DATE", "2008");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)2008, cmt.year());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(2008), cmt.year());
|
||||
}
|
||||
|
||||
void testSetYear()
|
||||
@ -75,11 +75,11 @@ public:
|
||||
void testTrack()
|
||||
{
|
||||
Ogg::XiphComment cmt;
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)0, cmt.track());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(0), cmt.track());
|
||||
cmt.addField("TRACKNUM", "7");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)7, cmt.track());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(7), cmt.track());
|
||||
cmt.addField("TRACKNUMBER", "8");
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)8, cmt.track());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(8), cmt.track());
|
||||
}
|
||||
|
||||
void testSetTrack()
|
||||
@ -103,7 +103,7 @@ public:
|
||||
|
||||
Ogg::XiphComment cmt;
|
||||
PropertyMap unsuccessful = cmt.setProperties(map);
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)5, unsuccessful.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(5), unsuccessful.size());
|
||||
CPPUNIT_ASSERT(cmt.properties().isEmpty());
|
||||
}
|
||||
|
||||
@ -182,11 +182,11 @@ public:
|
||||
{
|
||||
Vorbis::File f(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f.tag()->pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL((int)5, lst[0]->width());
|
||||
CPPUNIT_ASSERT_EQUAL((int)6, lst[0]->height());
|
||||
CPPUNIT_ASSERT_EQUAL((int)16, lst[0]->colorDepth());
|
||||
CPPUNIT_ASSERT_EQUAL((int)7, lst[0]->numColors());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<int>(5), lst[0]->width());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<int>(6), lst[0]->height());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<int>(16), lst[0]->colorDepth());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<int>(7), lst[0]->numColors());
|
||||
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), lst[0]->mimeType());
|
||||
CPPUNIT_ASSERT_EQUAL(String("new image"), lst[0]->description());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("JPEG data"), lst[0]->data());
|
||||
@ -201,7 +201,7 @@ public:
|
||||
List<FLAC::Picture *> lst = f.tag()->pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL(String("TEST TITLE"), f.tag()->title());
|
||||
CPPUNIT_ASSERT_EQUAL(String("TEST ARTIST"), f.tag()->artist());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int)1, lst.size());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(1), lst.size());
|
||||
f.save();
|
||||
}
|
||||
{
|
||||
|
@ -134,14 +134,14 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->sampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(8, p->channels());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->version());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 0 , p->restartPosition());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->patternCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->instrumentCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->flags());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 6, p->tempo());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)125, p->bpmSpeed());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(1), p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0), p->version());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0) , p->restartPosition());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(1), p->patternCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0), p->instrumentCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(1), p->flags());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(6), p->tempo());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(125), p->bpmSpeed());
|
||||
CPPUNIT_ASSERT_EQUAL(titleBefore, t->title());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->album());
|
||||
@ -180,14 +180,14 @@ private:
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->sampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(8, p->channels());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)260, p->version());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 0, p->restartPosition());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->patternCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)128, p->instrumentCount());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 1, p->flags());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short) 6, p->tempo());
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned short)125, p->bpmSpeed());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(1), p->lengthInPatterns());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(260), p->version());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(0), p->restartPosition());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(1), p->patternCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(128), p->instrumentCount());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(1), p->flags());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(6), p->tempo());
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned short>(125), p->bpmSpeed());
|
||||
CPPUNIT_ASSERT_EQUAL(title, t->title());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->artist());
|
||||
CPPUNIT_ASSERT_EQUAL(String(), t->album());
|
||||
|
Loading…
x
Reference in New Issue
Block a user