]> granicus.if.org Git - taglib/commitdiff
Silence uint ambiguity errors in tests.
authorFestus Hagen <festushagen2002@yahoo.com>
Wed, 27 May 2015 18:07:53 +0000 (14:07 -0400)
committerFestus Hagen <festushagen2002@yahoo.com>
Wed, 27 May 2015 18:07:53 +0000 (14:07 -0400)
tests/test_bytevector.cpp
tests/test_file.cpp
tests/test_id3v2.cpp
tests/test_info.cpp
tests/test_riff.cpp
tests/test_string.cpp

index de6820843701941d14619ee69628849fcf4f9138..1c2ca904d0ff5fc4ea35fa67e749f239e9a29d1e 100644 (file)
@@ -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);
+
index b3751a26bbd9c1e8c65e1350b05edd94c28b25fa..48746f77621c3eb3ef376486fe798e347e699862 100644 (file)
@@ -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);
+
index 01963c968c5b82fc06c7bda28ca4c8c695cb9723..5088841f6718a0755c5724f4ddd440b423094652 100644 (file)
@@ -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);
+
index 8e0d71548d49e07a97faead49372eed646d256f2..de1f4bbee6296575303d96f2067e0906400be1fd 100644 (file)
@@ -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);
+
index 19bff169c0003e4e1705f367feb283b565333d30..e07687f13d701fdd6ee10c8f4b136915a8a11dbf 100644 (file)
@@ -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);
+
index becce47be9f19ff5d95a0045c4feaaa4ceeba2b7..afb2aa2396befaee2be146ce1ff44316c04eed2b 100644 (file)
@@ -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);
+