summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/Cluster.cpp16
-rw-r--r--cpp/src/tests/Cluster.h2
-rw-r--r--cpp/src/tests/cluster.mk6
3 files changed, 14 insertions, 10 deletions
diff --git a/cpp/src/tests/Cluster.cpp b/cpp/src/tests/Cluster.cpp
index b3a6a745b8..531a74b0c2 100644
--- a/cpp/src/tests/Cluster.cpp
+++ b/cpp/src/tests/Cluster.cpp
@@ -42,8 +42,8 @@ BOOST_AUTO_TEST_CASE(testClusterOne) {
BOOST_CHECK_EQUAL(1u, cluster.size());
Cluster::MemberList members = cluster.getMembers();
BOOST_CHECK_EQUAL(1u, members.size());
- shared_ptr<const Cluster::Member> me=members.front();
- BOOST_REQUIRE_EQUAL(me->url, "amqp:one:1");
+ Cluster::Member me=members.front();
+ BOOST_REQUIRE_EQUAL(me.url, "amqp:one:1");
}
/** Fork a process to test a cluster with two members */
@@ -93,18 +93,18 @@ struct CountHandler : public FrameHandler {
BOOST_AUTO_TEST_CASE(testClassifierHandlerWiring) {
AMQFrame queueDecl(0, QueueDeclareBody(VER));
AMQFrame messageTrans(0, MessageTransferBody(VER));
- shared_ptr<CountHandler> wiring(new CountHandler());
- shared_ptr<CountHandler> other(new CountHandler());
+ CountHandler wiring;
+ CountHandler other;
ClassifierHandler classify(wiring, other);
classify.handle(queueDecl);
- BOOST_CHECK_EQUAL(1u, wiring->count);
- BOOST_CHECK_EQUAL(0u, other->count);
+ BOOST_CHECK_EQUAL(1u, wiring.count);
+ BOOST_CHECK_EQUAL(0u, other.count);
classify.handle(messageTrans);
- BOOST_CHECK_EQUAL(1u, wiring->count);
- BOOST_CHECK_EQUAL(1u, other->count);
+ BOOST_CHECK_EQUAL(1u, wiring.count);
+ BOOST_CHECK_EQUAL(1u, other.count);
}
diff --git a/cpp/src/tests/Cluster.h b/cpp/src/tests/Cluster.h
index 366ea92a8b..d14d7c1392 100644
--- a/cpp/src/tests/Cluster.h
+++ b/cpp/src/tests/Cluster.h
@@ -58,7 +58,7 @@ typedef TestHandler<AMQFrame> TestFrameHandler;
struct TestCluster : public Cluster
{
TestCluster(string name, string url)
- : Cluster(name, url, make_shared_ptr(&received, nullDeleter)) {}
+ : Cluster(name, url, *(qpid::broker::Broker*)0) {}
/** Wait for cluster to be of size n. */
bool waitFor(size_t n) {
diff --git a/cpp/src/tests/cluster.mk b/cpp/src/tests/cluster.mk
index 092647c9eb..4c5ee2108b 100644
--- a/cpp/src/tests/cluster.mk
+++ b/cpp/src/tests/cluster.mk
@@ -20,7 +20,11 @@ AIS_TESTS=
ais_check: ais_tests
ais_tests:
- echo $(AIS_TESTS) >$@
+ echo $(AIS_TESTS)
+ echo "# AIS tests" >$@
+ for t in $(AIS_TESTS); do echo ./$$t >$@; done
+ chmod a+x $@
+
CLEANFILES+=ais_tests
AIS_TESTS+=Cpg