From 00e3504264b0e81d591bb0b72f1de3b887108ef8 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Wed, 29 Apr 2015 17:15:13 +0900 Subject: [PATCH] A little robuster tests for ByteVector iterators after detaching. --- tests/test_bytevector.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_bytevector.cpp b/tests/test_bytevector.cpp index 64f3238f..c68a8c34 100644 --- a/tests/test_bytevector.cpp +++ b/tests/test_bytevector.cpp @@ -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); } };