summaryrefslogtreecommitdiff
path: root/src/client-test-app.cpp
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2011-03-02 11:50:40 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2011-03-02 11:50:40 +0100
commit9351512a2a7b8c1f3a1d7e1a493c1d5773955ee2 (patch)
tree0040aee79e0db25e41064eedfe522898cdf19e6b /src/client-test-app.cpp
parentb2d6c401e2ca70fdb5be5f0f96e7665470b27a0d (diff)
ClientTestConfig: turned plain function pointer for "createSourceA/B" into boost::function
The intention is that backends shall be able to bind additional parameters to their implementation of the callbacks. The default implementation used by most (all?) backends was adapted, so no changes there are necessary.
Diffstat (limited to 'src/client-test-app.cpp')
-rw-r--r--src/client-test-app.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client-test-app.cpp b/src/client-test-app.cpp
index 3792ec93..34c4b4c5 100644
--- a/src/client-test-app.cpp
+++ b/src/client-test-app.cpp
@@ -40,6 +40,8 @@
#include <syncevo/util.h>
#include <syncevo/VolatileConfigNode.h>
+#include <boost/bind.hpp>
+
#include <syncevo/declarations.h>
#ifdef ENABLE_BUTEO_TESTS
@@ -309,7 +311,7 @@ public:
static void getSourceConfig(const RegisterSyncSourceTest *test, Config &config) {
memset(&config, 0, sizeof(config));
ClientTest::getTestData(test->m_testCaseName.c_str(), config);
- config.createSourceA = createSource;
+ config.createSourceA = boost::bind(createSource, _1, _2, _3);
config.createSourceB = createSource;
config.sourceName = test->m_configName.c_str();
@@ -482,11 +484,11 @@ private:
// implement Evolution shutdown workaround (see lockEvolution above)
evClient.checkEvolutionSource(name);
- return evClient.createSource(name, isSourceA);
+ return evClient.createNamedSource(name, isSourceA);
}
/** called internally in this class */
- TestingSyncSource *createSource(const string &name, bool isSourceA) {
+ TestingSyncSource *createNamedSource(const string &name, bool isSourceA) {
string database = getDatabaseName(name);
boost::shared_ptr<SyncConfig> context(new SyncConfig("source-config@client-test"));
SyncSourceNodes nodes = context->getSyncSourceNodes(name,
@@ -545,7 +547,7 @@ private:
if (!basename.empty() &&
lockEvolution.find(basename) == lockEvolution.end()) {
- lockEvolution[basename].reset(createSource(name, true));
+ lockEvolution[basename].reset(createNamedSource(name, true));
lockEvolution[basename]->open();
ClientTest::registerCleanup(CleanupSources);
}