mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Silence uint ambiguity errors in tests.
This commit is contained in:
parent
a06d55ae6f
commit
b5d65edab7
@ -340,24 +340,24 @@ public:
|
||||
ByteVector a = ByteVector("0123456789");
|
||||
ByteVector b = a.mid(3, 4);
|
||||
b.resize(6, 'A');
|
||||
CPPUNIT_ASSERT_EQUAL(uint(6), b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(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(uint(10), b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(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(uint(3), b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(-1, b.find('C'));
|
||||
b.resize(3);
|
||||
CPPUNIT_ASSERT_EQUAL(uint(3), b.size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), b.size());
|
||||
|
||||
// Check if a and b were properly detached.
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(uint(10), a.size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(10), a.size());
|
||||
CPPUNIT_ASSERT_EQUAL('3', a[3]);
|
||||
CPPUNIT_ASSERT_EQUAL('5', a[5]);
|
||||
|
||||
@ -365,20 +365,21 @@ public:
|
||||
|
||||
ByteVector c = ByteVector("0123456789").mid(3, 4);
|
||||
c.resize(6, 'A');
|
||||
CPPUNIT_ASSERT_EQUAL(uint(6), c.size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(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(uint(10), c.size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(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(uint(3), c.size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), c.size());
|
||||
CPPUNIT_ASSERT_EQUAL(-1, c.find('C'));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestByteVector);
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
|
||||
file.seek(0);
|
||||
const ByteVector v = file.readBlock(file.length());
|
||||
CPPUNIT_ASSERT_EQUAL((uint)10, v.size());
|
||||
CPPUNIT_ASSERT_EQUAL((TagLib::uint)10, v.size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((long)v.find("23"), file.find("23"));
|
||||
CPPUNIT_ASSERT_EQUAL((long)v.find("23", 2), file.find("23", 2));
|
||||
@ -92,7 +92,7 @@ public:
|
||||
|
||||
file.seek(0);
|
||||
const ByteVector v = file.readBlock(file.length());
|
||||
CPPUNIT_ASSERT_EQUAL((uint)10, v.size());
|
||||
CPPUNIT_ASSERT_EQUAL((TagLib::uint)10, v.size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((long)v.rfind("23"), file.rfind("23"));
|
||||
CPPUNIT_ASSERT_EQUAL((long)v.rfind("23", 7), file.rfind("23", 7));
|
||||
@ -103,3 +103,4 @@ public:
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestFile);
|
||||
|
||||
|
@ -911,20 +911,20 @@ public:
|
||||
ID3v2::ChapterFrame f1(&header, chapterData);
|
||||
|
||||
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());
|
||||
CPPUNIT_ASSERT((uint)0x03 == f1.endOffset());
|
||||
CPPUNIT_ASSERT((uint)0x00 == f1.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x03 == f1.startTime());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x05 == f1.endTime());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x02 == f1.startOffset());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x03 == f1.endOffset());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x00 == f1.embeddedFrameList().size());
|
||||
|
||||
ID3v2::ChapterFrame f2(&header, chapterData + embeddedFrameData);
|
||||
|
||||
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());
|
||||
CPPUNIT_ASSERT((uint)0x03 == f2.endOffset());
|
||||
CPPUNIT_ASSERT((uint)0x01 == f2.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x03 == f2.startTime());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x05 == f2.endTime());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x02 == f2.startOffset());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x03 == f2.endOffset());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x01 == f2.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT(f2.embeddedFrameList("TIT2").size() == 1);
|
||||
CPPUNIT_ASSERT(f2.embeddedFrameList("TIT2")[0]->toString() == "CH1");
|
||||
}
|
||||
@ -1017,10 +1017,10 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("T"), f.elementID());
|
||||
CPPUNIT_ASSERT(!f.isTopLevel());
|
||||
CPPUNIT_ASSERT(f.isOrdered());
|
||||
CPPUNIT_ASSERT((uint)0x02 == f.entryCount());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x02 == f.entryCount());
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("C"), f.childElements()[0]);
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("D"), f.childElements()[1]);
|
||||
CPPUNIT_ASSERT((uint)0x01 == f.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT((TagLib::uint)0x01 == f.embeddedFrameList().size());
|
||||
CPPUNIT_ASSERT(f.embeddedFrameList("TIT2").size() == 1);
|
||||
CPPUNIT_ASSERT(f.embeddedFrameList("TIT2")[0]->toString() == "TC1");
|
||||
}
|
||||
@ -1120,3 +1120,4 @@ public:
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v2);
|
||||
|
||||
|
@ -34,16 +34,17 @@ public:
|
||||
{
|
||||
RIFF::Info::Tag tag;
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((uint)0, tag.track());
|
||||
CPPUNIT_ASSERT_EQUAL((TagLib::uint)0, tag.track());
|
||||
tag.setTrack(1234);
|
||||
CPPUNIT_ASSERT_EQUAL((uint)1234, tag.track());
|
||||
CPPUNIT_ASSERT_EQUAL((TagLib::uint)1234, tag.track());
|
||||
CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("IPRT"));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((uint)0, tag.year());
|
||||
CPPUNIT_ASSERT_EQUAL((TagLib::uint)0, tag.year());
|
||||
tag.setYear(1234);
|
||||
CPPUNIT_ASSERT_EQUAL((uint)1234, tag.year());
|
||||
CPPUNIT_ASSERT_EQUAL((TagLib::uint)1234, tag.year());
|
||||
CPPUNIT_ASSERT_EQUAL(String("1234"), tag.fieldText("ICRD"));
|
||||
}
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestInfoTag);
|
||||
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
TagLib::uint chunkDataSize(TagLib::uint i) { return RIFF::File::chunkDataSize(i); };
|
||||
ByteVector chunkName(TagLib::uint i) { return RIFF::File::chunkName(i); };
|
||||
ByteVector chunkData(TagLib::uint i) { return RIFF::File::chunkData(i); };
|
||||
void setChunkData(uint i, const ByteVector &data) {
|
||||
void setChunkData(TagLib::uint i, const ByteVector &data) {
|
||||
RIFF::File::setChunkData(i, data);
|
||||
}
|
||||
void setChunkData(const ByteVector &name, const ByteVector &data) {
|
||||
@ -29,7 +29,7 @@ public:
|
||||
virtual TagLib::Tag* tag() const { return 0; };
|
||||
virtual TagLib::AudioProperties* audioProperties() const { return 0;};
|
||||
virtual bool save() { return false; };
|
||||
void removeChunk(uint i) { RIFF::File::removeChunk(i); }
|
||||
void removeChunk(TagLib::uint i) { RIFF::File::removeChunk(i); }
|
||||
void removeChunk(const ByteVector &name) { RIFF::File::removeChunk(name); }
|
||||
};
|
||||
|
||||
@ -261,3 +261,4 @@ public:
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestRIFF);
|
||||
|
||||
|
@ -256,9 +256,9 @@ public:
|
||||
ByteVector lf("abc\x0axyz", 7);
|
||||
ByteVector crlf("abc\x0d\x0axyz", 8);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(uint(7), String(cr).size());
|
||||
CPPUNIT_ASSERT_EQUAL(uint(7), String(lf).size());
|
||||
CPPUNIT_ASSERT_EQUAL(uint(8), String(crlf).size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(7), String(cr).size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(7), String(lf).size());
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(8), String(crlf).size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(L'\x0d', String(cr)[3]);
|
||||
CPPUNIT_ASSERT_EQUAL(L'\x0a', String(lf)[3]);
|
||||
@ -324,3 +324,4 @@ public:
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user