summaryrefslogtreecommitdiff
path: root/cpp/src/tests/resuming_receiver.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-02-27 18:11:47 +0000
committerGordon Sim <gsim@apache.org>2009-02-27 18:11:47 +0000
commit067a67c5c422c9bec63210ccf58f30241b521cea (patch)
tree64f783170386095c005a65dcd54d5d980b1c6528 /cpp/src/tests/resuming_receiver.cpp
parentbdf674be05b7a205ad3802e14df4d686746d657b (diff)
downloadqpid-python-067a67c5c422c9bec63210ccf58f30241b521cea.tar.gz
Fix test to account for failure after last message has been delivered, but before the session and connection are closed.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@748624 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/resuming_receiver.cpp')
-rw-r--r--cpp/src/tests/resuming_receiver.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/cpp/src/tests/resuming_receiver.cpp b/cpp/src/tests/resuming_receiver.cpp
index f49a115e1e..da7c5f32ff 100644
--- a/cpp/src/tests/resuming_receiver.cpp
+++ b/cpp/src/tests/resuming_receiver.cpp
@@ -53,6 +53,7 @@ class Listener : public MessageListener,
bool gaps;
uint reportFrequency;
int verbosity;
+ bool done;
};
@@ -62,7 +63,8 @@ Listener::Listener(int freq, int verbosity)
lastSn(0),
gaps(false),
reportFrequency(freq),
- verbosity(verbosity)
+ verbosity(verbosity),
+ done(false)
{}
@@ -116,9 +118,11 @@ void Listener::execute(AsyncSession& session, bool isRetry)
if (isRetry) {
// std::cout << "Resuming from " << count << std::endl;
}
- SubscriptionManager subs(session);
- subscription = subs.subscribe(*this, "message_queue");
- subs.run();
+ if (!done) {
+ SubscriptionManager subs(session);
+ subscription = subs.subscribe(*this, "message_queue");
+ subs.run();
+ }
}
void Listener::editUrlList(std::vector<Url>& urls)