Also moves the unit-test for Vector<> to src/tests.
#ifndef SQUID_STACK_H
#define SQUID_STACK_H
-#include "Array.h"
+#include "base/Vector.h"
/* RBC: 20030714 Composition might be better long-term, but for now,
* there's no reason to do so.
check_PROGRAMS += tests/testAll
tests_testAll_SOURCES= \
- tests/testArray.h \
- tests/testArray.cc \
tests/testRFC1035.h \
tests/testRFC1035.cc \
tests/testRFC1738.h \
+++ /dev/null
-#define SQUID_UNIT_TEST 1
-#include "squid.h"
-
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
-
-#include "testArray.h"
-#include "Array.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( testArray );
-
-void testArray::all()
-{
- CPPUNIT_ASSERT( 1 == 1 );
- Vector<int> aArray;
- CPPUNIT_ASSERT (aArray.size() == 0);
- aArray.push_back(2);
- CPPUNIT_ASSERT (aArray.size() == 1);
- CPPUNIT_ASSERT (aArray.back() == 2);
- CPPUNIT_ASSERT (aArray.size() == 1);
-}
#ifndef SQUID_CLIENTDELAYCONFIG_H
#define SQUID_CLIENTDELAYCONFIG_H
-#include "Array.h"
+#include "base/Vector.h"
+
class StoreEntry;
class acl_access;
class ConfigParser;
#ifndef SQUID_CONFIGOPTION_H
#define SQUID_CONFIGOPTION_H
-/* for Vector<> */
-#include "Array.h"
+#include "base/Vector.h"
class StoreEntry;
#ifndef SQUID_CPU_AFFINITY_MAP_H
#define SQUID_CPU_AFFINITY_MAP_H
-#include "Array.h"
+#include "base/Vector.h"
class CpuAffinitySet;
#ifndef SQUID_DELAYPOOLS_H
#define SQUID_DELAYPOOLS_H
+#include "base/Vector.h"
+
+class DelayPool;
+class Updateable;
+class StoreEntry;
+
/**
\defgroup DelayPoolsAPI Delay Pools API
\ingroup Components
virtual void update(int) = 0;
};
-/* forward decls */
-class DelayPool;
-class Updateable;
-class StoreEntry;
-
-/* for Vector<> */
-#include "Array.h"
-
/// \ingroup DelayPoolsAPI
class DelayPools
{
#include "DelayIdComposite.h"
#include "DelayBucket.h"
#include "DelaySpec.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "splay.h"
/// \ingroup DelayPoolsAPI
#include "DelayIdComposite.h"
#include "DelayBucket.h"
#include "DelaySpec.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "splay.h"
/// \ingroup DelayPoolsAPI
#ifndef SQUID_DISKIOMODULE_H
#define SQUID_DISKIOMODULE_H
-#include "Array.h"
+#include "base/Vector.h"
/* forward decls */
#ifndef SQUID_EVENTLOOP_H
#define SQUID_EVENTLOOP_H
-#include "Array.h"
+#include "base/Vector.h"
#define EVENT_LOOP_TIMEOUT 1000 /* 1s timeout */
#ifndef SQUID_FADING_COUNTER_H
#define SQUID_FADING_COUNTER_H
-#include "Array.h"
+#include "base/Vector.h"
/// Counts events, forgetting old ones. Usefull for "3 errors/minute" limits.
class FadingCounter
#ifndef SQUID_HTTPHEADERRANGE_H
#define SQUID_HTTPHEADERRANGE_H
-#include "Array.h"
+#include "base/Vector.h"
#include "MemPool.h"
#include "Packer.h"
#include "Range.h"
tests/testURL \
tests/testConfigParser \
tests/testStatHist \
+ tests/testVector \
$(STORE_TESTS)
## NP: required to run the above list. check_PROGRAMS only builds the binaries...
$(COMPAT_LIB)
tests_testStatHist_DEPENDENCIES = $(SQUID_CPPUNIT_LA)
+tests_testVector_SOURCES = \
+ tests/testVector.cc \
+ tests/testMain.cc \
+ tests/testVector.h \
+ time.cc
+nodist_tests_testVector_SOURCES = \
+ $(TESTSOURCES)
+tests_testVector_LDADD= \
+ $(SQUID_CPPUNIT_LIBS) \
+ $(COMPAT_LIB) \
+ $(XTRA_LIBS)
+tests_testVector_LDFLAGS = $(LIBADD_DL)
+tests_testVector_DEPENDENCIES = \
+ $(SQUID_CPPUNIT_LA)
+
TESTS += testHeaders
#ifndef SQUID_NOTES_H
#define SQUID_NOTES_H
-#include "Array.h"
+#include "base/Vector.h"
#include "base/RefCount.h"
#include "CbDataList.h"
#include "MemPool.h"
#define SQUID_PEERSELECTSTATE_H
#include "acl/Checklist.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "cbdata.h"
#include "comm/forward.h"
#include "hier_code.h"
#ifndef SQUID_STOREFILESYSTEM_H
#define SQUID_STOREFILESYSTEM_H
-#include "Array.h"
+#include "base/Vector.h"
/* ****** DOCUMENTATION ***** */
#ifndef SQUID_ACL_H
#define SQUID_ACL_H
-#include "Array.h"
+#include "base/Vector.h"
#include "cbdata.h"
#include "defines.h"
#include "dlink.h"
#include "adaptation/History.h"
#include "adaptation/Service.h"
#include "adaptation/ServiceGroups.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "ConfigParser.h"
#include "globals.h"
#include "HttpReply.h"
#ifndef SQUID_ADAPTATION__DYNAMIC_GROUP_CFG_H
#define SQUID_ADAPTATION__DYNAMIC_GROUP_CFG_H
-#include "Array.h"
+#include "base/Vector.h"
#include "SquidString.h"
namespace Adaptation
#define SQUID_ADAPT_HISTORY_H
#include "adaptation/DynamicGroupCfg.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "base/RefCount.h"
#include "HttpHeader.h"
#include "Notes.h"
#define SQUID_ADAPTATION__SERVICE_GROUPS_H
#include "SquidString.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "adaptation/Elements.h"
#include "adaptation/forward.h"
#include "base/RefCount.h"
#include "squid.h"
#include "ConfigParser.h"
#include "Store.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "adaptation/icap/Config.h"
#include "adaptation/icap/ServiceRep.h"
#include "HttpRequest.h"
#if USE_AUTH
-#include "Array.h"
+#include "base/Vector.h"
#include "base/RefCount.h"
/**
Subscription.h \
TextException.cc \
TextException.h \
- StringArea.h
+ StringArea.h \
+ Vector.cc \
+ Vector.h
*/
#include "squid.h"
-#include "Array.h"
+#include "base/Vector.h"
#if HAVE_ASSERT_H
#include <assert.h>
#ifndef _SQUID_SRC_COMM_ACCEPT_LIMITER_H
#define _SQUID_SRC_COMM_ACCEPT_LIMITER_H
-#include "Array.h"
+#include "base/Vector.h"
#include "comm/TcpAcceptor.h"
namespace Comm
#ifndef _SQUID_COMM_FORWARD_H
#define _SQUID_COMM_FORWARD_H
-#include "Array.h"
+#include "base/Vector.h"
#include "base/RefCount.h"
namespace Comm
#include "squid.h"
#if USE_DELAY_POOLS
-#include "Array.h"
+#include "base/Vector.h"
#include "client_side_request.h"
#include "comm/Connection.h"
#include "CommonPool.h"
*/
#include "squid.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "esi/CustomParser.h"
#include "Debug.h"
#include "Trie.h"
#include "esi/Segment.h"
#include "Trie.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "HttpHeader.h"
class HttpReply;
#ifndef SQUID_EVENT_H
#define SQUID_EVENT_H
-#include "Array.h"
+#include "base/Vector.h"
#include "AsyncEngine.h"
#include "MemPool.h"
#ifndef SQUID_FORWARD_H
#define SQUID_FORWARD_H
-#include "Array.h"
+#include "base/Vector.h"
#include "base/RefCount.h"
#include "comm.h"
#include "comm/Connection.h"
#ifndef SQUID_IPC_COORDINATOR_H
#define SQUID_IPC_COORDINATOR_H
-#include "Array.h"
+#include "base/Vector.h"
#include "ipc/Messages.h"
#include "ipc/Port.h"
#include "ipc/SharedListen.h"
#ifndef SQUID_IPC_KIDS_H
#define SQUID_IPC_KIDS_H
-#include "Array.h"
+#include "base/Vector.h"
#include "ipc/Kid.h"
/// a collection of kids
#ifndef SQUID_IPC_QUEUE_H
#define SQUID_IPC_QUEUE_H
-#include "Array.h"
+#include "base/Vector.h"
#include "Debug.h"
#include "base/InstanceId.h"
#include "ipc/AtomicWord.h"
--- /dev/null
+#define SQUID_UNIT_TEST 1
+#include "squid.h"
+#include "base/Vector.h"
+#include "tests/testVector.h"
+
+#include <cppunit/TestAssert.h>
+
+CPPUNIT_TEST_SUITE_REGISTRATION( testVector );
+
+void testVector::all()
+{
+ CPPUNIT_ASSERT( 1 == 1 );
+ Vector<int> aArray;
+ CPPUNIT_ASSERT(aArray.size() == 0);
+ aArray.push_back(2);
+ CPPUNIT_ASSERT(aArray.size() == 1);
+ CPPUNIT_ASSERT(aArray.back() == 2);
+ CPPUNIT_ASSERT(aArray.size() == 1);
+}
-
-#ifndef SQUID_LIB_TEST_ARRAY_H
-#define SQUID_LIB_TEST_ARRAY_H
+#ifndef SQUID_SRC_TESTS_TESTVECTOR_H
+#define SQUID_SRC_TESTS_TESTVECTOR_H
#include <cppunit/extensions/HelperMacros.h>
*
*/
-class testArray : public CPPUNIT_NS::TestFixture
+class testVector : public CPPUNIT_NS::TestFixture
{
- CPPUNIT_TEST_SUITE( testArray );
+ CPPUNIT_TEST_SUITE( testVector );
CPPUNIT_TEST( all );
CPPUNIT_TEST_SUITE_END();
};
#endif
-
#include "squid.h"
#include "acl/FilledChecklist.h"
-#include "Array.h"
+#include "base/Vector.h"
#include "CachePeer.h"
#include "client_side_request.h"
#include "client_side.h"