summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/.valgrind.supp7
-rw-r--r--cpp/src/tests/ForkedBroker.h5
-rw-r--r--cpp/src/tests/cluster_test.cpp7
3 files changed, 13 insertions, 6 deletions
diff --git a/cpp/src/tests/.valgrind.supp b/cpp/src/tests/.valgrind.supp
index dd8f7536a1..3b1fd2198a 100644
--- a/cpp/src/tests/.valgrind.supp
+++ b/cpp/src/tests/.valgrind.supp
@@ -193,9 +193,10 @@
}
{
- CPG related errors - seem benign but should invesgitate.
+ CPG error - seems benign.
Memcheck:Param
socketcall.sendmsg(msg.msg_iov[i])
- fun:sendmsg
- obj:/usr/lib/openais/libcpg.so.2.0.0
+ obj:*
+ obj:*/libcpg.so.2.0.0
}
+
diff --git a/cpp/src/tests/ForkedBroker.h b/cpp/src/tests/ForkedBroker.h
index 07e69a0735..cc8714bf23 100644
--- a/cpp/src/tests/ForkedBroker.h
+++ b/cpp/src/tests/ForkedBroker.h
@@ -85,7 +85,10 @@ class ForkedBroker {
::close(pipeFds[1]);
FILE* f = ::fdopen(pipeFds[0], "r");
if (!f) throw ErrnoException("fopen failed");
- if (::fscanf(f, "%d", &port) != 1) throw ErrnoException("ill-formatted port");
+ if (::fscanf(f, "%d", &port) != 1) {
+ if (ferror(f)) throw ErrnoException("Error reading port number from child.");
+ else throw qpid::Exception("EOF reading port number from child.");
+ }
}
else { // child
::close(pipeFds[0]);
diff --git a/cpp/src/tests/cluster_test.cpp b/cpp/src/tests/cluster_test.cpp
index 3f09143fff..9abc1b189e 100644
--- a/cpp/src/tests/cluster_test.cpp
+++ b/cpp/src/tests/cluster_test.cpp
@@ -27,6 +27,7 @@
#include "qpid/client/Connection.h"
#include "qpid/client/Session.h"
#include "qpid/framing/Uuid.h"
+#include "qpid/log/Logger.h"
#include <boost/bind.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
@@ -87,7 +88,7 @@ ClusterFixture::ClusterFixture(size_t n) : name(Uuid(true).str()) {
void ClusterFixture::add() {
std::ostringstream os;
- os << "broker" << size();
+ os << "fork" << size();
std::string prefix = os.str();
const char* argv[] = {
@@ -105,6 +106,7 @@ void ClusterFixture::add() {
}
else { // First broker, run in this process.
Broker::Options opts;
+ qpid::log::Logger::instance().setPrefix("main");
Plugin::addOptions(opts); // Pick up cluster options.
opts.parse(argc, argv, "", true); // Allow-unknown for --load-module
broker0.reset(new BrokerFixture(opts));
@@ -144,7 +146,8 @@ QPID_AUTO_TEST_CASE(testSingletonCluster) {
ClusterFixture cluster(1);
Client c(cluster[0]);
BOOST_CHECK(c.session.queueQuery("q").getQueue().empty());
- BOOST_CHECK(c.session.exchangeQuery("ex").getType().empty());
+ BOOST_CHECK(c.session.exchangeQuery("ex").getType().empty());
+ // FIXME aconway 2008-09-01: leaks if aisexec not running, investigate.
}
QPID_AUTO_TEST_CASE(testWiringReplication) {