• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ doTest函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中doTest函数的典型用法代码示例。如果您正苦于以下问题:C++ doTest函数的具体用法?C++ doTest怎么用?C++ doTest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了doTest函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int
main( int argc, char *argv[] )
{

    bind_transmitter_resp_t a;
    bind_transmitter_resp_t b;
    tlv_t tlv;

    memset(&a, 0, sizeof(bind_transmitter_resp_t));
    memset(&b, 0, sizeof(bind_transmitter_resp_t));
    memset(&tlv, 0, sizeof(tlv_t));

    /* Init PDU ***********************************************************/
    b.command_length   = 0;
    b.command_id       = BIND_TRANSMITTER_RESP;
    b.command_status   = ESME_ROK;
    b.sequence_number  = 1;
    snprintf( b.system_id, sizeof(b.system_id), "%s", "system_id");

    tlv.tag = TLVID_sc_interface_version;
    tlv.length = sizeof(uint8_t);
    tlv.value.val16 = 0x34;
    build_tlv( &(b.tlv), &tlv );

    doTest(BIND_TRANSMITTER_RESP, &a, &b);
    destroy_tlv( b.tlv );
    destroy_tlv( a.tlv );
    return( 0 );
};
开发者ID:nel,项目名称:c-open-smpp,代码行数:29,代码来源:bind_transmitter_resp_test.c


示例2: main

int main(int argc, char** argv)
{
     int messSize, compIters, innerIters, testIters, reportRank;

     MPI_Init(&argc, &argv);

     if ( argc != 4 )
     {
          int rank;

          MPI_Comm_rank(MPI_COMM_WORLD, &rank);

          if ( rank == 0 )
               printf("\n  %s [# of comp iterations] [inner iterations] [total samples]\n\n", argv[0]);
          MPI_Finalize();
          exit(-1);
     }

     messSize    = 4;             /* number of doubles in Allreduce message */
     reportRank  = 0;             /* Rank printing output                   */
     compIters   = atoi(argv[1]); /* Number of computation iterations       */
     innerIters  = atoi(argv[2]); /* Number of inner loop iterations        */
     testIters   = atoi(argv[3]); /* Number of total sample iterations      */

     doTest(messSize, reportRank, compIters, innerIters, testIters);

     MPI_Finalize();

     exit(0);
}
开发者ID:uswick,项目名称:presta_HMPI,代码行数:30,代码来源:allred.c


示例3: main

int
main( int argc, char *argv[] )
{

    bind_transmitter_t a;
    bind_transmitter_t b;

    memset(&a, 0, sizeof(bind_transmitter_t));
    memset(&b, 0, sizeof(bind_transmitter_t));

    /* Init PDU ***********************************************************/
    b.command_length   = 0;
    b.command_id       = BIND_TRANSMITTER;
    b.command_status   = ESME_ROK;
    b.sequence_number  = 1;
    snprintf( b.system_id, sizeof(b.system_id), "%s", "system_id");
    snprintf( b.password, sizeof(b.password), "%s", "pass");
    snprintf( b.system_type, sizeof(b.system_type), "%s", "syst");
    b.interface_version = 0x34;
    b.addr_ton          = 2;
    b.addr_npi          = 1;
    snprintf( b.address_range, sizeof(b.address_range), "%s", "address_range");

    doTest(BIND_TRANSMITTER, &a, &b);
    return( 0 );
};
开发者ID:nel,项目名称:c-open-smpp,代码行数:26,代码来源:bind_transmitter_test.c


示例4: genericOrderingTestWithResult

void genericOrderingTestWithResult(UCollator *coll, const char * const s[], uint32_t size, UCollationResult result) {
  UChar t1[2048] = {0};
  UChar t2[2048] = {0};
  UCollationElements *iter;
  UErrorCode status = U_ZERO_ERROR;

  uint32_t i = 0, j = 0;
  log_verbose("testing sequence:\n");
  for(i = 0; i < size; i++) {
    log_verbose("%s\n", s[i]);
  }

  iter = ucol_openElements(coll, t1, u_strlen(t1), &status);
  if (U_FAILURE(status)) {
    log_err("Creation of iterator failed\n");
  }
  for(i = 0; i < size-1; i++) {
    for(j = i+1; j < size; j++) {
      u_unescape(s[i], t1, 2048);
      u_unescape(s[j], t2, 2048);
      doTest(coll, t1, t2, result);
      /* synwee : added collation element iterator test */
      ucol_setText(iter, t1, u_strlen(t1), &status);
      backAndForth(iter);
      ucol_setText(iter, t2, u_strlen(t2), &status);
      backAndForth(iter);
    }
  }
  ucol_closeElements(iter);
}
开发者ID:icu-project,项目名称:icu4c,代码行数:30,代码来源:callcoll.c


示例5: UnicodeString

void TransliteratorAPITest::TestTransliterate3(){
    UnicodeString rs="This is the replaceable String";
    UnicodeString Data[] = {
        "0",  "0",  "This is the replaceable String",
        "2",  "3",  UnicodeString("Th\\u0069s is the replaceable String", ""),
        "21", "23", UnicodeString("Th\\u0069s is the repl\\u0061\\u0063eable String", ""),
        "14", "17", UnicodeString("Th\\u0069s is t\\u0068\\u0065\\u0020repl\\u0061\\u0063eable String", ""),
    };
    int start, limit;
    UnicodeString message;
    UParseError parseError;
    UErrorCode status = U_ZERO_ERROR;
    Transliterator *t=Transliterator::createInstance("Any-Hex", UTRANS_FORWARD, parseError, status);
    if(U_FAILURE(status)) {
      errln("Error creating transliterator %s", u_errorName(status));
      delete t;
      return;
    }

    if(t == 0)
        errln("FAIL : construction");
    for(uint32_t i=0; i<UPRV_LENGTHOF(Data); i=i+3){
        start=getInt(Data[i+0]);
        limit=getInt(Data[i+1]);
        t->transliterate(rs, start, limit);
        message=t->getID() + ".transliterate(ReplaceableString, start, limit):("+start+","+limit+"):";
        doTest(message, rs, Data[i+2]); 
    }
    delete t;
}
开发者ID:icu-project,项目名称:icu4c,代码行数:30,代码来源:transapi.cpp


示例6: CC_SAFE_DELETE

void SpriteMainScene::doAutoTest()
{
    isStating = false;
    statCount = 0;
    totalStatTime = 0.0f;
    minFrameRate = -1.0f;
    maxFrameRate = -1.0f;

    // recreate a SubTest object
    this->removeChild(_subTest->getTheParentNode());
    CC_SAFE_DELETE(_subTest);
    _subTest = new (std::nothrow) SubTest;
    _subTest->initWithSubTest(_subtestNumber, this);
    
    // create sprites & update the label
    _quantityNodes = autoTestSpriteCounts[autoTestIndex];
    for( int i = 0; i < _quantityNodes; i++)
    {
        auto sprite = _subTest->createSpriteWithTag(i);
        doTest(sprite);
    }
    updateNodes();
    updateTitle();

    schedule(CC_SCHEDULE_SELECTOR(SpriteMainScene::beginStat), DELAY_TIME);
    schedule(CC_SCHEDULE_SELECTOR(SpriteMainScene::endStat), DELAY_TIME + STAT_TIME);
}
开发者ID:zengzhining,项目名称:cocos2d-x,代码行数:27,代码来源:PerformanceSpriteTest.cpp


示例7: TestExtra

static void TestExtra()
{
    int32_t i, j;
    int32_t len;
    UCollator *myCollation;
    UErrorCode status = U_ZERO_ERROR;
    static const char str[]="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
    UChar rules[sizeof(str)];
    len = strlen(str);
    u_uastrcpy(rules, str);

    myCollation=ucol_openRules(rules, len, UCOL_OFF, UCOL_DEFAULT_STRENGTH,NULL, &status);
    if(U_FAILURE(status)){
        log_err_status(status, "ERROR: in creation of rule based collator :%s\n", myErrorName(status));
        return;
    }
    ucol_setStrength(myCollation, UCOL_TERTIARY);
    for (i = 0; i < COUNT_TEST_CASES-1 ; i++)
    {
        for (j = i + 1; j < COUNT_TEST_CASES; j += 1)
        {
        
            doTest(myCollation, testCases[i], testCases[j], UCOL_LESS);
        }
    }
    ucol_close(myCollation);
    myCollation = 0;
}
开发者ID:Epictetus,项目名称:build-couchdb,代码行数:28,代码来源:callcoll.c


示例8: errln

void CollationFrenchTest::TestSecondary(/* char* par */)
{
    //test acute and grave ordering
    int32_t i = 0;
    int32_t j;
    Collator::EComparisonResult expected;
    UErrorCode status = U_ZERO_ERROR;
    //myCollation->setAttribute(UCOL_FRENCH_COLLATION, UCOL_ON, status);
    myCollation->setStrength(Collator::SECONDARY);
    if (U_FAILURE(status))
        errln("Error setting attribute in French collator");
    else
    {
        const int32_t testAcuteSize = UPRV_LENGTHOF(testAcute);
        for (i = 0; i < testAcuteSize; i++)
        {
            for (j = 0; j < testAcuteSize; j++)
            {
                if (i <  j)
                    expected = Collator::LESS;
                else if (i == j)
                    expected = Collator::EQUAL;
                else // (i >  j)
                    expected = Collator::GREATER;
                doTest(myCollation, testAcute[i], testAcute[j], expected );
            }
        }
    }
}
开发者ID:icu-project,项目名称:icu4c,代码行数:29,代码来源:frcoll.cpp


示例9: main

int main(int argc, const char **argv) { 
  SescConf = new SConfig(argc, argv);

  GProcessor gproc;
  //lsq = new LSQFull(&gproc,0);
  lsq = new LSQFull(0);I(0);

  timeval startTime;
  gettimeofday(&startTime,0);

  doTest();

  timeval endTime;
  gettimeofday(&endTime,0);
  double msecs = ( endTime.tv_sec - startTime.tv_sec ) * 1000
    + ( endTime.tv_usec - startTime.tv_usec ) / 1000;

  long double res = instTotal/1000;
  res /= msecs;
  MSG("------------------");
  MSG ( "LSQ MIPS = %g secs = %g insts = %lld", (double) res, msecs/1000,(long long) instTotal );
  MSG("------------------");

  return 0;
}
开发者ID:BananaSlug,项目名称:esesc,代码行数:25,代码来源:lsqtest.cpp


示例10: TestPrimary

static void TestPrimary( )
{
    int32_t len,i;
    UCollator *myCollation;
    UErrorCode status=U_ZERO_ERROR;
    static const char str[]="& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";   
    UChar rules[sizeof(str)];
    len = strlen(str);
    u_uastrcpy(rules, str);

    myCollation=ucol_openRules(rules, len, UCOL_OFF, UCOL_DEFAULT_STRENGTH,NULL, &status);
    if(U_FAILURE(status)){
        log_err_status(status, "ERROR: in creation of rule based collator :%s\n", myErrorName(status));
        return;
    }
    ucol_setStrength(myCollation, UCOL_PRIMARY);
    
    for (i = 17; i < 26 ; i++)
    {
        
        doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
    }
    ucol_close(myCollation);
    myCollation = 0;
}
开发者ID:Epictetus,项目名称:build-couchdb,代码行数:25,代码来源:callcoll.c


示例11: TestSecondary

static void TestSecondary()
{
    int32_t i,j, testAcuteSize;
    UCollationResult expected=UCOL_EQUAL;
    UErrorCode status = U_ZERO_ERROR;
    myCollation = ucol_open("fr_FR", &status);
    if(U_FAILURE(status)){
        log_err_status(status, "ERROR: in creation of rule based collator: %s\n", myErrorName(status));
        return;
    }
    ucol_setAttribute(myCollation, UCOL_STRENGTH, UCOL_SECONDARY, &status);
    if(U_FAILURE(status)){
        log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
        return;
    }
    log_verbose("Testing French Collation with Secondary strength\n");
    /*test acute and grave ordering (compare to french collation)*/
    testAcuteSize = sizeof(testAcute) / sizeof(testAcute[0]);
    for (i = 0; i < testAcuteSize; i++)
    {
        for (j = 0; j < testAcuteSize; j++)
        {
            if (i <  j) expected = UCOL_LESS;
            if (i == j) expected = UCOL_EQUAL;
            if (i >  j) expected = UCOL_GREATER;
            doTest(myCollation, testAcute[i], testAcute[j], expected );
        }
    }
    ucol_close(myCollation);
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:30,代码来源:cfrtst.c


示例12: main

int main()
{
    std::mt19937 randomEngine;
    std::vector<TreeNode> vecNodes;
    std::vector<TreeNode*> vecNodePtrs;
    std::vector<int> vecVisitNode;
    std::vector<int> vecVisitNodeCmp;
    std::vector<int> vecVisitSubtree;
    std::vector<int> vecVisitSubtreeCmp;

    for (int i = 0; i < 100000; ++i)
    {
        TreeNode *pRoot = generateRandomBinaryTree(randomEngine,
                                                   &vecNodes,
                                                   &vecNodePtrs);

        bool passed = doTest(pRoot,
                             &vecVisitNode,
                             &vecVisitNodeCmp,
                             &vecVisitSubtree,
                             &vecVisitSubtreeCmp);

        if (!passed)
        {
            std::printf("Test failed!\n");
            break;
        }
    }

    return 0;
}
开发者ID:fish47,项目名称:leetcode,代码行数:31,代码来源:226_invert-binary-tree.cpp


示例13: selfTest

static void selfTest(uint8_t *src[3], int stride[3], int w, int h){
    enum PixelFormat srcFormat, dstFormat;
    int srcW, srcH, dstW, dstH;
    int flags;

    for (srcFormat = 0; srcFormat < PIX_FMT_NB; srcFormat++) {
        for (dstFormat = 0; dstFormat < PIX_FMT_NB; dstFormat++) {
            printf("%s -> %s\n",
                   sws_format_name(srcFormat),
                   sws_format_name(dstFormat));
            fflush(stdout);

            srcW= w;
            srcH= h;
            for (dstW=w - w/3; dstW<= 4*w/3; dstW+= w/3){
                for (dstH=h - h/3; dstH<= 4*h/3; dstH+= h/3){
                    for (flags=1; flags<33; flags*=2) {
                        int res;

                        res = doTest(src, stride, w, h, srcFormat, dstFormat,
                                     srcW, srcH, dstW, dstH, flags);
                        if (res < 0) {
                            dstW = 4 * w / 3;
                            dstH = 4 * h / 3;
                            flags = 33;
                        }
                    }
                }
            }
        }
    }
}
开发者ID:BlackMael,项目名称:DirectEncode,代码行数:32,代码来源:swscale-example.c


示例14: main

int
main( int argc, char *argv[] )
{

    cancel_sm_t a;
    cancel_sm_t b;

    memset(&a, 0, sizeof(cancel_sm_t));
    memset(&b, 0, sizeof(cancel_sm_t));

    /* Init PDU ***********************************************************/
    b.command_length   = 0;
    b.command_id       = CANCEL_SM;
    b.command_status   = ESME_ROK;
    b.sequence_number  = 1;
    snprintf((char*)b.service_type, sizeof(b.service_type), "%s", "CMT");
    snprintf((char*)b.message_id, sizeof(b.message_id), "%s", "0302830192");
    b.source_addr_ton  = 2;
    b.source_addr_npi  = 1;
    snprintf((char*)b.source_addr, sizeof(b.source_addr), "%s", "0900001111");
    b.dest_addr_ton    = 2;
    b.dest_addr_npi    = 1;
    snprintf((char*)b.destination_addr, sizeof(b.source_addr), "%s", "0900001111");

    doTest(CANCEL_SM, &a, &b);
    return( 0 );
};
开发者ID:osmocom,项目名称:libsmpp34,代码行数:27,代码来源:cancel_sm_test.c


示例15: doTest

void CollationTurkishTest::TestTertiary(/* char* par */)
{
    int32_t i = 0;
    myCollation->setStrength(Collator::TERTIARY);
    for (i = 0; i < 8 ; i++) {
        doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
    }
}
开发者ID:winlibs,项目名称:icu4c,代码行数:8,代码来源:trcoll.cpp


示例16: doTest

void CollationDanishTest::TestPrimary(/* char* par */)
{
    int32_t i;
    myCollation->setStrength(Collator::PRIMARY);
    for (i = 5; i < 8; i++) {
        doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
    }
}
开发者ID:andrewleech,项目名称:firebird,代码行数:8,代码来源:dacoll.cpp


示例17: addChild

UserDefaultTest::UserDefaultTest()
{
	CCSize s = CCDirector::sharedDirector()->getWinSize();
	CCLabelTTF* label = CCLabelTTF::labelWithString("CCUserDefault test see log", "Arial", 28);
	addChild(label, 0);
	label->setPosition( ccp(s.width/2, s.height-50) );

	doTest();
}
开发者ID:amatuer,项目名称:cocos2d-game,代码行数:9,代码来源:UserDefaultTest.cpp


示例18: main

int
main( int argc, char *argv[] )
{

    deliver_sm_t a;
    deliver_sm_t b;
    tlv_t tlv;

    memset(&a, 0, sizeof(deliver_sm_t));
    memset(&b, 0, sizeof(deliver_sm_t));
    memset(&tlv, 0, sizeof(tlv_t));

    /* Init PDU ***********************************************************/
    b.command_length   = 0;
    b.command_id       = DELIVER_SM;
    b.command_status   = ESME_ROK;
    b.sequence_number  = 1;
    snprintf((char*)b.service_type, SERVICE_TYPE_LENGTH, "%s", "CMT");
    b.source_addr_ton  = 2;
    b.source_addr_npi  = 1;
    snprintf((char*)b.source_addr, ADDRESS_LENGTH, "%s", "0900001111");
    b.dest_addr_ton    = 2;
    b.dest_addr_npi    = 1;
    snprintf((char*)b.destination_addr, ADDRESS_LENGTH, "%s", "0900001111");
    b.esm_class        = 0;
    b.protocol_id      = 0;
    b.priority_flag    = 0;
    memset(b.schedule_delivery_time, 0, sizeof(b.schedule_delivery_time));
    memset(b.validity_period, 0, sizeof(b.validity_period));
    b.registered_delivery = 0;
    b.replace_if_present_flag =0;
    b.data_coding         = 0;
    b.sm_default_msg_id   = 0;
    b.sm_length           = strlen(TEXTO);
    memcpy(b.short_message, TEXTO, b.sm_length);

    tlv.tag = TLVID_user_message_reference;
    tlv.length = sizeof(uint16_t);
    tlv.value.val16 = 0x0024;
    build_tlv( &(b.tlv), &tlv );

    tlv.tag = TLVID_message_payload;
    tlv.length = strlen(TEXTO);
    memcpy(tlv.value.octet, TEXTO, tlv.length);
    build_tlv( &(b.tlv), &tlv );

    tlv.tag = 0x1501;

    tlv.length = strlen(TEXTO);
    memcpy(tlv.value.octet, TEXTO, tlv.length);
    build_tlv( &(b.tlv), &tlv );

    doTest(DELIVER_SM, &a, &b);
    destroy_tlv( b.tlv );
    destroy_tlv( a.tlv );
    return( 0 );
};
开发者ID:osmocom,项目名称:libsmpp34,代码行数:57,代码来源:deliver_sm_test.c


示例19: main

int main()
{
    doTest({ 3, 9, 20, 0, 0, 15, 7 },
           {
               { 15, 7 },
               { 9, 20 },
               { 3 },
           });

    doTest({ 1, 2, 3, 4, 5, 6, 7 },
           {
               { 4, 5, 6, 7 },
               { 2, 3 },
               { 1 },
           });

    return 0;
}
开发者ID:fish47,项目名称:leetcode,代码行数:18,代码来源:107_binary-tree-level-order-traversal-ii.cpp


示例20: addChild

UserDefaultTest::UserDefaultTest()
{
    auto s = Director::getInstance()->getWinSize();
    auto label = LabelTTF::create("CCUserDefault test see log", "Arial", 28);
    addChild(label, 0);
    label->setPosition( Point(s.width/2, s.height-50) );

    doTest();
}
开发者ID:mcodegeeks,项目名称:OpenKODE-Framework,代码行数:9,代码来源:UserDefaultTest.cpp



注:本文中的doTest函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ doUpdate函数代码示例发布时间:2022-05-30
下一篇:
C++ doSystem函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap