From 60590c0a1afc16e15cdfbbf5982088e5c38c6358 Mon Sep 17 00:00:00 2001
From: Tsuda Kageyu <tsuda.kageyu@gmail.com>
Date: Sun, 8 Sep 2013 14:41:35 +0900
Subject: [PATCH] Fixed a bug in appending strings and added some relevant
 tests

---
 taglib/toolkit/tstring.cpp |  2 +-
 tests/test_string.cpp      | 26 ++++++++++++++++++--------
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp
index ceb6e9da..25d8db1c 100644
--- a/taglib/toolkit/tstring.cpp
+++ b/taglib/toolkit/tstring.cpp
@@ -635,7 +635,7 @@ String &String::operator+=(const wchar_t *s)
 {
   detach();
 
-  *d->data += *s;
+  *d->data += s;
   return *this;
 }
 
diff --git a/tests/test_string.cpp b/tests/test_string.cpp
index 8bd8b236..0e2807ef 100644
--- a/tests/test_string.cpp
+++ b/tests/test_string.cpp
@@ -149,20 +149,30 @@ public:
 
   void testAppendStringDetach()
   {
-    String a("a");
+    String a("abc");
     String b = a;
-    a += "b";
-    CPPUNIT_ASSERT_EQUAL(String("ab"), a);
-    CPPUNIT_ASSERT_EQUAL(String("a"), b);
+    String c = a;
+
+    b += "def";
+    c += L"def";
+
+    CPPUNIT_ASSERT_EQUAL(String("abc"), a);
+    CPPUNIT_ASSERT_EQUAL(String("abcdef"), b);
+    CPPUNIT_ASSERT_EQUAL(String("abcdef"), c);
   }
 
   void testAppendCharDetach()
   {
-    String a("a");
+    String a("abc");
     String b = a;
-    a += 'b';
-    CPPUNIT_ASSERT_EQUAL(String("ab"), a);
-    CPPUNIT_ASSERT_EQUAL(String("a"), b);
+    String c = a;
+    
+    b += 'd';
+    c += L'd';
+    
+    CPPUNIT_ASSERT_EQUAL(String("abc"), a);
+    CPPUNIT_ASSERT_EQUAL(String("abcd"), b);
+    CPPUNIT_ASSERT_EQUAL(String("abcd"), c);
   }
 
   void testRfind()