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

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

?? clienttest.cpp

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? CPP
?? 第 1 頁 / 共 5 頁
字號:

// test that a two-way sync deletes the copy of an item in the other database
void SyncTests::testDelete() {
    // setup client A, B and server so that they all contain the same item
    doCopy();

    // delete it on A
    source_it it;
    for (it = sources.begin(); it != sources.end(); ++it) {
        it->second->deleteAll(it->second->createSourceA);
    }

    // transfer change from A to server to B
    sync(SYNC_TWO_WAY, ".delete", CheckSyncReport(0,0,0, 0,0,1));
    accessClientB->sync(SYNC_TWO_WAY, ".delete", CheckSyncReport(0,0,1, 0,0,0));

    // check client B: shouldn't have any items now
    for (it = sources.begin(); it != sources.end(); ++it) {
        std::auto_ptr<SyncSource> copy;
        SOURCE_ASSERT_NO_FAILURE(copy.get(), copy.reset(it->second->createSourceA()));
        SOURCE_ASSERT_EQUAL(copy.get(), 0, copy->beginSync());
        SOURCE_ASSERT_EQUAL(copy.get(), 0, countItems(copy.get()));
        SOURCE_ASSERT_EQUAL(copy.get(), 0, copy->endSync());
        CPPUNIT_ASSERT_NO_THROW(copy.reset());
    }
}

// test what the server does when it finds that different
// fields of the same item have been modified
void SyncTests::testMerge() {
    // setup client A, B and server so that they all contain the same item
    doCopy();

    // update in client A
    source_it it;
    for (it = sources.begin(); it != sources.end(); ++it) {
        it->second->update(it->second->createSourceA, it->second->config.mergeItem1);
    }

    // update in client B
    for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) {
        it->second->update(it->second->createSourceA, it->second->config.mergeItem2);
    }

    // send change to server from client A (no conflict), then from B (conflict)
    sync(SYNC_TWO_WAY, ".send", CheckSyncReport(0,0,0, 0,1,0));
    sync(SYNC_TWO_WAY, ".recv");

    // figure out how the conflict during ".recv" was handled
    for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) {
        std::auto_ptr<SyncSource> copy;
        SOURCE_ASSERT_NO_FAILURE(copy.get(), copy.reset(it->second->createSourceA()));
        SOURCE_ASSERT_EQUAL(copy.get(), 0, copy->beginSync());
        int numItems;
        SOURCE_ASSERT_NO_FAILURE(copy.get(), numItems = countItems(copy.get()));
        SOURCE_ASSERT_EQUAL(copy.get(), 0, copy->endSync());
        CPPUNIT_ASSERT(numItems >= 1);
        CPPUNIT_ASSERT(numItems <= 2);
        std::cout << " " << it->second->config.sourceName << ": " << (numItems == 1 ? "conflicting items were merged" : "both of the conflicting items were preserved") << " ";
        std::cout.flush();
        CPPUNIT_ASSERT_NO_THROW(copy.reset());
    }
}

// test what the server does when it has to execute a slow sync
// with identical data on client and server:
// expected behaviour is that nothing changes
void SyncTests::testTwinning() {
    // clean server and client A
    deleteAll();

    // import test data
    source_it it;
    for (it = sources.begin(); it != sources.end(); ++it) {
        it->second->testImport();
    }

    // send to server
    sync(SYNC_TWO_WAY, ".send");

    // ensure that client has the same data, thus ignoring data conversion
    // issues (those are covered by testItems())
    refreshClient();

    // copy to client B to have another copy
    accessClientB->refreshClient();

    // slow sync should not change anything
    sync(SYNC_TWO_WAY, ".twinning");

    // check
    compareDatabases();
}

// tests one-way sync from server:
// - get both clients and server in sync with no items anywhere
// - add one item on first client, copy to server
// - add a different item on second client, one-way-from-server
// - two-way sync with first client
// => one item on first client, two on second
// - delete on first client, sync that to second client
//   via two-way sync + one-way-from-server
// => one item left on second client (the one inserted locally)
void SyncTests::testOneWayFromServer() {
    // no items anywhere
    deleteAll();
    accessClientB->refreshClient();

    // check that everything is empty, also resets change tracking
    // in second sources of each client
    source_it it;
    for (it = sources.begin(); it != sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }
    for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }

    // add one item on first client, copy to server, and check change tracking via second source
    for (it = sources.begin(); it != sources.end(); ++it) {
        it->second->insertManyItems(it->second->createSourceA, 1, 1);
    }
    sync(SYNC_TWO_WAY, ".send", CheckSyncReport(0,0,0, 1,0,0));
    for (it = sources.begin(); it != sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 1, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 1, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }

    // add a different item on second client, one-way-from-server
    // => one item added locally, none sent to server
    for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) {
        it->second->insertManyItems(it->second->createSourceA, 2, 1);

        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 1, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 1, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }
    accessClientB->sync(SYNC_ONE_WAY_FROM_SERVER, ".recv", CheckSyncReport(1,0,0, 0,0,0));
    for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 2, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 1, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }

    // two-way sync with first client for verification
    // => no changes
    sync(SYNC_TWO_WAY, ".check", CheckSyncReport(0,0,0, 0,0,0));
    for (it = sources.begin(); it != sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 1, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }

    // delete items on clientA, sync to server
    for (it = sources.begin(); it != sources.end(); ++it) {
        it->second->deleteAll(it->second->createSourceA);

        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 1, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }
    sync(SYNC_TWO_WAY, ".delete", CheckSyncReport(0,0,0, 0,0,1));
    for (it = sources.begin(); it != sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }

    // sync the same change to second client
    // => one item left (the one inserted locally)
    accessClientB->sync(SYNC_ONE_WAY_FROM_SERVER, ".delete", CheckSyncReport(0,0,1, 0,0,0));
    for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 1, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 1, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }
}

// tests one-way sync from client:
// - get both clients and server in sync with no items anywhere
// - add one item on first client, copy to server
// - add a different item on second client, one-way-from-client
// - two-way sync with first client
// => two items on first client, one on second
// - delete on second client, sync that to first client
//   via one-way-from-client, two-way
// => one item left on first client (the one inserted locally)
void SyncTests::testOneWayFromClient() {
    // no items anywhere
    deleteAll();
    accessClientB->deleteAll();

    // check that everything is empty, also resets change tracking
    // in second sources of each client
    source_it it;
    for (it = sources.begin(); it != sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }
    for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }

    // add one item on first client, copy to server, and check change tracking via second source
    for (it = sources.begin(); it != sources.end(); ++it) {
        it->second->insertManyItems(it->second->createSourceA, 1, 1);
    }
    sync(SYNC_TWO_WAY, ".send", CheckSyncReport(0,0,0, 1,0,0));
    for (it = sources.begin(); it != sources.end(); ++it) {
        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 1, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 1, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }

    // add a different item on second client, one-way-from-client
    // => no item added locally, one sent to server
    for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) {
        it->second->insertManyItems(it->second->createSourceA, 2, 1);

        if (it->second->config.createSourceB) {
            std::auto_ptr<SyncSource> source;
            SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
            SOURCE_ASSERT_EQUAL(source.get(), 1, countItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 1, countNewItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, countUpdatedItems(source.get()));
            SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
            CPPUNIT_ASSERT_NO_THROW(source.reset());
        }
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费成人美女在线观看.| 一本大道久久精品懂色aⅴ| 国产成人精品www牛牛影视| 99精品视频中文字幕| 欧美一区二区三区成人| 国产精品久久久久一区二区三区共| 亚洲久草在线视频| 国内精品嫩模私拍在线| 色视频成人在线观看免| 久久久99久久精品欧美| 日韩有码一区二区三区| 不卡一区二区在线| 欧美精品一区二区蜜臀亚洲| 夜夜精品视频一区二区| 国产不卡视频在线播放| 亚洲高清一区二区三区| 91在线丨porny丨国产| 久久综合九色综合97婷婷| 亚洲福利一区二区三区| aaa亚洲精品一二三区| 精品国产露脸精彩对白| 一区二区欧美在线观看| 成人av网在线| 久久一区二区视频| 奇米精品一区二区三区在线观看 | 色老综合老女人久久久| 久久嫩草精品久久久久| 污片在线观看一区二区| 欧美在线免费视屏| 成人欧美一区二区三区黑人麻豆| 国产一区二区三区电影在线观看| 91精品国产乱码| 日韩精品福利网| 欧美久久久久久久久久| 亚洲午夜精品久久久久久久久| 91小宝寻花一区二区三区| 国产精品国产三级国产三级人妇 | 5月丁香婷婷综合| 亚洲国产精品久久人人爱| 色综合天天综合| 亚洲色图制服丝袜| 91网站在线播放| 亚洲精品五月天| 在线观看日韩一区| 亚洲一级二级在线| 欧美日韩综合一区| 午夜私人影院久久久久| 欧美日韩日日夜夜| 日韩电影一区二区三区四区| 7777精品伊人久久久大香线蕉超级流畅| 亚洲一区二区精品久久av| 欧美日韩一区二区欧美激情| 午夜影院在线观看欧美| 7777精品伊人久久久大香线蕉超级流畅 | 99视频超级精品| 亚洲视频免费在线| 欧美在线免费视屏| 蜜桃一区二区三区在线观看| 精品国产一区二区三区久久久蜜月 | 99精品欧美一区二区三区小说 | 精品一区中文字幕| 久久久99精品久久| 99久久精品费精品国产一区二区| 日韩理论在线观看| 欧美日韩精品是欧美日韩精品| 日韩不卡手机在线v区| 精品播放一区二区| 99re成人在线| 天堂在线一区二区| 久久久91精品国产一区二区三区| av男人天堂一区| 亚洲国产精品久久久久秋霞影院| 日韩午夜在线播放| 国产成人三级在线观看| 亚洲猫色日本管| 欧美一级日韩一级| 国产成人自拍网| 亚洲国产成人91porn| 欧美zozozo| 99re亚洲国产精品| 奇米精品一区二区三区四区| 久久精品免视看| 欧美视频在线不卡| 国产v综合v亚洲欧| 亚洲在线视频免费观看| 看国产成人h片视频| 国产精品视频第一区| 欧美日韩亚洲综合在线 | 天天综合日日夜夜精品| wwwwxxxxx欧美| 欧美亚一区二区| 国产剧情一区在线| 亚洲五码中文字幕| 国产日韩欧美激情| 欧美一区二区三区日韩| 99re视频这里只有精品| 经典三级视频一区| 亚洲国产精品久久一线不卡| 中文久久乱码一区二区| 欧美精品黑人性xxxx| 成人三级在线视频| 丝袜亚洲另类欧美| 国产精品嫩草99a| 在线免费观看日本欧美| 国产精品一区二区果冻传媒| 午夜精品在线看| 成人欧美一区二区三区黑人麻豆| 精品蜜桃在线看| 91高清视频在线| 国产欧美一区二区精品婷婷| 欧美日本视频在线| 一本大道综合伊人精品热热| 国产乱码精品一品二品| 日韩成人av影视| 一区二区三区美女视频| 国产精品伦一区| 久久美女艺术照精彩视频福利播放| 欧美日韩亚洲综合一区| 欧美中文一区二区三区| av亚洲精华国产精华| 国产综合久久久久久鬼色 | 国产成人在线视频播放| 蜜桃传媒麻豆第一区在线观看| 亚洲一区二区不卡免费| 一区二区三区电影在线播| 中文字幕久久午夜不卡| 久久综合色之久久综合| 欧美一区二区三区四区久久| 欧美肥胖老妇做爰| 91精品国产色综合久久不卡电影| 欧美三级视频在线| 欧美美女bb生活片| 8v天堂国产在线一区二区| 91精品国产91热久久久做人人| 欧美男男青年gay1069videost | 91精品福利在线一区二区三区| 欧美日韩午夜影院| 欧美日韩视频在线第一区| 欧美日韩国产一区二区三区地区| 欧美日韩在线播放一区| 欧美色综合久久| 7777精品伊人久久久大香线蕉超级流畅 | 亚洲欧洲成人av每日更新| 中文字幕+乱码+中文字幕一区| 国产精品蜜臀在线观看| 日韩一区日韩二区| 亚洲国产日日夜夜| 日日夜夜精品视频免费| 美女任你摸久久| 国产成人综合网站| 91成人免费网站| 欧美剧情片在线观看| 欧美大片一区二区三区| 久久久久国产精品人| 国产精品丝袜在线| 亚洲一区免费视频| 青娱乐精品视频| 国产成人免费网站| 在线精品视频免费播放| 91精品国产综合久久久久久 | 亚洲自拍欧美精品| 天天操天天综合网| 久久精品国产一区二区| 国产视频视频一区| 亚洲欧洲精品天堂一级| 天天亚洲美女在线视频| 国产成人午夜电影网| 在线亚洲一区二区| 精品国产免费人成在线观看| 中文字幕av一区 二区| 亚洲一区二区精品3399| 国产精品一区二区在线看| 色婷婷久久久久swag精品 | 91传媒视频在线播放| 日韩女优电影在线观看| 亚洲欧美日本韩国| 韩国精品主播一区二区在线观看| 色综合天天综合网国产成人综合天| 欧美一区二区视频免费观看| 中文字幕精品一区二区三区精品| 亚洲一区二区三区美女| 国产一区 二区 三区一级| 欧美三区在线观看| 久久久久久久久久美女| 午夜精品成人在线| 91亚洲午夜精品久久久久久| 欧美va日韩va| 欧美影视一区在线| 欧美国产乱子伦| 麻豆极品一区二区三区| 91浏览器在线视频| 国产三级精品三级在线专区| 午夜激情综合网| 91在线视频网址| 国产精品丝袜91| 国产精品1区2区| 欧美成人精品高清在线播放| 亚洲国产毛片aaaaa无费看| 成人动漫在线一区| 精品国产伦一区二区三区观看方式|