test/include/SyncTests.h
branchsync
changeset 2886 ee600afcb920
parent 2852 135a3e49e48d
child 2887 c5ab1f6ad3ee
     1.1 --- a/test/include/SyncTests.h	Thu Aug 23 12:26:49 2018 +0200
     1.2 +++ b/test/include/SyncTests.h	Thu Aug 23 15:23:31 2018 +0200
     1.3 @@ -5,14 +5,42 @@
     1.4  #define SYNC_H
     1.5  
     1.6  #include <string>
     1.7 +#include <thread>
     1.8  #include "EngineTestSessionSuite.h"
     1.9 +#include "locked_queue.hh"
    1.10 +#include "sync_api.h"
    1.11 +#include "Sync_impl.h"
    1.12  
    1.13  using namespace std;
    1.14  
    1.15 +class Sync_Adapter {
    1.16 +public:
    1.17 +    utility::locked_queue< Sync_event_t * > q;
    1.18 +
    1.19 +    static PEP_STATUS notifyHandshake(
    1.20 +            void *obj,
    1.21 +            pEp_identity *me,
    1.22 +            pEp_identity *partner,
    1.23 +            sync_handshake_signal signal
    1.24 +        );
    1.25 +    static int inject_sync_event(SYNC_EVENT ev, void *management);
    1.26 +    static Sync_event_t *retrieve_next_sync_event(void *management);
    1.27 +    static PEP_STATUS messageToSend(void *obj, struct _message *msg);
    1.28 +
    1.29 +    static void sync_thread(PEP_SESSION session, Sync_Adapter *adapter);
    1.30 +};
    1.31 +
    1.32  class SyncTests : public EngineTestSessionSuite {
    1.33      public:
    1.34          SyncTests(string test_suite, string test_home_dir);
    1.35 +
    1.36 +        void setup();
    1.37 +        void tear_down();
    1.38 +
    1.39      private:
    1.40 +        Sync_Adapter adapter;
    1.41 +        PEP_SESSION sync = NULL;
    1.42 +        thread *sync_thread;
    1.43          void check_sync();
    1.44  };
    1.45