summaryrefslogtreecommitdiff
path: root/qpid/cpp/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-03-28 21:45:06 +0000
committerAlan Conway <aconway@apache.org>2007-03-28 21:45:06 +0000
commit7cd249e7965f9b35050fa7504991a9facf0d1fbb (patch)
treeff1f4fbe4dd0772dd13b55b1ebfc90ad4c529019 /qpid/cpp/tests
parent2f758d6131675cd025dfe7c08d55758b7536d638 (diff)
downloadqpid-python-7cd249e7965f9b35050fa7504991a9facf0d1fbb.tar.gz
* cpp/tests/run-unit-tests,setup: use valgrind --log-file rather than
redirecting stderr. Redirecting also swallows DllPlugInTester output. * cpp/lib/common/sys/Acceptor.h: getPort() to return uint16_t, not int16t. Note AcceptorTest is not inclued in Makefile.am. I fixed it to compile but it hangs, need to determine if it's a test or an Acceptor bug. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@523473 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/tests')
-rw-r--r--qpid/cpp/tests/AcceptorTest.cpp11
-rw-r--r--qpid/cpp/tests/Makefile.am1
-rw-r--r--qpid/cpp/tests/MockConnectionInputHandler.h4
-rwxr-xr-xqpid/cpp/tests/run-unit-tests4
-rw-r--r--qpid/cpp/tests/setup1
5 files changed, 14 insertions, 7 deletions
diff --git a/qpid/cpp/tests/AcceptorTest.cpp b/qpid/cpp/tests/AcceptorTest.cpp
index 34a51888d4..947ae2d11a 100644
--- a/qpid/cpp/tests/AcceptorTest.cpp
+++ b/qpid/cpp/tests/AcceptorTest.cpp
@@ -49,9 +49,10 @@ class AcceptorTest : public CppUnit::TestCase, private Runnable
Acceptor::shared_ptr acceptor;
public:
-
+ using TestCase::run; // Avoid hiding TestCase::run.
+
void run() {
- acceptor->run(factory);
+ acceptor->run(&factory);
}
void setUp() {
@@ -65,7 +66,7 @@ class AcceptorTest : public CppUnit::TestCase, private Runnable
void testAccept()
{
int port = acceptor->getPort();
- CPPUNIT_ASSERT(port > 0);
+ CPPUNIT_ASSERT(port != 0);
Thread runThread(*this);
// Connect to the acceptor
Socket client = Socket::createTcp();
@@ -84,7 +85,9 @@ class AcceptorTest : public CppUnit::TestCase, private Runnable
CPPUNIT_ASSERT_EQUAL(int(2), int(init.getMinor()));
acceptor->shutdown();
- runThread.join();
+ printf("== join\n"); // FIXME aconway 2007-03-28:
+ runThread.join();
+ printf("== joined\n"); // FIXME aconway 2007-03-28:
factory.handler->waitForClosed();
}
};
diff --git a/qpid/cpp/tests/Makefile.am b/qpid/cpp/tests/Makefile.am
index 6ae3598a98..e06901ed96 100644
--- a/qpid/cpp/tests/Makefile.am
+++ b/qpid/cpp/tests/Makefile.am
@@ -12,6 +12,7 @@ INCLUDES = \
# Unit tests
broker_tests = \
AccumulatedAckTest \
+ AcceptorTest \
BrokerChannelTest \
ConfigurationTest \
ExchangeTest \
diff --git a/qpid/cpp/tests/MockConnectionInputHandler.h b/qpid/cpp/tests/MockConnectionInputHandler.h
index b039e244d9..55dbceaf44 100644
--- a/qpid/cpp/tests/MockConnectionInputHandler.h
+++ b/qpid/cpp/tests/MockConnectionInputHandler.h
@@ -30,9 +30,9 @@ struct MockConnectionInputHandler : public qpid::sys::ConnectionInputHandler {
~MockConnectionInputHandler() {}
- void initiated(qpid::framing::ProtocolInitiation* pi) {
+ void initiated(const qpid::framing::ProtocolInitiation& pi) {
qpid::sys::Monitor::ScopedLock l(monitor);
- init = *pi;
+ init = pi;
setState(GOT_INIT);
}
diff --git a/qpid/cpp/tests/run-unit-tests b/qpid/cpp/tests/run-unit-tests
index e97309a59f..1f11f9acc7 100755
--- a/qpid/cpp/tests/run-unit-tests
+++ b/qpid/cpp/tests/run-unit-tests
@@ -8,11 +8,13 @@
test -z "$VALGRIND" -a -z "$MAKEFLAGS" && VALGRIND=`which valgrind` 2>/dev/null
test -z "$srcdir" && srcdir=.
+rm -f valgrind.out
+vg_log=--log-file-exactly=valgrind.out
source $srcdir/setup
for u in $* $UNIT_TESTS ; do TESTLIBS="$TESTLIBS $pwd/.libs/$u.so" ; done
test -z "$TESTLIBS" && TESTLIBS="$pwd/.libs/*Test.so"
fail=0
-$vg DllPlugInTester -c -b $TESTLIBS 2> valgrind.out || fail=1
+$vg DllPlugInTester -c -b $TESTLIBS || fail=1
vg_check valgrind.out || fail=1
exit $fail
diff --git a/qpid/cpp/tests/setup b/qpid/cpp/tests/setup
index febf613847..aaa3afd9b8 100644
--- a/qpid/cpp/tests/setup
+++ b/qpid/cpp/tests/setup
@@ -27,6 +27,7 @@ vg_options="
$demangle
$full_leak_check
$gen_supp
+ $vg_log
"
# configure tests for the existence of valgrind.
# If it's not available, then make $vg and vg_check no-ops.