]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: Move testRefCount to src/
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 1 Nov 2012 10:31:28 +0000 (23:31 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 1 Nov 2012 10:31:28 +0000 (23:31 +1300)
It seems the automake dependencies on stub_*.o are still not working well
and ICC requires several stubs in order to link libbase.la.

This also adds new stubs for MemBuf.h and cbdata.h APIs.

src/Makefile.am
src/base/Makefile.am
src/tests/stub_MemBuf.cc [new file with mode: 0644]
src/tests/stub_cbdata.cc [new file with mode: 0644]
src/tests/testRefCount.cc [moved from src/base/testRefCount.cc with 100% similarity]

index 6da7b724e9fca4895d7192d369b95200bace2478..6db06c5364397ee0077c7104f1c75cc9fc480acf 100644 (file)
@@ -3210,6 +3210,20 @@ tests_testUfs_LDFLAGS = $(LIBADD_DL)
 tests_testUfs_DEPENDENCIES = \
        $(SWAP_TEST_DS)
 
+check_PROGRAMS += testRefCount
+testRefCount_SOURCES= \
+       base/Lock.h \
+       base/RefCount.h \
+       tests/stub_cbdata.cc \
+       tests/stub_debug.cc \
+       tests/stub_MemBuf.cc \
+       tests/testRefCount.cc
+testRefCount_LDADD = \
+       base/libbase.la \
+       $(top_builddir)/lib/libmiscutil.la \
+       $(COMPAT_LIB) \
+       $(XTRA_LIBS)
+
 tests_testRock_SOURCES = \
        cbdata.cc \
        CacheDigest.h \
index 38e4f3b1432da032503ef781b85f3f0dbbe38667..f774d22f305f6bc88c3f8d0f6b097466c715741e 100644 (file)
@@ -1,4 +1,3 @@
-
 include $(top_srcdir)/src/Common.am
 include $(top_srcdir)/src/TestHeaders.am
 
@@ -23,17 +22,3 @@ libbase_la_SOURCES = \
        TextException.cc \
        TextException.h \
        StringArea.h
-
-check_PROGRAMS += testRefCount
-
-testRefCount_SOURCES= \
-       Lock.h \
-       RefCount.h \
-       testRefCount.cc
-
-testRefCount_LDADD = \
-       libbase.la \
-       $(top_builddir)/lib/libmiscutil.la \
-       $(COMPAT_LIB) \
-       $(XTRA_LIBS)
-
diff --git a/src/tests/stub_MemBuf.cc b/src/tests/stub_MemBuf.cc
new file mode 100644 (file)
index 0000000..521fe32
--- /dev/null
@@ -0,0 +1,28 @@
+#include "squid.h"
+#include "MemBuf.h"
+
+#define STUB_API "MemBuf.cc"
+#include "tests/STUB.h"
+
+mb_size_t MemBuf::spaceSize() const STUB_RETVAL(0)
+mb_size_t MemBuf::potentialSpaceSize() const STUB_RETVAL(0)
+void MemBuf::consume(mb_size_t sz) STUB
+void MemBuf::append(const char *c, mb_size_t sz) STUB
+void MemBuf::appended(mb_size_t sz) STUB
+void MemBuf::truncate(mb_size_t sz) STUB
+void MemBuf::terminate() STUB
+void MemBuf::init(mb_size_t szInit, mb_size_t szMax) STUB
+void MemBuf::init() STUB
+void MemBuf::clean() STUB
+void MemBuf::reset() STUB
+int MemBuf::isNull() STUB_RETVAL(1)
+void MemBuf::Printf(const char *fmt,...) STUB
+void MemBuf::vPrintf(const char *fmt, va_list ap) STUB
+FREE *MemBuf::freeFunc() STUB_RETVAL(NULL)
+
+#if !_USE_INLINE_
+#include "MemBuf.cci"
+#endif
+
+void memBufReport(MemBuf * mb) STUB
+void packerToMemInit(Packer * p, MemBuf * mb) STUB
diff --git a/src/tests/stub_cbdata.cc b/src/tests/stub_cbdata.cc
new file mode 100644 (file)
index 0000000..c4eaec1
--- /dev/null
@@ -0,0 +1,24 @@
+#include "squid.h"
+#include "cbdata.h"
+
+#define STUB_API "cbdata.cc"
+#include "tests/STUB.h"
+
+void cbdataRegisterWithCacheManager(void) STUB
+
+#if USE_CBDATA_DEBUG
+void *cbdataInternalAllocDbg(cbdata_type type, const char *, int) STUB_RETVAL(NULL)
+void *cbdataInternalFreeDbg(void *p, const char *, int) STUB_RETVAL(NULL)
+void cbdataInternalLockDbg(const void *p, const char *, int) STUB
+void cbdataInternalUnlockDbg(const void *p, const char *, int) STUB
+int cbdataInternalReferenceDoneValidDbg(void **p, void **tp, const char *, int) STUB_RETVAL(0)
+#else
+void *cbdataInternalAlloc(cbdata_type type) STUB_RETVAL(NULL)
+void *cbdataInternalFree(void *p) STUB_RETVAL(NULL)
+void cbdataInternalLock(const void *p) STUB
+void cbdataInternalUnlock(const void *p) STUB
+int cbdataInternalReferenceDoneValid(void **p, void **tp) STUB_RETVAL(0)
+#endif
+
+int cbdataReferenceValid(const void *p) STUB_RETVAL(0)
+cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, FREE * free_func) STUB_RETVAL(CBDATA_UNKNOWN)