亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? clienttest.h

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? H
?? 第 1 頁 / 共 2 頁
字號:
     * Returning true enables tests which only work if the server is
     * a Funambol server which supports the "b64" encoding of items
     * on the transport level.
     */
    virtual bool isB64Enabled() = 0;

    /**
     * Execute a synchronization with the selected sync sources
     * and the selected synchronization options. The log file
     * in LOG has been set up already for the synchronization run
     * and should not be changed by the client.
     *
     * @param activeSources a -1 terminated array of sync source indices
     * @param syncMode     the synchronization mode to be used
     * @param checkReport  has to be called after a successful or unsuccessful sync,
     *                     will dump the report and (optionally) check the result;
     *                     beware, the later may throw exceptions inside CPPUNIT macros
     * @param maxMsgSize   >0: enable the maximum message size, else disable it
     * @param maxObjSize   same as maxMsgSize for maximum object size
     * @param loSupport    if TRUE, then the sync is expected to enable Large Object support
     * @param encoding     if non-empty, then let client library transform all items
     *                     into this format (guaranteed to be not NULL)
     *
     * @return return code of SyncClient::sync()
     */
    virtual int sync(
        const int *activeSources,
        SyncMode syncMode,
        const CheckSyncReport &checkReport,
        long maxMsgSize = 0,
        long maxObjSize = 0,
        bool loSupport = false,
        const char *encoding = "") = 0;

    /**
     * This is called after successful sync() calls (res == 0) as well
     * as after unsuccessful ones (res != 1). The default implementation
     * sleeps for the number of seconds specified when constructing this
     * instance and copies the server log if one was named.
     *
     * @param res       result of sync()
     * @param logname   base name of the current sync log (without ".client.[AB].log" suffix)
     */
    virtual void postSync(int res, const std::string &logname);

  protected:
    /**
     * time to sleep in postSync()
     */
    int serverSleepSeconds;

    /**
     * server log file which is copied by postSync() and then
     * truncated (Unix only, Windows does not allow such access
     * to an open file)
     */
    std::string serverLogFileName;

  private:
    /**
     * really a CppUnit::TestFactory, but declared as void * to avoid
     * dependencies on the CPPUnit header files: created by
     * registerTests() and remains valid until the client is deleted
     */
    void *factory;
};

/**
 * helper class to encapsulate ClientTest::Config::createsource_t
 * pointer and the corresponding parameters
 */
class CreateSource {
public:
    CreateSource(ClientTest::Config::createsource_t createSourceParam, ClientTest &clientParam, int sourceParam, bool isSourceAParam) :
        createSource(createSourceParam),
        client(clientParam),
        source(sourceParam),
        isSourceA(isSourceAParam) {}

    SyncSource *operator() () {
        CPPUNIT_ASSERT(createSource);
        return createSource(client, source, isSourceA);
    }

    const ClientTest::Config::createsource_t createSource;
    ClientTest &client;
    const int source;
    const bool isSourceA;
};


/**
 * local test of one sync source and utility functions also used by
 * sync tests
 */
class LocalTests : public CppUnit::TestSuite, public CppUnit::TestFixture {
public:
    /** the client we are testing */
    ClientTest &client;

    /** number of the source we are testing in that client */
    const int source;

    /** configuration that corresponds to source */
    const ClientTest::Config config;

    /** helper funclets to create sources */
    CreateSource createSourceA, createSourceB;

    LocalTests(const std::string &name, ClientTest &cl, int sourceParam, ClientTest::Config &co) :
        CppUnit::TestSuite(name),
        client(cl),
        source(sourceParam),
        config(co),
        createSourceA(co.createSourceA, cl, sourceParam, true),
        createSourceB(co.createSourceB, cl, sourceParam, false)
        {}

    /**
     * adds the supported tests to the instance itself;
     * this is the function that a derived class can override
     * to add additional tests
     */
    virtual void addTests();

    /**
     * opens source and inserts the given item; can be called
     * regardless whether the data source already contains items or not
     *
     * The type of the item is unset; it is assumed that the source
     * can handle that.
     */
    virtual void insert(CreateSource createSource, const char *data);

    /**
     * assumes that exactly one element is currently inserted and updates it with the given item
     *
     * The type of the item is cleared, as in insert() above.
     *
     * @param check     if true, then reopen the source and verify that the reported items are as expected
     */
    virtual void update(CreateSource createSource, const char *data, bool check = true);

    /** deletes all items locally via sync source */
    virtual void deleteAll(CreateSource createSource);

    /**
     * takes two databases, exports them,
     * then compares them using synccompare
     *
     * @param refFile      existing file with source reference items, NULL uses a dump of sync source A instead
     * @param copy         a sync source which contains the copied items, begin/endSync will be called
     * @param raiseAssert  raise assertion if comparison yields differences (defaults to true)
     */
    virtual void compareDatabases(const char *refFile, SyncSource &copy, bool raiseAssert = true);

    /**
     * insert artificial items, number of them determined by TEST_EVOLUTION_NUM_ITEMS
     * unless passed explicitly
     *
     * @param createSource    a factory for the sync source that is to be used
     * @param startIndex      IDs are generated starting with this value
     * @param numItems        number of items to be inserted if non-null, otherwise TEST_EVOLUTION_NUM_ITEMS is used
     * @param size            minimum size for new items
     * @return number of items inserted
     */
    virtual int insertManyItems(CreateSource createSource, int startIndex = 1, int numItems = 0, int size = -1);


    /* for more information on the different tests see their implementation */
    
    virtual void testOpen();
    virtual void testIterateTwice();
    virtual void testSimpleInsert();
    virtual void testLocalDeleteAll();
    virtual void testComplexInsert();
    virtual void testLocalUpdate();
    virtual void testChanges();
    virtual void testImport();
    virtual void testImportDelete();
    virtual void testManyChanges();
};

enum itemType {
    NEW_ITEMS,
    UPDATED_ITEMS,
    DELETED_ITEMS,
    TOTAL_ITEMS
};

/**
 * utility function which counts items of a certain kind known to the sync source
 * @param source      valid source ready to iterate; NULL triggers an assert
 * @param itemType    determines which iterator functions are used
 * @return number of valid items iterated over
 */
int countItemsOfType(SyncSource *source, itemType type);

/**
 * Tests synchronization with one or more sync sources enabled.
 * When testing multiple sources at once only the first config
 * is checked to see which tests can be executed.
 */
class SyncTests : public CppUnit::TestSuite, public CppUnit::TestFixture {
public:
    /** the client we are testing */
    ClientTest &client;

    SyncTests(const std::string &name, ClientTest &cl, std::vector<int> sourceIndices, bool isClientA = true);
    ~SyncTests();

    /** adds the supported tests to the instance itself */
    virtual void addTests();

protected:
    /** list with all local test classes for manipulating the sources and their index in the client */
    std::vector< std::pair<int, LocalTests *> > sources;
    typedef std::vector< std::pair<int, LocalTests *> >::iterator source_it;

    /** the indices from sources, terminated by -1 (for sync()) */
    int *sourceArray;

    /** utility functions for second client */
    SyncTests *accessClientB;

    enum DeleteAllMode {
        DELETE_ALL_SYNC,   /**< make sure client and server are in sync,
                              delete locally,
                              sync again */
        DELETE_ALL_REFRESH /**< delete locally, refresh server */
    };

    /** compare databases of first and second client */
    virtual void compareDatabases();

    /** deletes all items locally and on server */
    virtual void deleteAll(DeleteAllMode mode = DELETE_ALL_SYNC);

    /** get both clients in sync with empty server, then copy one item from client A to B */
    virtual void doCopy();

    /**
     * replicate server database locally: same as SYNC_REFRESH_FROM_SERVER,
     * but done with explicit local delete and then a SYNC_SLOW because some
     * servers do no support SYNC_REFRESH_FROM_SERVER
     */
    virtual void refreshClient();

    /* for more information on the different tests see their implementation */

    // do a two-way sync without additional checks
    virtual void testTwoWaySync() {
        sync(SYNC_TWO_WAY);
    }
    
    // do a slow sync without additional checks
    virtual void testSlowSync() {
        sync(SYNC_SLOW);
    }
    // do a refresh from server sync without additional checks
    virtual void testRefreshFromServerSync() {
        sync(SYNC_REFRESH_FROM_SERVER);
    }

    // do a refresh from client sync without additional checks
    virtual void testRefreshFromClientSync() {
        sync(SYNC_REFRESH_FROM_CLIENT);
    }

    // delete all items, locally and on server using two-way sync
    virtual void testDeleteAllSync() {
        deleteAll(DELETE_ALL_SYNC);
    }

    virtual void testDeleteAllRefresh();
    virtual void testRefreshSemantic();
    virtual void testRefreshStatus();

    // test that a two-way sync copies an item from one address book into the other
    void testCopy() {
        doCopy();
        compareDatabases();
    }

    virtual void testUpdate();
    virtual void testComplexUpdate();
    virtual void testDelete();
    virtual void testMerge();
    virtual void testTwinning();
    virtual void testOneWayFromServer();
    virtual void testOneWayFromClient();
    virtual void testItems();
    virtual void testAddUpdate();

    // test copying with maxMsg and no large object support
    void testMaxMsg() {
        doVarSizes(true, false, NULL);
    }
    // test copying with maxMsg and large object support
    void testLargeObject() {
        doVarSizes(true, true, NULL);
    }
    // test copying with maxMsg and large object support using explicit "bin" encoding
    void testLargeObjectBin() {
        doVarSizes(true, true, "bin");
    }
    // test copying with maxMsg and large object support using B64 encoding
    void testLargeObjectEncoded() {
        doVarSizes(true, true, "b64");
    }

    virtual void testManyItems();


    /**
     * implements testMaxMsg(), testLargeObject(), testLargeObjectEncoded()
     * using a sequence of items with varying sizes
     */
    virtual void doVarSizes(bool withMaxMsgSize,
                            bool withLargeObject,
                            const char *encoding);

    /**
     * executes a sync with the given options,
     * checks the result and (optionally) the sync report
     */
    virtual void sync(SyncMode syncMode,
                      const std::string &logprefix = "",
                      CheckSyncReport checkReport = CheckSyncReport(),
                      long maxMsgSize = 0,
                      long maxObjSize = 0,
                      bool loSupport = false,
                      const char *encoding = "");
};


/** assert equality, include string in message if unequal */
#define CLIENT_TEST_EQUAL( _prefix, \
                           _expected, \
                           _actual ) \
    CPPUNIT_ASSERT_EQUAL_MESSAGE( std::string(_prefix) + ": " + #_expected + " == " + #_actual, \
                                  _expected, \
                                  _actual )

/** execute _x and then check the status of the _source pointer */
#define SOURCE_ASSERT_NO_FAILURE(_source, _x) \
{ \
    CPPUNIT_ASSERT_NO_THROW(_x); \
    CPPUNIT_ASSERT((_source) && (!(_source)->getReport() || (_source)->getReport()->getState() != SOURCE_ERROR)); \
}

/** check _x for true and then the status of the _source pointer */
#define SOURCE_ASSERT(_source, _x) \
{ \
    CPPUNIT_ASSERT(_x); \
    CPPUNIT_ASSERT((_source) && (!(_source)->getReport() || (_source)->getReport()->getState() != SOURCE_ERROR)); \
}

/** check that _x evaluates to a specific value and then the status of the _source pointer */
#define SOURCE_ASSERT_EQUAL(_source, _value, _x) \
{ \
    CPPUNIT_ASSERT_EQUAL(_value, _x); \
    CPPUNIT_ASSERT((_source) && (!(_source)->getReport() || (_source)->getReport()->getState() != SOURCE_ERROR)); \
}

/** same as SOURCE_ASSERT() with a specific failure message */
#define SOURCE_ASSERT_MESSAGE(_message, _source, _x)     \
{ \
    CPPUNIT_ASSERT_MESSAGE((_message), (_x)); \
    CPPUNIT_ASSERT((_source) && (!(_source)->getReport() || (_source)->getReport()->getState() != SOURCE_ERROR)); \
}


/**
 * convenience macro for adding a test name like a function,
 * to be used inside addTests() of an instance of that class
 *
 * @param _class      class which contains the function
 * @param _function   a function without parameters in that class
 */
#define ADD_TEST(_class, _function) \
    addTest(new CppUnit::TestCaller<_class>(getName() + "::" #_function, &_class::_function, *this))


#endif // ENABLE_INTEGRATION_TESTS

/** @} */
/** @endcond */
#endif // INCL_TESTSYNCCLIENT

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产手机| 久久er精品视频| 一区二区三国产精华液| 一区在线播放视频| 亚洲国产精品欧美一二99| 天天综合天天综合色| 久久99精品视频| 91在线视频免费91| 欧美日韩一区高清| 欧美电影免费观看高清完整版在| 国产人伦精品一区二区| 亚洲国产精品嫩草影院| 成人免费电影视频| 日韩三级免费观看| 亚洲精品综合在线| 国产丶欧美丶日本不卡视频| 欧美综合一区二区| 国产日产欧美精品一区二区三区| 亚洲精品高清在线| 国产一区二区久久| 3atv在线一区二区三区| 亚洲一区二三区| 99九九99九九九视频精品| 国产亚洲婷婷免费| 久久国产精品色婷婷| 欧美精品电影在线播放| 亚洲一区二区av在线| 91麻豆6部合集magnet| 国产精品网曝门| 成人久久久精品乱码一区二区三区 | 17c精品麻豆一区二区免费| 韩国成人福利片在线播放| 91麻豆精品久久久久蜜臀| 日韩影院在线观看| 日本高清不卡aⅴ免费网站| 亚洲国产成人私人影院tom| 国内精品久久久久影院色| 2014亚洲片线观看视频免费| 精品一区二区三区在线观看国产| 欧美精品一卡二卡| 毛片一区二区三区| 国产午夜亚洲精品不卡| 白白色亚洲国产精品| 亚洲精品久久久久久国产精华液| 欧洲激情一区二区| 精品在线你懂的| 国产精品精品国产色婷婷| 在线观看三级视频欧美| 日韩成人精品在线| 国产精品久久久久影院| 色成年激情久久综合| 老司机精品视频在线| 国产精品入口麻豆九色| 在线观看成人免费视频| 久久99精品一区二区三区三区| 国产欧美视频一区二区| 欧美曰成人黄网| 国产高清不卡一区二区| 亚洲国产aⅴ天堂久久| 久久久久亚洲蜜桃| 欧美亚洲综合在线| 国产v综合v亚洲欧| 麻豆国产欧美一区二区三区| 国产精品高潮久久久久无| 91麻豆精品国产自产在线观看一区 | 色婷婷久久久久swag精品| 老司机一区二区| 国产精品免费丝袜| 精品国产123| 日韩欧美中文一区二区| 欧美色图天堂网| 色综合久久中文字幕| 成人午夜视频免费看| 国产一区二区三区免费播放| 日韩国产精品久久久久久亚洲| 日韩一区欧美一区| 亚洲日本在线a| 国产欧美日韩另类一区| 久久精品欧美一区二区三区麻豆 | 日韩成人av影视| 日韩国产精品久久| 青青草91视频| 国产一区免费电影| 不卡电影免费在线播放一区| 国产.精品.日韩.另类.中文.在线.播放 | 精品一区二区三区在线播放| 久久精品二区亚洲w码| 久久国产精品99精品国产| 国产一区二区三区久久悠悠色av| 国产真实乱对白精彩久久| 国产综合色视频| 99在线视频精品| av在线综合网| 国产精品成人免费精品自在线观看 | 色婷婷av一区二区三区软件| 色悠悠亚洲一区二区| 欧美日韩精品一区视频| 日韩一区二区三区三四区视频在线观看| 在线播放亚洲一区| 久久精品视频免费| 日韩一级欧美一级| 91年精品国产| 69堂精品视频| 欧美激情一二三区| 亚洲免费观看高清完整| 日韩精品一级中文字幕精品视频免费观看| 捆绑调教一区二区三区| 色婷婷久久99综合精品jk白丝| 精品国产一二三区| 亚洲自拍偷拍综合| 高清av一区二区| 欧美成人精品高清在线播放| 亚洲一级二级三级在线免费观看| 国产毛片精品一区| 欧美xfplay| 男女男精品网站| 在线成人av网站| 日韩电影在线一区| 在线成人免费视频| 日韩黄色片在线观看| 欧美性猛片xxxx免费看久爱| 亚洲色欲色欲www| 99免费精品在线观看| 亚洲三级在线免费观看| 播五月开心婷婷综合| 自拍偷拍欧美精品| 91免费版pro下载短视频| 亚洲天天做日日做天天谢日日欢| 成人精品国产一区二区4080| 国产区在线观看成人精品| 国产v日产∨综合v精品视频| 日本一区免费视频| wwww国产精品欧美| 国产综合久久久久久鬼色| 欧美成人a视频| 国产盗摄一区二区| 一区二区三区91| 欧美日本在线一区| 老司机精品视频导航| 中文字幕一区二区三区在线不卡| 色哟哟一区二区| 久久国产剧场电影| 亚洲人成在线观看一区二区| 在线观看一区日韩| 蜜臀精品久久久久久蜜臀| 国产欧美日韩在线看| 欧美午夜精品一区二区三区| 麻豆freexxxx性91精品| 综合av第一页| 国产亚洲欧美日韩日本| 欧美丰满少妇xxxxx高潮对白| 国产制服丝袜一区| 蜜臀国产一区二区三区在线播放| 国产精品女主播av| 日韩欧美中文字幕一区| 欧美优质美女网站| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 欧美日韩亚州综合| 成人avav在线| 国产在线麻豆精品观看| 亚洲丶国产丶欧美一区二区三区| 久久精品免费在线观看| 5858s免费视频成人| 色妹子一区二区| 不卡av在线免费观看| 不卡在线观看av| 99久久国产综合精品麻豆| 韩国午夜理伦三级不卡影院| 午夜精品免费在线| 国产精品传媒视频| 亚洲男人天堂av| 亚洲男人天堂av网| 午夜欧美电影在线观看| 一区二区三区四区五区视频在线观看| 国产午夜三级一区二区三| 2023国产精品| 久久精品人人爽人人爽| 亚洲国产高清在线| 亚洲色图清纯唯美| 亚洲一区二区三区四区中文字幕 | 97久久超碰精品国产| 色婷婷亚洲综合| 欧美xfplay| 中文字幕免费观看一区| 亚洲免费伊人电影| 亚洲mv大片欧洲mv大片精品| 久久精品国产色蜜蜜麻豆| 国产91精品一区二区| 欧美性生活一区| 久久久蜜桃精品| 亚洲国产成人av网| 成人精品免费网站| 欧美日韩另类一区| 国产精品色婷婷| 免费日韩伦理电影| 欧美亚日韩国产aⅴ精品中极品| 精品国产精品一区二区夜夜嗨| 国产精品丝袜在线| 国产在线播放一区三区四| 色婷婷国产精品|