From 767a6ec4a2245d4f2cb9224eecd5c36f51f91fb4 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Sun, 2 Jun 2013 03:58:50 +0900 Subject: [PATCH] Added some tests for containsAt() --- tests/test_bytevector.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_bytevector.cpp b/tests/test_bytevector.cpp index dd433456..9efd23af 100644 --- a/tests/test_bytevector.cpp +++ b/tests/test_bytevector.cpp @@ -112,12 +112,17 @@ public: ByteVector s2("f"); CPPUNIT_ASSERT(ByteVectorList::split(s2, " ").size() == 1); - CPPUNIT_ASSERT(ByteVector().size() == 0); CPPUNIT_ASSERT(ByteVector("asdf").clear().size() == 0); CPPUNIT_ASSERT(ByteVector("asdf").clear() == ByteVector()); - } + ByteVector i("blah blah"); + ByteVector j("blah"); + CPPUNIT_ASSERT(i.containsAt(j, 5, 0)); + CPPUNIT_ASSERT(i.containsAt(j, 6, 1)); + CPPUNIT_ASSERT(i.containsAt(j, 6, 1, 3)); + } + void testFind1() { CPPUNIT_ASSERT_EQUAL(4, ByteVector("....SggO."). find("SggO"));