From: Francesco Chemolli Date: Fri, 29 Mar 2013 17:05:35 +0000 (+0100) Subject: Cleaned SBuf unit test from non-core tests X-Git-Tag: SQUID_3_5_0_1~612^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcdc81a8f77dabdb892d92185394ca2b9f316a42;p=thirdparty%2Fsquid.git Cleaned SBuf unit test from non-core tests --- diff --git a/src/tests/testSBuf.cc b/src/tests/testSBuf.cc index 15ad95dc1d..559209a837 100644 --- a/src/tests/testSBuf.cc +++ b/src/tests/testSBuf.cc @@ -1,10 +1,7 @@ #include "squid.h" #include "Mem.h" #include "SBuf.h" -#include "SBufList.h" #include "SBufStream.h" -#include "SBufTokenizer.h" -#include "SBufUtil.h" #include "SquidString.h" #include "testSBuf.h" #include "SBufFindTest.h" @@ -596,28 +593,6 @@ void testSBuf::testCopy() CPPUNIT_ASSERT(s==s2); } -// XXX: please split each class into a separate unit-test .cc / even if they share a binary. -// rule-of-thumb guideline for layering is 'one class Foo -> one Foo.cc, one Foo.cc -> one testFoo.cc' - -static int sbuf_tokens_number=9; -static SBuf tokens[]={ - SBuf("The",0,3), SBuf("quick",0,5), SBuf("brown",0,5), SBuf("fox",0,3), - SBuf("jumped",0,6), SBuf("over",0,4), SBuf("the",0,3), SBuf("lazy",0,4), - SBuf("dog",0,3) -}; - -void testSBuf::testSBufTokenizer() -{ - int j=0; - SBuf s; - for (SBufTokenizer st(literal,SBuf(" ",0,1)); !st.atEnd(); st.next()) { - s=st.token(); - CPPUNIT_ASSERT(s==tokens[j]); - j++; - } - CPPUNIT_ASSERT(j==9); -} - void testSBuf::testStringOps() { SBuf sng(literal), @@ -657,26 +632,6 @@ void testSBuf::testStartsWith() CPPUNIT_ASSERT(!literal.startsWith(casebuf,caseInsensitive)); } -void testSBuf::testSBufList() -{ - SBufList foo; - for (int j=0; j -#if 0 // guideline violation: only #include into .h when used by the .h -#include "SBuf.h" -#include "SBufExceptions.h" -#include "SBufList.h" -#include "SBufUtil.h" -#endif #include "OutOfBoundsException.h" /* @@ -44,11 +38,8 @@ class testSBuf : public CPPUNIT_NS::TestFixture CPPUNIT_TEST( testPrintf ); CPPUNIT_TEST( testScanf ); CPPUNIT_TEST( testCopy ); - CPPUNIT_TEST( testSBufTokenizer ); CPPUNIT_TEST( testStringOps ); CPPUNIT_TEST( testGrow ); - CPPUNIT_TEST( testSBufList ); - CPPUNIT_TEST( testBaseName ); CPPUNIT_TEST( testSBufStream ); CPPUNIT_TEST( testAutoFind ); @@ -84,12 +75,9 @@ protected: void testRFindSBuf(); void testSearchFail(); void testCopy(); - void testSBufTokenizer(); void testStringOps(); void testGrow(); void testStartsWith(); - void testSBufList(); - void testBaseName(); void testSBufStream(); void testFindFirstOf(); void testAutoFind();