]> granicus.if.org Git - taglib/commitdiff
Avoid using String::null where an empty string is required.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 20 Nov 2015 13:21:47 +0000 (22:21 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 20 Nov 2015 13:21:47 +0000 (22:21 +0900)
String::null is not necessarily be empty or remains the same instance.
Using it in a public header may lead to a linkage error.

29 files changed:
taglib/ape/apeitem.cpp
taglib/ape/apetag.cpp
taglib/asf/asftag.cpp
taglib/it/itfile.cpp
taglib/mod/modfile.cpp
taglib/mod/modtag.cpp
taglib/mp4/mp4tag.cpp
taglib/mpeg/id3v1/id3v1tag.cpp
taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp
taglib/mpeg/id3v2/frames/textidentificationframe.cpp
taglib/mpeg/id3v2/frames/uniquefileidentifierframe.cpp
taglib/mpeg/id3v2/frames/unknownframe.cpp
taglib/mpeg/id3v2/id3v2frame.cpp
taglib/mpeg/id3v2/id3v2framefactory.cpp
taglib/mpeg/id3v2/id3v2tag.cpp
taglib/ogg/xiphcomment.cpp
taglib/s3m/s3mfile.cpp
taglib/tag.cpp
taglib/tagunion.cpp
taglib/toolkit/tiostream.cpp
taglib/toolkit/tpropertymap.cpp
taglib/xm/xmfile.cpp
tests/test_apetag.cpp
tests/test_id3v2.cpp
tests/test_it.cpp
tests/test_mod.cpp
tests/test_s3m.cpp
tests/test_string.cpp
tests/test_xm.cpp

index 442dce63d3eb0731c53ddb63bcffe6abd1b6fedb..d04cc1d12e7b05ff19555ea14a791b568270adc5 100644 (file)
@@ -210,7 +210,7 @@ String APE::Item::toString() const
   if(d->type == Text && !isEmpty())
     return d->text.front();
   else
-    return String::null;
+    return String();
 }
 
 bool APE::Item::isEmpty() const
index 00e1bc779614792bb34ac7a74392ce81a0131a9a..170a77c858ba5e1264fd7b1aeb58cfdbca108883 100644 (file)
@@ -91,35 +91,35 @@ ByteVector APE::Tag::fileIdentifier()
 String APE::Tag::title() const
 {
   if(d->itemListMap["TITLE"].isEmpty())
-    return String::null;
+    return String();
   return d->itemListMap["TITLE"].values().toString();
 }
 
 String APE::Tag::artist() const
 {
   if(d->itemListMap["ARTIST"].isEmpty())
-    return String::null;
+    return String();
   return d->itemListMap["ARTIST"].values().toString();
 }
 
 String APE::Tag::album() const
 {
   if(d->itemListMap["ALBUM"].isEmpty())
-    return String::null;
+    return String();
   return d->itemListMap["ALBUM"].values().toString();
 }
 
 String APE::Tag::comment() const
 {
   if(d->itemListMap["COMMENT"].isEmpty())
-    return String::null;
+    return String();
   return d->itemListMap["COMMENT"].values().toString();
 }
 
 String APE::Tag::genre() const
 {
   if(d->itemListMap["GENRE"].isEmpty())
-    return String::null;
+    return String();
   return d->itemListMap["GENRE"].values().toString();
 }
 
index 5b61a02455b38e3f5f8716a69c85cc12b1b94220..ea9141a373c681a288eadc1c8c606724a6bea5d1 100644 (file)
@@ -64,7 +64,7 @@ String ASF::Tag::album() const
 {
   if(d->attributeListMap.contains("WM/AlbumTitle"))
     return d->attributeListMap["WM/AlbumTitle"][0].toString();
-  return String::null;
+  return String();
 }
 
 String ASF::Tag::copyright() const
@@ -107,7 +107,7 @@ String ASF::Tag::genre() const
 {
   if(d->attributeListMap.contains("WM/Genre"))
     return d->attributeListMap["WM/Genre"][0].toString();
-  return String::null;
+  return String();
 }
 
 void ASF::Tag::setTitle(const String &value)
@@ -329,16 +329,16 @@ PropertyMap ASF::Tag::setProperties(const PropertyMap &props)
   for(; it != origProps.end(); ++it) {
     if(!props.contains(it->first) || props[it->first].isEmpty()) {
       if(it->first == "TITLE") {
-        d->title = String::null;
+        d->title.clear();
       }
       else if(it->first == "ARTIST") {
-        d->artist = String::null;
+        d->artist.clear();
       }
       else if(it->first == "COMMENT") {
-        d->comment = String::null;
+        d->comment.clear();
       }
       else if(it->first == "COPYRIGHT") {
-        d->copyright = String::null;
+        d->copyright.clear();
       }
       else {
         d->attributeListMap.erase(reverseKeyMap[it->first]);
index ad5cf0b85c8d1b23b551498a563cbe4d0a44b6a1..51ad8ac1afdc7720597c2fc2f56c816166b4bc34 100644 (file)
@@ -118,7 +118,7 @@ bool IT::File::save()
     if(i < lines.size())
       writeString(lines[i], 25);
     else
-      writeString(String::null, 25);
+      writeString(String(), 25);
     writeByte(0);
   }
 
@@ -133,7 +133,7 @@ bool IT::File::save()
     if((TagLib::uint)(i + instrumentCount) < lines.size())
       writeString(lines[i + instrumentCount], 25);
     else
-      writeString(String::null, 25);
+      writeString(String(), 25);
     writeByte(0);
   }
 
index ce974c161c4c185e6bc1b75c8e100777a021d4e6..2741e1bff7f987cd0b42c7eca1a03d461657294a 100644 (file)
@@ -99,7 +99,7 @@ bool Mod::File::save()
   }
 
   for(uint i = n; i < d->properties.instrumentCount(); ++ i) {
-    writeString(String::null, 22);
+    writeString(String(), 22);
     seek(8, Current);
   }
   return true;
index 4b180bbb6159b8f39190e91a6fe7b12872bd1979..af98fb92c3a7135e6ad976be8e3b12a3e537f813 100644 (file)
@@ -55,12 +55,12 @@ String Mod::Tag::title() const
 
 String Mod::Tag::artist() const
 {
-  return String::null;
+  return String();
 }
 
 String Mod::Tag::album() const
 {
-  return String::null;
+  return String();
 }
 
 String Mod::Tag::comment() const
@@ -70,7 +70,7 @@ String Mod::Tag::comment() const
 
 String Mod::Tag::genre() const
 {
-  return String::null;
+  return String();
 }
 
 TagLib::uint Mod::Tag::year() const
@@ -142,19 +142,19 @@ PropertyMap Mod::Tag::setProperties(const PropertyMap &origProps)
     d->title = properties["TITLE"].front();
     oneValueSet.append("TITLE");
   } else
-    d->title = String::null;
+    d->title.clear();
 
   if(properties.contains("COMMENT")) {
     d->comment = properties["COMMENT"].front();
     oneValueSet.append("COMMENT");
   } else
-    d->comment = String::null;
+    d->comment.clear();
 
   if(properties.contains("TRACKERNAME")) {
     d->trackerName = properties["TRACKERNAME"].front();
     oneValueSet.append("TRACKERNAME");
   } else
-    d->trackerName = String::null;
+    d->trackerName.clear();
 
   // for each tag that has been set above, remove the first entry in the corresponding
   // value list. The others will be returned as unsupported by this format.
index 005c8a4d85aea9fc4ebaa7e74009eb7762f68df9..842191969822aa3804a2ca9788274cddba91c37f 100644 (file)
@@ -686,7 +686,7 @@ MP4::Tag::title() const
 {
   if(d->items.contains("\251nam"))
     return d->items["\251nam"].toStringList().toString(", ");
-  return String::null;
+  return String();
 }
 
 String
@@ -694,7 +694,7 @@ MP4::Tag::artist() const
 {
   if(d->items.contains("\251ART"))
     return d->items["\251ART"].toStringList().toString(", ");
-  return String::null;
+  return String();
 }
 
 String
@@ -702,7 +702,7 @@ MP4::Tag::album() const
 {
   if(d->items.contains("\251alb"))
     return d->items["\251alb"].toStringList().toString(", ");
-  return String::null;
+  return String();
 }
 
 String
@@ -710,7 +710,7 @@ MP4::Tag::comment() const
 {
   if(d->items.contains("\251cmt"))
     return d->items["\251cmt"].toStringList().toString(", ");
-  return String::null;
+  return String();
 }
 
 String
@@ -718,7 +718,7 @@ MP4::Tag::genre() const
 {
   if(d->items.contains("\251gen"))
     return d->items["\251gen"].toStringList().toString(", ");
-  return String::null;
+  return String();
 }
 
 unsigned int
index 9fc8cfd7d9dedffcecc0d10bd07eef69d427c948..f4004184ff17f95f4f3e0e7fde184dc552427cd9 100644 (file)
@@ -184,7 +184,7 @@ void ID3v1::Tag::setGenre(const String &s)
 
 void ID3v1::Tag::setYear(TagLib::uint i)
 {
-  d->year = i > 0 ? String::number(i) : String::null;
+  d->year = i > 0 ? String::number(i) : String();
 }
 
 void ID3v1::Tag::setTrack(TagLib::uint i)
index bdcc11830e10a6062de5fddd06a5d5a024f4bc84..1e8a1af819b90c3745d078e21182926620389beb 100644 (file)
@@ -214,7 +214,7 @@ void TableOfContentsFrame::removeEmbeddedFrames(const ByteVector &id)
 
 String TableOfContentsFrame::toString() const
 {
-  return String::null;
+  return String();
 }
 
 PropertyMap TableOfContentsFrame::asProperties() const
index 7eacf9328c760094a989ff232b635dd5bda7cadf..8cd0d940ae2edcae9b9cc06dbe03ed0f1d9ec48f 100644 (file)
@@ -312,8 +312,8 @@ UserTextIdentificationFrame::UserTextIdentificationFrame(String::Type encoding)
   d(0)
 {
   StringList l;
-  l.append(String::null);
-  l.append(String::null);
+  l.append(String());
+  l.append(String());
   setText(l);
 }
 
@@ -341,7 +341,7 @@ String UserTextIdentificationFrame::description() const
 {
   return !TextIdentificationFrame::fieldList().isEmpty()
     ? TextIdentificationFrame::fieldList().front()
-    : String::null;
+    : String();
 }
 
 StringList UserTextIdentificationFrame::fieldList() const
@@ -354,7 +354,7 @@ StringList UserTextIdentificationFrame::fieldList() const
 void UserTextIdentificationFrame::setText(const String &text)
 {
   if(description().isEmpty())
-    setDescription(String::null);
+    setDescription(String());
 
   TextIdentificationFrame::setText(StringList(description()).append(text));
 }
@@ -362,7 +362,7 @@ void UserTextIdentificationFrame::setText(const String &text)
 void UserTextIdentificationFrame::setText(const StringList &fields)
 {
   if(description().isEmpty())
-    setDescription(String::null);
+    setDescription(String());
 
   TextIdentificationFrame::setText(StringList(description()).append(fields));
 }
@@ -417,7 +417,7 @@ void UserTextIdentificationFrame::checkFields()
   int fields = fieldList().size();
 
   if(fields == 0)
-    setDescription(String::null);
+    setDescription(String());
   if(fields <= 1)
-    setText(String::null);
+    setText(String());
 }
index a0e842e0082fd48e7d3073625727a52e3ad28554..a986e4db4ba37e83811be50cb887b0c2f378ad7f 100644 (file)
@@ -86,7 +86,7 @@ void UniqueFileIdentifierFrame::setIdentifier(const ByteVector &v)
 
 String UniqueFileIdentifierFrame::toString() const
 {
-  return String::null;
+  return String();
 }
 
 PropertyMap UniqueFileIdentifierFrame::asProperties() const
index 4def028ba22bd8e70ef4d1d268d76a3a5540bc5b..9d059193b0bc2c8b8f6d7a41c928feba188f577e 100644 (file)
@@ -51,7 +51,7 @@ UnknownFrame::~UnknownFrame()
 
 String UnknownFrame::toString() const
 {
-  return String::null;
+  return String();
 }
 
 ByteVector UnknownFrame::data() const
index 1e679780f430bf26909f7236b21977c3b027d53b..f811ed69be135754db3096408e5dc2e11f3cd0c9 100644 (file)
@@ -317,7 +317,7 @@ String Frame::readStringField(const ByteVector &data, String::Type encoding, int
   int end = data.find(delimiter, *position, delimiter.size());
 
   if(end < *position)
-    return String::null;
+    return String();
 
   String str;
   if(encoding == String::Latin1)
index bf4b0ee835f17f6dff913988fd71beb6c1863a97..f387e93778af2458025f2bc18f46de4ce2ac5d93 100644 (file)
@@ -516,7 +516,7 @@ void FrameFactory::updateGenre(TextIdentificationFrame *frame) const
   }
 
   if(newfields.isEmpty())
-    fields.append(String::null);
+    fields.append(String());
 
   frame->setText(newfields);
 
index f06cfbadac9b2b45d5edf2f580a58c31dfc5cbfc..be5bfd207e5ed56b20292364d9df0475ca9a5bd3 100644 (file)
@@ -140,21 +140,21 @@ String ID3v2::Tag::title() const
 {
   if(!d->frameListMap["TIT2"].isEmpty())
     return d->frameListMap["TIT2"].front()->toString();
-  return String::null;
+  return String();
 }
 
 String ID3v2::Tag::artist() const
 {
   if(!d->frameListMap["TPE1"].isEmpty())
     return d->frameListMap["TPE1"].front()->toString();
-  return String::null;
+  return String();
 }
 
 String ID3v2::Tag::album() const
 {
   if(!d->frameListMap["TALB"].isEmpty())
     return d->frameListMap["TALB"].front()->toString();
-  return String::null;
+  return String();
 }
 
 String ID3v2::Tag::comment() const
@@ -162,7 +162,7 @@ String ID3v2::Tag::comment() const
   const FrameList &comments = d->frameListMap["COMM"];
 
   if(comments.isEmpty())
-    return String::null;
+    return String();
 
   for(FrameList::ConstIterator it = comments.begin(); it != comments.end(); ++it)
   {
@@ -184,7 +184,7 @@ String ID3v2::Tag::genre() const
   if(d->frameListMap["TCON"].isEmpty() ||
      !dynamic_cast<TextIdentificationFrame *>(d->frameListMap["TCON"].front()))
   {
-    return String::null;
+    return String();
   }
 
   // ID3v2.4 lists genres as the fields in its frames field list.  If the field
index 1da0edac79e495b71458c0a5210bddd84db0eee3..090675c22997680b607be701bae8e3a44c2bc780 100644 (file)
@@ -62,21 +62,21 @@ Ogg::XiphComment::~XiphComment()
 String Ogg::XiphComment::title() const
 {
   if(d->fieldListMap["TITLE"].isEmpty())
-    return String::null;
+    return String();
   return d->fieldListMap["TITLE"].toString();
 }
 
 String Ogg::XiphComment::artist() const
 {
   if(d->fieldListMap["ARTIST"].isEmpty())
-    return String::null;
+    return String();
   return d->fieldListMap["ARTIST"].toString();
 }
 
 String Ogg::XiphComment::album() const
 {
   if(d->fieldListMap["ALBUM"].isEmpty())
-    return String::null;
+    return String();
   return d->fieldListMap["ALBUM"].toString();
 }
 
@@ -92,13 +92,13 @@ String Ogg::XiphComment::comment() const
     return d->fieldListMap["COMMENT"].toString();
   }
 
-  return String::null;
+  return String();
 }
 
 String Ogg::XiphComment::genre() const
 {
   if(d->fieldListMap["GENRE"].isEmpty())
-    return String::null;
+    return String();
   return d->fieldListMap["GENRE"].toString();
 }
 
index 371340a59f2c3ebdad8aa50fdc19082b4d5cf663..f15d740b6a270ae8400598c9bd1b8e3c28e84fdc 100644 (file)
@@ -134,7 +134,7 @@ bool S3M::File::save()
     if(i < lines.size())
       writeString(lines[i], 27);
     else
-      writeString(String::null, 27);
+      writeString(String(), 27);
     // string terminating NUL is not optional:
     writeByte(0);
   }
index d13b248ff65b18ffc2718504200e03c3f3186d40..3526226f86acc00423b0a31e3d7e79ceb3ffd25e 100644 (file)
@@ -89,31 +89,31 @@ PropertyMap Tag::setProperties(const PropertyMap &origProps)
     setTitle(properties["TITLE"].front());
     oneValueSet.append("TITLE");
   } else
-    setTitle(String::null);
+    setTitle(String());
 
   if(properties.contains("ARTIST")) {
     setArtist(properties["ARTIST"].front());
     oneValueSet.append("ARTIST");
   } else
-    setArtist(String::null);
+    setArtist(String());
 
   if(properties.contains("ALBUM")) {
     setAlbum(properties["ALBUM"].front());
     oneValueSet.append("ALBUM");
   } else
-    setAlbum(String::null);
+    setAlbum(String());
 
   if(properties.contains("COMMENT")) {
     setComment(properties["COMMENT"].front());
     oneValueSet.append("COMMENT");
   } else
-    setComment(String::null);
+    setComment(String());
 
   if(properties.contains("GENRE")) {
     setGenre(properties["GENRE"].front());
     oneValueSet.append("GENRE");
   } else
-    setGenre(String::null);
+    setGenre(String());
 
   if(properties.contains("DATE")) {
     bool ok;
index a6743d144939a1b5f384c369d3f733c0200e6c3f..30a535834d7e58cd75ad96cac33ddf309562c508 100644 (file)
@@ -42,7 +42,7 @@ using namespace TagLib;
     return tag(1)->method();                                         \
   if(tag(2) && !tag(2)->method().isEmpty())                          \
     return tag(2)->method();                                         \
-  return String::null                                                \
+  return String();                                                   \
 
 #define numberUnion(method)                                          \
   if(tag(0) && tag(0)->method() > 0)                                 \
index 0284aed6bb725ae48efd2d0459947a42623e4b2c..72fe32a6183e677b1d2f914d5862d59284a1b229 100644 (file)
@@ -33,10 +33,10 @@ using namespace TagLib;
 # include "tdebug.h"
 # include <windows.h>
 
-namespace 
+namespace
 {
   // Check if the running system has CreateFileW() function.
-  // Windows9x systems don't have CreateFileW() or can't accept Unicode file names. 
+  // Windows9x systems don't have CreateFileW() or can't accept Unicode file names.
 
   bool supportsUnicode()
   {
@@ -49,11 +49,11 @@ namespace
   }
 
   // Indicates whether the system supports Unicode file names.
-  
-  const bool SystemSupportsUnicode = supportsUnicode(); 
+
+  const bool SystemSupportsUnicode = supportsUnicode();
 
   // Converts a UTF-16 string into a local encoding.
-  // This function should only be used in Windows9x systems which don't support 
+  // This function should only be used in Windows9x systems which don't support
   // Unicode file names.
 
   std::string unicodeToAnsi(const wchar_t *wstr)
@@ -76,52 +76,52 @@ namespace
 // If WinNT, stores a Unicode string into m_wname directly.
 // If Win9x, converts and stores it into m_name to avoid calling Unicode version functions.
 
-FileName::FileName(const wchar_t *name) 
+FileName::FileName(const wchar_t *name)
   : m_name (SystemSupportsUnicode ? "" : unicodeToAnsi(name))
   , m_wname(SystemSupportsUnicode ? name : L"")
 {
 }
 
-FileName::FileName(const char *name) 
-  : m_name(name) 
+FileName::FileName(const char *name)
+  : m_name(name)
 {
 }
 
-FileName::FileName(const FileName &name) 
-  : m_name (name.m_name) 
+FileName::FileName(const FileName &name)
+  : m_name (name.m_name)
   , m_wname(name.m_wname)
 {
 }
 
-FileName::operator const wchar_t *() const 
-{ 
-  return m_wname.c_str(); 
+FileName::operator const wchar_t *() const
+{
+  return m_wname.c_str();
 }
 
-FileName::operator const char *() const 
-{ 
-  return m_name.c_str(); 
+FileName::operator const char *() const
+{
+  return m_name.c_str();
 }
 
-const std::wstring &FileName::wstr() const 
-{ 
-  return m_wname; 
+const std::wstring &FileName::wstr() const
+{
+  return m_wname;
 }
 
-const std::string &FileName::str() const 
-{ 
-  return m_name; 
-}  
+const std::string &FileName::str() const
+{
+  return m_name;
+}
 
 String FileName::toString() const
 {
   if(!m_wname.empty()) {
     return String(m_wname);
-  } 
+  }
   else if(!m_name.empty()) {
     const int len = MultiByteToWideChar(CP_ACP, 0, m_name.c_str(), -1, NULL, 0);
     if(len == 0)
-      return String::null;
+      return String();
 
     std::vector<wchar_t> buf(len);
     MultiByteToWideChar(CP_ACP, 0, m_name.c_str(), -1, &buf[0], len);
@@ -129,7 +129,7 @@ String FileName::toString() const
     return String(&buf[0]);
   }
   else {
-    return String::null;
+    return String();
   }
 }
 
index 2c69641761fa946b96b0bd70398b163198b1ca8b..1c6a47d9f55f48465a287b1f2f36e285737efc8f 100644 (file)
@@ -144,7 +144,8 @@ bool PropertyMap::operator!=(const PropertyMap &other) const
 
 String PropertyMap::toString() const
 {
-  String ret = "";
+  String ret;
+
   for(ConstIterator it = begin(); it != end(); ++it)
     ret += it->first+"="+it->second.toString(", ") + "\n";
   if(!unsupported.isEmpty())
index 3625d21337a3c741e733d9e8f87e53e3866b28ac..a0bb53536326fd0eec75bb55958a50a3b97fe1dd 100644 (file)
@@ -449,7 +449,7 @@ bool XM::File::save()
     seek(pos + 4);
     const uint len = std::min(22UL, instrumentHeaderSize - 4U);
     if(i >= lines.size())
-      writeString(String::null, len);
+      writeString(String(), len);
     else
       writeString(lines[i], len);
 
@@ -480,7 +480,7 @@ bool XM::File::save()
           seek(pos + 18);
           const uint len = std::min(sampleHeaderSize - 18U, 22UL);
           if(sampleNameIndex >= lines.size())
-            writeString(String::null, len);
+            writeString(String(), len);
           else
             writeString(lines[sampleNameIndex ++], len);
         }
index 2f02795818e01d83851dee9128dc6e15f819f1c6..424757662bb28dd63bbcba42892ba15513060b16 100644 (file)
@@ -108,7 +108,7 @@ public:
     ByteVector data("Test Data");
     item.setBinaryData(data);
     CPPUNIT_ASSERT(item.values().isEmpty());
-    CPPUNIT_ASSERT_EQUAL(String::null, item.toString());
+    CPPUNIT_ASSERT_EQUAL(String(), item.toString());
     CPPUNIT_ASSERT_EQUAL(data, item.binaryData());
 
     item.setValue("Test Text 2");
index 612dc4240c694d7fe6d631886daad080f22a0b38..c6592bbea3bb7de2986698183aa7c665ed760502 100644 (file)
@@ -36,7 +36,7 @@ class PublicFrame : public ID3v2::Frame
     String readStringField(const ByteVector &data, String::Type encoding,
                            int *positon = 0)
       { return ID3v2::Frame::readStringField(data, encoding, positon); }
-    virtual String toString() const { return String::null; }
+    virtual String toString() const { return String(); }
     virtual void parseFields(const ByteVector &) {}
     virtual ByteVector renderFields() const { return ByteVector(); }
 };
index be5680ec448df3ff9f578e5e182297e39e2f7bcb..3270eb25b3ac720c4ef308df42e0d3bd40533ad6 100644 (file)
@@ -123,10 +123,10 @@ private:
     CPPUNIT_ASSERT_EQUAL((TagLib::uchar)128, p->panningSeparation());
     CPPUNIT_ASSERT_EQUAL((TagLib::uchar)  0, p->pitchWheelDepth());
     CPPUNIT_ASSERT_EQUAL(title, t->title());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->artist());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->album());
+    CPPUNIT_ASSERT_EQUAL(String(), t->artist());
+    CPPUNIT_ASSERT_EQUAL(String(), t->album());
     CPPUNIT_ASSERT_EQUAL(comment, t->comment());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->genre());
+    CPPUNIT_ASSERT_EQUAL(String(), t->genre());
     CPPUNIT_ASSERT_EQUAL(0U, t->year());
     CPPUNIT_ASSERT_EQUAL(0U, t->track());
     CPPUNIT_ASSERT_EQUAL(String("Impulse Tracker"), t->trackerName());
index 0a233c97e27e7cf4a4c7f0ac5a68f2114df9d8b5..c62a870ba0e857d0eb74df8d04dda2a48ce6363f 100644 (file)
@@ -113,10 +113,10 @@ private:
     CPPUNIT_ASSERT_EQUAL(31U, p->instrumentCount());
     CPPUNIT_ASSERT_EQUAL((uchar)1, p->lengthInPatterns());
     CPPUNIT_ASSERT_EQUAL(title, t->title());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->artist());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->album());
+    CPPUNIT_ASSERT_EQUAL(String(), t->artist());
+    CPPUNIT_ASSERT_EQUAL(String(), t->album());
     CPPUNIT_ASSERT_EQUAL(comment, t->comment());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->genre());
+    CPPUNIT_ASSERT_EQUAL(String(), t->genre());
     CPPUNIT_ASSERT_EQUAL(0U, t->year());
     CPPUNIT_ASSERT_EQUAL(0U, t->track());
     CPPUNIT_ASSERT_EQUAL(String("StarTrekker"), t->trackerName());
index 24a4c6e416c84e8b3579b4b30339d505f51f0523..997c565328f85a1ee2fd294823961a6bc19c1a22 100644 (file)
@@ -110,10 +110,10 @@ private:
     CPPUNIT_ASSERT_EQUAL((TagLib::uchar)125, p->tempo());
     CPPUNIT_ASSERT_EQUAL((TagLib::uchar)  6, p->bpmSpeed());
     CPPUNIT_ASSERT_EQUAL(title, t->title());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->artist());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->album());
+    CPPUNIT_ASSERT_EQUAL(String(), t->artist());
+    CPPUNIT_ASSERT_EQUAL(String(), t->album());
     CPPUNIT_ASSERT_EQUAL(comment, t->comment());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->genre());
+    CPPUNIT_ASSERT_EQUAL(String(), t->genre());
     CPPUNIT_ASSERT_EQUAL(0U, t->year());
     CPPUNIT_ASSERT_EQUAL(0U, t->track());
     CPPUNIT_ASSERT_EQUAL(String("ScreamTracker III"), t->trackerName());
index 24816af9d457e54765fb6d96e5fd80d54756189a..27839618bcb1df662093682934d7016601814545 100644 (file)
@@ -69,7 +69,7 @@ public:
 
     s.clear();
     CPPUNIT_ASSERT(s.isEmpty());
-    CPPUNIT_ASSERT(!s.isNull());
+    CPPUNIT_ASSERT(!s.isNull()); // deprecated, but still worth it to check.
 
     String unicode("José Carlos", String::UTF8);
     CPPUNIT_ASSERT(strcmp(unicode.toCString(), "Jos\xe9 Carlos") == 0);
index 280865334c123d8f0bc59ccdec6c98769a6f843f..48e6ec2ceb8b0f03685f103507907f150a8bb903 100644 (file)
@@ -139,13 +139,13 @@ public:
     CPPUNIT_ASSERT_EQUAL((TagLib::ushort)  6, p->tempo());
     CPPUNIT_ASSERT_EQUAL((TagLib::ushort)125, p->bpmSpeed());
     CPPUNIT_ASSERT_EQUAL(titleBefore, t->title());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->artist());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->album());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->comment());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->genre());
+    CPPUNIT_ASSERT_EQUAL(String(), t->artist());
+    CPPUNIT_ASSERT_EQUAL(String(), t->album());
+    CPPUNIT_ASSERT_EQUAL(String(), t->comment());
+    CPPUNIT_ASSERT_EQUAL(String(), t->genre());
     CPPUNIT_ASSERT_EQUAL(0U, t->year());
     CPPUNIT_ASSERT_EQUAL(0U, t->track());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->trackerName());
+    CPPUNIT_ASSERT_EQUAL(String(), t->trackerName());
   }
 
   void testWriteTagsShort()
@@ -185,10 +185,10 @@ private:
     CPPUNIT_ASSERT_EQUAL((TagLib::ushort)  6, p->tempo());
     CPPUNIT_ASSERT_EQUAL((TagLib::ushort)125, p->bpmSpeed());
     CPPUNIT_ASSERT_EQUAL(title, t->title());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->artist());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->album());
+    CPPUNIT_ASSERT_EQUAL(String(), t->artist());
+    CPPUNIT_ASSERT_EQUAL(String(), t->album());
     CPPUNIT_ASSERT_EQUAL(comment, t->comment());
-    CPPUNIT_ASSERT_EQUAL(String::null, t->genre());
+    CPPUNIT_ASSERT_EQUAL(String(), t->genre());
     CPPUNIT_ASSERT_EQUAL(0U, t->year());
     CPPUNIT_ASSERT_EQUAL(0U, t->track());
     CPPUNIT_ASSERT_EQUAL(trackerName, t->trackerName());