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

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

?? clienttest.cpp

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
        SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
        CPPUNIT_ASSERT_NO_THROW(source.reset());
    }

    copyFile = getCurrentTest() + ".copy.test.dat";
    simplifyFilename(copyFile);
    SOURCE_ASSERT_EQUAL(&copy, 0, copy.beginSync());
    SOURCE_ASSERT_EQUAL(&copy, 0, config.dump(client, copy, copyFile.c_str()));
    SOURCE_ASSERT_EQUAL(&copy, 0, copy.endSync());

    CPPUNIT_ASSERT(config.compare(client, sourceFile.c_str(), copyFile.c_str()));
}

/**
 * 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
 */
int LocalTests::insertManyItems(CreateSource createSource, int startIndex, int numItems, int size) {
    CPPUNIT_ASSERT(config.templateItem);
    CPPUNIT_ASSERT(config.uniqueProperties);

    std::auto_ptr<SyncSource> source;
    SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(createSourceA()));
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
    CPPUNIT_ASSERT(startIndex > 1 || !countItems(source.get()));

    int firstIndex = startIndex;
    if (firstIndex < 0) {
        firstIndex = 1;
    }
    int lastIndex = firstIndex + (numItems >= 1 ? numItems : config.numItems) - 1;
    for (int item = firstIndex; item <= lastIndex; item++) {
        std::string data = config.templateItem;
        std::stringstream prefix;

        prefix << std::setfill('0') << std::setw(3) << item << " ";


        const char *prop = config.uniqueProperties;
        const char *nextProp;
        while (*prop) {
            std::string curProp;
            nextProp = strchr(prop, ':');
            if (!nextProp) {
                curProp = prop;
            } else {
                curProp = std::string(prop, 0, nextProp - prop);
            }

            std::string property;
            // property is expected to not start directly at the
            // beginning
            property = "\n";
            property += curProp;
            property += ":";
            size_t off = data.find(property);
            if (off != data.npos) {
                data.insert(off + property.size(), prefix.str());
            }

            if (!nextProp) {
                break;
            }
            prop = nextProp + 1;
        }
        if (size > 0 && (int)data.size() < size) {
            int additionalBytes = size - (int)data.size();
            int added = 0;
            /* vCard 2.1 and vCal 1.0 need quoted-printable line breaks */
            bool quoted = data.find("VERSION:1.0") != data.npos ||
                data.find("VERSION:2.1") != data.npos;
            size_t toreplace = 1;

            CPPUNIT_ASSERT(config.sizeProperty);

            /* stuff the item so that it reaches at least that size */
            size_t off = data.find(config.sizeProperty);
            CPPUNIT_ASSERT(off != data.npos);
            std::stringstream stuffing;
            if (quoted) {
                stuffing << ";ENCODING=QUOTED-PRINTABLE:";
            } else {
                stuffing << ":";
            }

            // insert after the first line, it often acts as the summary
            if (data.find("BEGIN:VJOURNAL") != data.npos) {
                size_t start = data.find(":", off);
                CPPUNIT_ASSERT( start != data.npos );
                size_t eol = data.find("\\n", off);
                CPPUNIT_ASSERT( eol != data.npos );
                stuffing << data.substr(start + 1, eol - start + 1);
                toreplace += eol - start + 1;
            }

            while(added < additionalBytes) {
                int linelen = 0;

                while(added + 4 < additionalBytes &&
                      linelen < 60) {
                    stuffing << 'x';
                    added++;
                    linelen++;
                }
                // insert line breaks to allow folding
                if (quoted) {
                    stuffing << "x=0D=0Ax";
                    added += 8;
                } else {
                    stuffing << "x\\nx";
                    added += 4;
                }
            }
            off = data.find(":", off);
            data.replace(off, toreplace, stuffing.str());
        }

        importItem(source.get(), data);
        data = "";
    }

    SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
    CPPUNIT_ASSERT_NO_THROW(source.reset());
    return lastIndex - firstIndex + 1;
}

// creating sync source
void LocalTests::testOpen() {
    // check requirements
    CPPUNIT_ASSERT(config.createSourceA);

    std::auto_ptr<SyncSource> source(createSourceA());
    CPPUNIT_ASSERT(source.get() != 0);
    CPPUNIT_ASSERT_NO_THROW(source.reset());
}

// restart scanning of items
void LocalTests::testIterateTwice() {
    // check requirements
    CPPUNIT_ASSERT(config.createSourceA);

    // open source
    std::auto_ptr<SyncSource> source(createSourceA());
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
    SOURCE_ASSERT_MESSAGE(
        "iterating twice should produce identical results",
        source.get(),
        countItems(source.get()) == countItems(source.get()));
}

// insert one contact without clearing the source first
void LocalTests::testSimpleInsert() {
    // check requirements
    CPPUNIT_ASSERT(config.insertItem);
    CPPUNIT_ASSERT(config.createSourceA);

    insert(createSourceA, config.insertItem);
}

// delete all items
void LocalTests::testLocalDeleteAll() {
    // check requirements
    CPPUNIT_ASSERT(config.insertItem);
    CPPUNIT_ASSERT(config.createSourceA);

    // make sure there is something to delete, then delete again
    insert(createSourceA, config.insertItem);
    deleteAll(createSourceA);
}

// clean database, then insert
void LocalTests::testComplexInsert() {
    testLocalDeleteAll();
    testSimpleInsert();
    testIterateTwice();
}

// clean database, insert item, update it
void LocalTests::testLocalUpdate() {
    // check additional requirements
    CPPUNIT_ASSERT(config.updateItem);

    testLocalDeleteAll();
    testSimpleInsert();
    update(createSourceA, config.updateItem);
}

// complex sequence of changes
void LocalTests::testChanges() {
    // check additional requirements
    CPPUNIT_ASSERT(config.createSourceB);

    testLocalDeleteAll();
    testSimpleInsert();

    // clean changes in sync source B by creating and closing it
    std::auto_ptr<SyncSource> source;
    SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(createSourceB()));
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
    CPPUNIT_ASSERT_NO_THROW(source.reset());

    // no new changes now
    SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(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, countUpdatedItems(source.get()));
    SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
    std::auto_ptr<SyncItem> item;
    SOURCE_ASSERT_NO_FAILURE(source.get(), item.reset(source->getFirstItem()));
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
    CPPUNIT_ASSERT_NO_THROW(source.reset());

    // delete item again via sync source A
    deleteAll(createSourceA);
    SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(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, countUpdatedItems(source.get()));
    SOURCE_ASSERT_EQUAL(source.get(), 1, countDeletedItems(source.get()));
    std::auto_ptr<SyncItem> deletedItem;
    SOURCE_ASSERT_NO_FAILURE(source.get(), deletedItem.reset(source->getFirstDeletedItem()));
    CPPUNIT_ASSERT( wcslen( item->getKey() ) );
    CPPUNIT_ASSERT( wcslen( deletedItem->getKey() ) );
    CPPUNIT_ASSERT( !wcscmp( item->getKey(), deletedItem->getKey() ) );
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
    CPPUNIT_ASSERT_NO_THROW(source.reset());

    // insert another item via sync source A
    testSimpleInsert();
    SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(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, countUpdatedItems(source.get()));
    SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
    SOURCE_ASSERT_NO_FAILURE(source.get(), item.reset(source->getFirstItem()));
    std::auto_ptr<SyncItem> newItem;
    SOURCE_ASSERT_NO_FAILURE(source.get(), newItem.reset(source->getFirstNewItem()));
    CPPUNIT_ASSERT( wcslen( item->getKey() ) );
    CPPUNIT_ASSERT( wcslen( newItem->getKey() ) );
    CPPUNIT_ASSERT( !wcscmp( item->getKey(), newItem->getKey() ) );
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
    CPPUNIT_ASSERT_NO_THROW(source.reset());

    // update item via sync source A
    update(createSourceA, config.updateItem);
    SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(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, countUpdatedItems(source.get()));
    SOURCE_ASSERT_EQUAL(source.get(), 0, countDeletedItems(source.get()));
    std::auto_ptr<SyncItem> updatedItem;
    SOURCE_ASSERT_NO_FAILURE(source.get(), updatedItem.reset(source->getFirstUpdatedItem()));
    CPPUNIT_ASSERT( wcslen( item->getKey() ) );
    CPPUNIT_ASSERT( wcslen( updatedItem->getKey() ) );
    CPPUNIT_ASSERT( !wcscmp( item->getKey(), updatedItem->getKey() ) );
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
    CPPUNIT_ASSERT_NO_THROW(source.reset());
}

// clean database, import file, then export again and compare
void LocalTests::testImport() {
    // check additional requirements
    CPPUNIT_ASSERT(config.import);
    CPPUNIT_ASSERT(config.dump);
    CPPUNIT_ASSERT(config.compare);
    CPPUNIT_ASSERT(config.testcases);

    testLocalDeleteAll();

    // import via sync source A
    std::auto_ptr<SyncSource> source;
    SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(createSourceA()));
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->beginSync());
    SOURCE_ASSERT_EQUAL(source.get(), 0, config.import(client, *source.get(), config.testcases));
    SOURCE_ASSERT_EQUAL(source.get(), 0, source->endSync());
    CPPUNIT_ASSERT_NO_THROW(source.reset());

    // export again and compare against original file
    std::auto_ptr<SyncSource> copy;
    SOURCE_ASSERT_NO_FAILURE(copy.get(), copy.reset(createSourceA()));
    compareDatabases(config.testcases, *copy.get());
    CPPUNIT_ASSERT_NO_THROW(source.reset());
}

// same as testImport() with immediate delete
void LocalTests::testImportDelete() {
    testImport();

    // delete again, because it was observed that this did not
    // work right with calendars in SyncEvolution
    testLocalDeleteAll();
}

// test change tracking with large number of items
void LocalTests::testManyChanges() {
    // check additional requirements
    CPPUNIT_ASSERT(config.templateItem);
    CPPUNIT_ASSERT(config.uniqueProperties);

    deleteAll(createSourceA);

    // check that everything is empty, also resets change counter of sync source B
    std::auto_ptr<SyncSource> copy;
    SOURCE_ASSERT_NO_FAILURE(copy.get(), copy.reset(createSourceB()));
    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());

    // now insert plenty of items
    int numItems = insertManyItems(createSourceA);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品视频免费| 欧美日韩亚州综合| 日日摸夜夜添夜夜添精品视频| 6080亚洲精品一区二区| 国产不卡视频在线播放| 一区二区三区欧美亚洲| 国产喂奶挤奶一区二区三区| 日韩欧美一区在线观看| 色哟哟国产精品| 国产在线精品国自产拍免费| 天堂av在线一区| 亚洲444eee在线观看| 亚洲日本在线看| 亚洲国产一区二区视频| 国产精品久久久久三级| 久久精品夜夜夜夜久久| 欧美第一区第二区| 日韩一卡二卡三卡| 欧美一区二区三区系列电影| 欧美色区777第一页| 在线电影院国产精品| 欧美午夜精品一区| 欧美在线观看你懂的| 91蜜桃免费观看视频| 色综合久久久久综合体桃花网| 欧美日本高清视频在线观看| 欧美色图在线观看| 欧美性受xxxx| 在线精品视频免费观看| 91精品国产一区二区| 这里只有精品视频在线观看| 国产女人18毛片水真多成人如厕| 日韩欧美国产一区二区在线播放| 国产亚洲精品福利| 亚洲人亚洲人成电影网站色| 亚洲国产成人av好男人在线观看| 亚洲免费视频中文字幕| 午夜不卡av在线| 99在线精品视频| 91精品午夜视频| 一区二区三区在线播放| 午夜电影久久久| 99久久久久免费精品国产 | 午夜久久福利影院| 懂色av中文一区二区三区| 欧美视频一区二区| 日本一区二区三区电影| 偷窥少妇高潮呻吟av久久免费| 国产福利91精品一区二区三区| 在线观看视频欧美| 2023国产精品| 精一区二区三区| 欧美日韩国产电影| 成人欧美一区二区三区黑人麻豆 | 91精品国产黑色紧身裤美女| 欧美精品一区二区久久久| 亚洲少妇中出一区| 99久久99久久精品免费观看| 精品国产91久久久久久久妲己| 亚洲一级在线观看| 国产成人精品免费在线| 欧美变态口味重另类| 偷拍一区二区三区| 91.com在线观看| 国产精品麻豆网站| 国产精品一区专区| 中文字幕一区av| 91视频精品在这里| 国产精品久久久久久久久晋中| 国产一区二区在线观看视频| 久久这里只有精品6| 久久精品国产免费| 久久精品一二三| 99精品国产一区二区三区不卡| 久久久精品日韩欧美| 国产一区二区精品久久99| 久久日韩精品一区二区五区| 国产一区二区美女诱惑| 精品日韩在线观看| 国产馆精品极品| 国产精品久久久久久久午夜片| 国产激情偷乱视频一区二区三区| 久久久久久久网| 日本乱码高清不卡字幕| 亚洲精品乱码久久久久久黑人| 欧美高清一级片在线| 久久91精品久久久久久秒播| 久久久影院官网| 色伊人久久综合中文字幕| 免费av网站大全久久| 欧美sm极限捆绑bd| 在线精品国精品国产尤物884a| 婷婷开心激情综合| 国产欧美视频一区二区| 日韩欧美亚洲国产另类| 色久综合一二码| 国产一区二区女| 午夜电影网一区| 一区二区三区自拍| 久久九九影视网| 欧美午夜在线一二页| 成人午夜又粗又硬又大| 免费在线看成人av| 国产清纯美女被跳蛋高潮一区二区久久w| 欧美人与性动xxxx| 色爱区综合激月婷婷| 美国欧美日韩国产在线播放| 一级特黄大欧美久久久| 亚洲欧洲www| 日韩一级视频免费观看在线| 91麻豆精品视频| 成人av电影在线网| 国产真实乱偷精品视频免| 狠狠色狠狠色综合| 国产在线视频一区二区| 毛片av中文字幕一区二区| 日韩在线一二三区| 午夜精品久久久久久久蜜桃app| 欧美激情一区二区三区蜜桃视频| 精品国免费一区二区三区| 91精品国产欧美一区二区成人| 欧美军同video69gay| 99在线精品免费| 色999日韩国产欧美一区二区| 99久久精品国产毛片| 欧美这里有精品| 在线播放欧美女士性生活| 欧美日韩在线亚洲一区蜜芽| 欧美性极品少妇| 欧美日韩不卡视频| 欧美精品一区二区三区在线播放| 国产视频一区在线播放| 欧美激情艳妇裸体舞| 日韩精品一区二区三区视频| 国产视频一区二区三区在线观看| 国产精品免费av| 婷婷国产v国产偷v亚洲高清| 国产在线精品一区二区夜色| 韩国欧美国产1区| 欧美性感一类影片在线播放| 在线视频一区二区免费| 欧美一区二视频| 亚洲天堂成人网| 久久99久久99精品免视看婷婷 | 亚洲国产精品久久人人爱蜜臀| 日韩高清国产一区在线| 成人综合婷婷国产精品久久免费| 99r精品视频| 欧美电影一区二区三区| 国产欧美日韩在线视频| ㊣最新国产の精品bt伙计久久| 蜜桃精品在线观看| 欧美亚洲另类激情小说| 日本一区二区三区四区| 亚洲综合久久久| 99精品黄色片免费大全| 中文字幕在线视频一区| 国产剧情在线观看一区二区| 欧美日韩国产综合一区二区| 一区二区三区中文字幕| 国产精品一二三区| 日韩欧美aaaaaa| 亚洲综合无码一区二区| 欧美精品99久久久**| 中文字幕一区二区不卡| 成人免费视频一区| 亚洲欧美中日韩| 不卡一区在线观看| 2020日本不卡一区二区视频| 亚洲成人一区在线| 欧美精品aⅴ在线视频| 一区二区免费看| 色成年激情久久综合| 国产嫩草影院久久久久| eeuss鲁片一区二区三区| 国产亚洲欧美激情| 国产传媒久久文化传媒| 久久综合色之久久综合| 成人小视频免费在线观看| 亚洲欧美自拍偷拍| 91成人网在线| 亚洲自拍偷拍综合| 欧美绝品在线观看成人午夜影视| 亚洲线精品一区二区三区| 欧美无砖砖区免费| 亚洲成人资源在线| 日韩欧美国产三级电影视频| 美国毛片一区二区| 中文字幕免费一区| 99精品热视频| 丝袜诱惑亚洲看片| 久久久精品一品道一区| 欧美日韩精品一区二区三区蜜桃 | 亚洲女同一区二区| 91精品国产高清一区二区三区| 精品一区二区三区在线观看| 亚洲女同女同女同女同女同69| 欧美日韩一区二区三区在线看| 日产精品久久久久久久性色| 国产欧美一区二区精品性色超碰|