|
|
@ -2,16 +2,16 @@ |
|
|
|
// see LICENSE.txt
|
|
|
|
|
|
|
|
#include "framework/framework.hh" |
|
|
|
#include "framework/utils.hh" |
|
|
|
#include <iostream> |
|
|
|
#include <assert.h> |
|
|
|
#include <unistd.h> |
|
|
|
#include <sys/param.h> |
|
|
|
//#include <sys/param.h>
|
|
|
|
|
|
|
|
#include <pEp/sync_api.h> |
|
|
|
#include <pEp/keymanagement.h> |
|
|
|
#include <pEp/message_api.h> |
|
|
|
//#include <pEp/message_api.h>
|
|
|
|
|
|
|
|
#include "../src/pEpLog.hh" |
|
|
|
#include "../src/Adapter.hh" |
|
|
|
|
|
|
|
using namespace std; |
|
|
@ -19,13 +19,13 @@ using namespace pEp; |
|
|
|
|
|
|
|
PEP_STATUS messageToSend(struct _message *msg) |
|
|
|
{ |
|
|
|
pEpLog("called()"); |
|
|
|
TESTLOG("called()"); |
|
|
|
return PEP_STATUS_OK; |
|
|
|
} |
|
|
|
|
|
|
|
PEP_STATUS notifyHandshake(::pEp_identity *me, ::pEp_identity *partner, ::sync_handshake_signal signal) |
|
|
|
{ |
|
|
|
pEpLog("called()"); |
|
|
|
TESTLOG("called()"); |
|
|
|
return PEP_STATUS_OK; |
|
|
|
} |
|
|
|
|
|
|
@ -34,7 +34,7 @@ int main(int argc, char **argv) |
|
|
|
Test::setup(argc, argv); |
|
|
|
|
|
|
|
// Create new identity
|
|
|
|
pEpLog("updating or creating identity for me"); |
|
|
|
TESTLOG("updating or creating identity for me"); |
|
|
|
::pEp_identity *me = new_identity("alice@peptest.ch", NULL, "23", "Who the F* is Alice"); |
|
|
|
assert(me); |
|
|
|
::PEP_STATUS status = ::myself(Adapter::session(), me); |
|
|
@ -45,12 +45,12 @@ int main(int argc, char **argv) |
|
|
|
useconds_t sleepuSec = 1000 * 100; |
|
|
|
unsigned long long int nrIters = 1000 * 1000 * 1000; |
|
|
|
for (int i = 0; i < nrIters; i++) { |
|
|
|
pEpLog("RUN NR: "); |
|
|
|
pEpLog(i); |
|
|
|
pEpLog("SYNC START"); |
|
|
|
pEpLog("starting the adapter including sync"); |
|
|
|
TESTLOG("RUN NR: "); |
|
|
|
TESTLOG(i); |
|
|
|
TESTLOG("SYNC START"); |
|
|
|
TESTLOG("starting the adapter including sync"); |
|
|
|
Adapter::startup(messageToSend, notifyHandshake); |
|
|
|
pEpLog("SYNC STOP"); |
|
|
|
TESTLOG("SYNC STOP"); |
|
|
|
usleep(sleepuSec); |
|
|
|
Adapter::shutdown(); |
|
|
|
} |
|
|
|