summaryrefslogtreecommitdiff
path: root/cpp/src/tests/PollableCondition.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-07-09 20:38:23 +0000
committerAlan Conway <aconway@apache.org>2009-07-09 20:38:23 +0000
commit0c5ace5d2114d638bdef5f4c2e29521c43f140a4 (patch)
tree575392461bf2bc98f8ea4b8f2c9241aad134cf55 /cpp/src/tests/PollableCondition.cpp
parentc25ed489bd7a5ae7fce248dcc105b9ad7f6a1e65 (diff)
downloadqpid-python-0c5ace5d2114d638bdef5f4c2e29521c43f140a4.tar.gz
Simplified PollableCondition
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@792676 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/PollableCondition.cpp')
-rw-r--r--cpp/src/tests/PollableCondition.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/cpp/src/tests/PollableCondition.cpp b/cpp/src/tests/PollableCondition.cpp
index 33664d43fc..b5cf1b4cd2 100644
--- a/cpp/src/tests/PollableCondition.cpp
+++ b/cpp/src/tests/PollableCondition.cpp
@@ -38,7 +38,7 @@ const Duration LONG = TIME_SEC/10;
class Callback {
public:
- enum Action { NONE, DISARM, CLEAR, DISARM_CLEAR };
+ enum Action { NONE, CLEAR };
Callback() : count(), action(NONE) {}
@@ -47,9 +47,7 @@ class Callback {
++count;
switch(action) {
case NONE: break;
- case DISARM: pc.disarm(); break;
case CLEAR: pc.clear(); break;
- case DISARM_CLEAR: pc.disarm(); pc.clear(); break;
}
action = NONE;
lock.notify();
@@ -86,27 +84,19 @@ QPID_AUTO_TEST_CASE(testPollableCondition) {
Thread runner = Thread(*poller);
- BOOST_CHECK(callback.isNotCalling()); // condition is not set or armed.
-
- pc.rearm();
- BOOST_CHECK(callback.isNotCalling()); // Armed but not set
+ BOOST_CHECK(callback.isNotCalling()); // condition is not set.
pc.set();
- BOOST_CHECK(callback.isCalling()); // Armed and set.
- BOOST_CHECK(callback.isCalling()); // Still armed and set.
-
- callback.nextCall(Callback::DISARM);
- BOOST_CHECK(callback.isNotCalling()); // set but not armed
+ BOOST_CHECK(callback.isCalling()); // Set.
+ BOOST_CHECK(callback.isCalling()); // Still set.
- pc.rearm();
- BOOST_CHECK(callback.isCalling()); // Armed and set.
- callback.nextCall(Callback::CLEAR);
- BOOST_CHECK(callback.isNotCalling()); // armed but not set
+ callback.nextCall(Callback::CLEAR);
+ BOOST_CHECK(callback.isNotCalling()); // Cleared
pc.set();
- BOOST_CHECK(callback.isCalling()); // Armed and set.
- callback.nextCall(Callback::DISARM_CLEAR);
- BOOST_CHECK(callback.isNotCalling()); // not armed or set.
+ BOOST_CHECK(callback.isCalling()); // Set.
+ callback.nextCall(Callback::CLEAR);
+ BOOST_CHECK(callback.isNotCalling()); // Cleared.
poller->shutdown();
runner.join();