summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2013-04-26 02:13:50 -0700
committerPatrick Ohly <patrick.ohly@intel.com>2013-05-13 17:49:50 +0200
commit9a3b17b82a1e5ecce56406c0be6af4d9e4b9d33f (patch)
tree5c02bc1536056b55bc1f6ccba522e0fd17774faa /test
parent05fb1aebc3242c0cf734f18f0582df8cb05e0999 (diff)
engine: eliminate virtual checkForSuspend/Abort()
Since the introduction of SuspendFlags, the ony remaining user of the virtual aspect of checkForSuspend/checkForAbort() was the testing code. By using the suspend/abort request mechanism in SuspendFlags, it becomes possible to move checkForSuspend/Abort() into SuspendFlags itself. This will be useful to use it outside of a SyncContext member.
Diffstat (limited to 'test')
-rw-r--r--test/ClientTest.cpp2
-rw-r--r--test/ClientTest.h8
2 files changed, 4 insertions, 6 deletions
diff --git a/test/ClientTest.cpp b/test/ClientTest.cpp
index 305ea27d..e6e8c285 100644
--- a/test/ClientTest.cpp
+++ b/test/ClientTest.cpp
@@ -5329,7 +5329,7 @@ public:
m_messageCount++;
if (m_interruptAtMessage >= 0 &&
m_messageCount > m_interruptAtMessage) {
- m_options->m_isSuspended = true;
+ m_options->m_isSuspended = SuspendFlags::getSuspendFlags().suspend();
}
m_wrappedAgent->getReply(data, len, contentType);
}
diff --git a/test/ClientTest.h b/test/ClientTest.h
index 7fa37a22..f4e3a75c 100644
--- a/test/ClientTest.h
+++ b/test/ClientTest.h
@@ -32,6 +32,7 @@
#include <SyncML.h>
#include <TransportAgent.h>
#include <SyncSource.h>
+#include <syncevo/SuspendFlags.h>
#include "test.h"
#include "ClientTestAssert.h"
@@ -138,9 +139,8 @@ struct SyncOptions {
int m_retryDuration;
int m_retryInterval;
- bool m_isSuspended;
-
- bool m_isAborted;
+ boost::shared_ptr<SuspendFlags::StateBlocker> m_isSuspended;
+ boost::shared_ptr<SuspendFlags::StateBlocker> m_isAborted;
/**
* Callback to be invoked after setting up local sources, but
@@ -176,8 +176,6 @@ struct SyncOptions {
m_isWBXML(isWBXML),
m_retryDuration(300),
m_retryInterval(60),
- m_isSuspended(false),
- m_isAborted(false),
m_startCallback(startCallback),
m_transport (transport)
{}