/* * Copyright (C) 1996-2023 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. */ #include "squid.h" #include "compat/cppunit.h" #include "sbuf/Algorithms.h" #include "sbuf/List.h" #include "unitTestMain.h" class TestSBufList : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(TestSBufList); CPPUNIT_TEST(testSBufListMembership); CPPUNIT_TEST(testSBufListJoin); CPPUNIT_TEST_SUITE_END(); protected: void testSBufListMembership(); void testSBufListJoin(); }; CPPUNIT_TEST_SUITE_REGISTRATION( TestSBufList ); SBuf literal("The quick brown fox jumped over the lazy dog"); static int sbuf_tokens_number=9; static SBuf tokens[]= { SBuf("The",3), SBuf("quick",5), SBuf("brown",5), SBuf("fox",3), SBuf("jumped",6), SBuf("over",4), SBuf("the",3), SBuf("lazy",4), SBuf("dog",3) }; void TestSBufList::testSBufListMembership() { SBufList foo; for (int j=0; j