]> granicus.if.org Git - taglib/commitdiff
A little robuster tests for ByteVector iterators after detaching.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Wed, 29 Apr 2015 08:15:13 +0000 (17:15 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Wed, 29 Apr 2015 08:15:13 +0000 (17:15 +0900)
tests/test_bytevector.cpp

index 64f3238fdf37871780a39ae0e549b11471827401..c68a8c340648c7a219fff82173cac5795e73d2a3 100644 (file)
@@ -321,8 +321,17 @@ public:
     CPPUNIT_ASSERT_EQUAL('A', *it4);
 
     ByteVector v3;
-    v3 = ByteVector("taglib").mid(3);
-    CPPUNIT_ASSERT_EQUAL('l', *v3.begin());
+    v3 = ByteVector("0123456789").mid(3, 4);
+
+    it1 = v3.begin();
+    it2 = v3.end() - 1;
+    CPPUNIT_ASSERT_EQUAL('3', *it1);
+    CPPUNIT_ASSERT_EQUAL('6', *it2);
+
+    it3 = v3.rbegin();
+    it4 = v3.rend() - 1;
+    CPPUNIT_ASSERT_EQUAL('6', *it3);
+    CPPUNIT_ASSERT_EQUAL('3', *it4);
   }
 
 };