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

C++ CU_basic_set_mode函数代码示例

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

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



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

示例1: main

int main(int argc, char **argv)
{
    /* Initialize the CUnit test registry */
    if ( CUE_SUCCESS != CU_initialize_registry())
        return CU_get_error();

    /* add a suite to the registry */
    CU_pSuite bstSuite = CU_add_suite("BST Suite", init_bst_suite, clean_bst_suite);
    CU_pSuite llSuite = CU_add_suite("LinkedList Suite", init_ll_suite, clean_ll_suite);
    CU_pSuite htSuite = CU_add_suite("HashTable Suite", init_ht_suite, clean_ht_suite);

    if ( NULL == bstSuite || NULL == llSuite || NULL == htSuite ) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /*add the test cases to the suites */
    if ((NULL == CU_add_test(bstSuite, "test_bst", test_bst)) || 
        (NULL == CU_add_test(llSuite, "test_ll", test_ll)) ||
        (NULL == CU_add_test(htSuite, "test_ht", test_ht)) ) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
    CU_cleanup_registry();
    return CU_get_error();
}
开发者ID:pose,项目名称:c-data-structures,代码行数:29,代码来源:main.c


示例2: main

/* 
 * The main() function for setting up and running the tests.
 * Returns a CUE_SUCCESS on successful running, another
 * CUnit error code on failure.
 *
 */
int main()
{
   CU_pSuite pSuite = NULL;

   /* initialize the CUnit test registry */
   if (CUE_SUCCESS != CU_initialize_registry())
      return CU_get_error();

   /* add a suite to the registry */
   pSuite = CU_add_suite("Suite_1", init_suite1, clean_suite1);
   if (NULL == pSuite) {
      CU_cleanup_registry();
      return CU_get_error();
   }

   /* add the tests to the suite */
   /* add extra tests using || */
   
   //if (NULL == CU_add_test(pSuite, "test_next_id", test_next_id) ||
   	if(NULL == CU_add_test(pSuite, "test_start_new_cycle_postion", test_start_new_cycle_postion) ||
   	   NULL == CU_add_test(pSuite, "test_g0", test_g0) ||
   	   NULL == CU_add_test(pSuite, "test_nong0", test_nong0) ||
	   NULL == CU_add_test(pSuite, "test_differentiate_stem_z", test_differentiate_stem_z) ||
   	   NULL == CU_add_test(pSuite, "test_migrate", test_migrate))
   {
      CU_cleanup_registry();
      return CU_get_error();
   }
   
   /* Run all tests using the CUnit Basic interface */
   CU_basic_set_mode(CU_BRM_VERBOSE);
   CU_basic_run_tests();
   CU_cleanup_registry();
   return CU_get_error();
}
开发者ID:somebloke,项目名称:flame-models,代码行数:41,代码来源:unittest.c


示例3: main

int main() {
    CU_pSuite pSuite = NULL;

    /* Initialize the CUnit test registry */
    if (CUE_SUCCESS != CU_initialize_registry())
        return CU_get_error();

    /* Add a suite to the registry */
    pSuite = CU_add_suite("Parser", init_suite, clean_suite);
    if (NULL == pSuite) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Add the tests to the suite */
    if ((NULL == CU_add_test(pSuite, "SCPI_ParamInt", testSCPI_ParamInt))
            || (NULL == CU_add_test(pSuite, "SCPI_ParamDouble", testSCPI_ParamDouble))
            || (NULL == CU_add_test(pSuite, "SCPI_ParamCharacters", testSCPI_ParamCharacters))
	    || (NULL == CU_add_test(pSuite, "Commands handling", testCommandsHandling))
	    || (NULL == CU_add_test(pSuite, "Error handling", testErrorHandling))
	    || (NULL == CU_add_test(pSuite, "IEEE 488.2 Mandatory commands", testIEEE4882))
            ) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Run all tests using the CUnit Basic interface */
    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
    CU_cleanup_registry();
    return CU_get_error();
}
开发者ID:zuban,项目名称:scpi-parser,代码行数:32,代码来源:test_parser.c


示例4: main

/************* Test Runner Code goes here **************/ 
int main ( void ) 
{ 
  CU_pSuite pSuite = NULL; 
 
  /* initialize the CUnit test registry */ 
  if ( CUE_SUCCESS != CU_initialize_registry() ) 
    return CU_get_error(); 

  /* add a suite to the registry */ 
  pSuite = CU_add_suite( "authentication_test_suite", init_suite, clean_suite ); 
  if ( NULL == pSuite ) { 
    CU_cleanup_registry(); 
    return CU_get_error(); 
  } 

  /* add the tests to the suite */ 
  if ( (NULL == CU_add_test(pSuite, "auth_correct_commands_test", authentication_correct_commands_test)) || 
       (NULL == CU_add_test(pSuite, "auth_wrong_commands_test", authentication_wrong_commands_test)) 
       ) 
    { 
      CU_cleanup_registry(); 
      return CU_get_error(); 
    } 

  // Run all tests using the basic interface 
  CU_basic_set_mode(CU_BRM_VERBOSE); 
  CU_basic_run_tests(); 
  printf("\n"); 
  CU_basic_show_failures(CU_get_failure_list()); 
  printf("\n\n"); 
    
  /* Clean up registry and return */ 
  CU_cleanup_registry(); 
  return CU_get_error(); 
} 
开发者ID:Savinos90,项目名称:pop3corn,代码行数:36,代码来源:pop3tests_auth.c


示例5: main

int main(
        const int argc,
        const char* const * argv)
{
    int exitCode = 1;

    if (log_init(argv[0])) {
        log_syserr("Couldn't initialize logging module");
        exitCode = EXIT_FAILURE;
    }
    else {
        if (CUE_SUCCESS == CU_initialize_registry()) {
            CU_Suite* testSuite = CU_add_suite(__FILE__, setup, teardown);

            if (NULL != testSuite) {
                if (CU_ADD_TEST(testSuite, test_socketpair)) {
                    CU_basic_set_mode(CU_BRM_VERBOSE);
                    (void) CU_basic_run_tests();
                }
            }

            exitCode = CU_get_number_of_tests_failed();
            CU_cleanup_registry();
        }

        log_fini();
    }

    return exitCode;
}
开发者ID:Unidata,项目名称:LDM,代码行数:30,代码来源:socketpair_test.c


示例6: main

int main() {
    setlocale(LC_ALL, "en_US.UTF-8");
    CU_pSuite pSuite = NULL;

    /* Initialize the CUnit test registry */
    if (CUE_SUCCESS != CU_initialize_registry())
        return CU_get_error();

    /* Add a suite to the registry */
    pSuite = CU_add_suite("t1", init_suite, clean_suite);
    if (NULL == pSuite) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Add the tests to the suite */
    if ((NULL == CU_add_test(pSuite, "testSaveLoad", testSaveLoad)) ||
            (NULL == CU_add_test(pSuite, "testBuildQuery1", testBuildQuery1)) ||
            (NULL == CU_add_test(pSuite, "testDBOptions", testDBOptions))

            ) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Run all tests using the CUnit Basic interface */
    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
    int ret = CU_get_error() || CU_get_number_of_failures();
    CU_cleanup_registry();
    return ret;
}
开发者ID:CowanSM,项目名称:ejdb,代码行数:32,代码来源:t1.c


示例7: main

int main(void)
{
  CU_BasicRunMode mode = CU_BRM_VERBOSE;
  CU_ErrorAction error_action = CUEA_IGNORE;
  setvbuf(stdout, NULL, _IONBF, 0);

  if (CU_initialize_registry())
    {
      fprintf(stderr,"failed to initialise registry\n");
      return EXIT_FAILURE;
    }

  tests_load();
  CU_basic_set_mode(mode);
  CU_set_error_action(error_action);

  int
    status = CU_basic_run_tests(),
    nfail = CU_get_number_of_failures();

  CU_cleanup_registry();
  printf("\nSuite returned %d.\n", status);

  return (nfail > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
}
开发者ID:jjgreen,项目名称:pia,代码行数:25,代码来源:main.c


示例8: main

int main(void)
{
	CU_pSuite pSuite = NULL;

	if (CUE_SUCCESS != CU_initialize_registry())
		return CU_get_error();

	pSuite = CU_add_suite("Suite_1", init_suite1, clean_suite1);
	if (NULL == pSuite) {
		CU_cleanup_registry();
		return CU_get_error();
	}

	if ((NULL == CU_add_test(pSuite, "test of fprintf()", testFPRINTF)) ||
			(NULL == CU_add_test(pSuite, "test of fread()", testFREAD)))
	{
		CU_cleanup_registry();
		return CU_get_error();
	}

	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();
	CU_cleanup_registry();

	return CU_get_error();
}
开发者ID:jafffy,项目名称:CUnit-test,代码行数:26,代码来源:test.c


示例9: main

int main() {
    CU_pSuite pSuite = NULL;

    /* Initialize the CUnit test registry */
    if (CUE_SUCCESS != CU_initialize_registry())
        return CU_get_error();

    /* Add a suite to the registry */
    pSuite = CU_add_suite("SAMTest", init_suite, clean_suite);
    if (NULL == pSuite) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Add the tests to the suite */
    if (NULL == CU_add_test(pSuite, "test1", test1)) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Run all tests using the CUnit Basic interface */
    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
    CU_cleanup_registry();
    return CU_get_error();
}
开发者ID:r78v10a07,项目名称:gTools,代码行数:26,代码来源:SAMTest.c


示例10: main

int main ( void )
{
    CU_pSuite pSuite = NULL;

    if ( CUE_SUCCESS != CU_initialize_registry() )
        return CU_get_error();

    pSuite = CU_add_suite( "max_test_suite", init_suite, clean_suite );
    if ( NULL == pSuite ) {
        CU_cleanup_registry();
        return CU_get_error();
    }


    if ( (NULL == CU_add_test(pSuite, "max_test_1", max_test_1)) ||
            (NULL == CU_add_test(pSuite, "max_test_2", max_test_2)) ||
            (NULL == CU_add_test(pSuite, "max_test_3", max_test_3))
       )
    {
        CU_cleanup_registry();
        return CU_get_error();
    }


    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
    printf("\n");
    CU_basic_show_failures(CU_get_failure_list());
    printf("\n\n");

    CU_cleanup_registry();
    return CU_get_error();
}
开发者ID:Mokimok,项目名称:Info-S3,代码行数:33,代码来源:maxi_test2.c


示例11: TcuExecute

void TcuExecute(void)
{
    if (TestGetAutomatic()) {
        if (TestGetFilename()) {
            CU_set_output_filename(TestGetFilename());
        }
        CU_automated_run_tests();
    }
    else if (TestGetBasic()) {
        CU_basic_set_mode(CU_BRM_VERBOSE);
        (void) CU_basic_run_tests();
    }
    else if (TestGetConsole()) {
        CU_console_run_tests();
    }
    else if (TestGetList()) {
        if (TestGetFilename()) {
            CU_set_output_filename(TestGetFilename());
        }
        (void) CU_list_tests_to_file();
    }

	if (CU_get_number_of_tests_failed()) {
		return;
	}

    /* Clean up the registry */

    CU_cleanup_registry();
}
开发者ID:matje,项目名称:ttods,代码行数:30,代码来源:test_routines_cunit.c


示例12: main

int main(int argc, char **argv)
{
	int failures;
	CU_pSuite pSuite = NULL;

	if (CU_initialize_registry() != CUE_SUCCESS) {
		printf("CU_initialize_registry() failed\n");
		return CU_get_error();
	}

	pSuite = CU_add_suite("IO interception library test",
			      NULL, NULL);

	if (!pSuite) {
		CU_cleanup_registry();
		printf("CU_add_suite() failed\n");
		return CU_get_error();
	}

	if (!CU_add_test(pSuite, "libioil sanity test", sanity)) {
		CU_cleanup_registry();
		printf("CU_add_test() failed\n");
		return CU_get_error();
	}

	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();
	failures = CU_get_number_of_failures();
	CU_cleanup_registry();

	return failures;
}
开发者ID:daos-stack,项目名称:daos,代码行数:32,代码来源:test_ioil.c


示例13: main

int main()
{
    CU_pSuite pSuite = NULL;

    /* initialize the CUnit test registry */
    if (CUE_SUCCESS != CU_initialize_registry())
        return CU_get_error();

    /* add a suite to the registry */
    pSuite = CU_add_suite("Suite_1", init_suite1, clean_suite1);
    if (NULL == pSuite) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* add the tests to the suite */
    if (
        (NULL == CU_add_test(pSuite, "Simple test", testSIMPLE)) ||
        (NULL == CU_add_test(pSuite, "cases.mpac test", testCasesMpac)) ||
        (NULL == CU_add_test(pSuite, "cases.mpac (part) test", testCasesMpacPart)) ||
        (NULL == CU_add_test(pSuite, "New spec str8 test", testNewSpecStr8)) ||
        (NULL == CU_add_test(pSuite, "New spec bin test", testNewSpecBin)) ||
        0)
    {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* Run all tests using the CUnit Basic interface */
    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
    CU_cleanup_registry();
    return CU_get_error();
}
开发者ID:orofarne,项目名称:msgpack-c-len,代码行数:34,代码来源:test.c


示例14: main

int main(int argc, char **argv)
{
	CU_pSuite	suite = NULL;
	unsigned int	num_failures;

	if (CU_initialize_registry() != CUE_SUCCESS) {
		return CU_get_error();
	}

	suite = CU_add_suite("log", NULL, NULL);
	if (suite == NULL) {
		CU_cleanup_registry();
		return CU_get_error();
	}

	if (
		CU_add_test(suite, "log_ut", log_test) == NULL) {
		CU_cleanup_registry();
		return CU_get_error();
	}

	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();
	num_failures = CU_get_number_of_failures();
	CU_cleanup_registry();
	return num_failures;
}
开发者ID:spdk,项目名称:spdk,代码行数:27,代码来源:log_ut.c


示例15: main

int main(int argc, char ** argv) {
    
    CU_ErrorCode rc;
    
    /* acknowledge+hide "unused parameter" compiler warnings */
    ACKNOWLEDGED_UNUSED(argc);
    ACKNOWLEDGED_UNUSED(argv);
    
    /* seed rng */
    srand((unsigned int)time(NULL));
    
    /* initialize the CUnit test registry */
    if (CUE_SUCCESS != CU_initialize_registry())
    {
        return CU_get_error();
    }
    
    
    /* ================ Add Test Suites to registry ================= */
    
    /* Test suite for Parallel Libmboard */
    if(testsuite_mb_parallel() != CUE_SUCCESS) return clean_quit();
 

    /* -------------------------------------------------------------- */
    
    
    /* Run all tests using the CUnit Basic interface */
    CU_basic_set_mode(CU_BRM_VERBOSE);
    rc = CU_basic_run_tests();
    
    /* clean up registry and quit */
    return clean_quit();
}
开发者ID:somebloke,项目名称:flame-libmboard,代码行数:34,代码来源:run_test_parallel.c


示例16: main

int
main ()
{
    CU_pSuite pSuite1 = NULL;

    /* initialize registry */
    if (CUE_SUCCESS != CU_initialize_registry())
        return CU_get_error();

    /* add suites to registry */
    pSuite1 = CU_add_suite("Test quick", setup_suite1, teardown_suite1);

    if (pSuite1 == NULL) {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* add tests to suite */
    if (  (NULL == CU_add_test(pSuite1, "test swap", test_swap_suite1))
       || (NULL == CU_add_test(pSuite1, "test partition", test_partition_suite1))
       || (NULL == CU_add_test(pSuite1, "test quicksort", test_quick_sort_suite1))  )
    {
        CU_cleanup_registry();
        return CU_get_error();
    }

    /* run tests */
    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();

    CU_cleanup_registry();
    return CU_get_error();
}
开发者ID:Risto-Stevcev,项目名称:c-quicksort,代码行数:33,代码来源:testquicksort.c


示例17: main

int main() {
    CU_BasicRunMode mode = CU_BRM_VERBOSE;
    CU_ErrorAction error_action = CUEA_IGNORE;
  
    CU_ErrorCode cue = CU_initialize_registry();
    if (cue != CUE_SUCCESS) { 
	printf("ERROR in CU_initialize_registry\n");
	return;
    }
    CU_basic_set_mode(mode);
    CU_set_error_action(error_action);
  
    CU_pSuite hitCounting, wordAdding, wordChomping, wordChecking;

    hitCounting = CU_add_suite("Hit counting", my_suite_init, my_suite_clean);
    wordAdding = CU_add_suite("Word adding", my_suite_init, my_suite_clean);
    wordChecking = CU_add_suite("Word checking", my_suite_init, my_suite_clean);

    CU_ADD_TEST(hitCounting, test_5_hits);  
    CU_ADD_TEST(hitCounting, test_1_hits);  
    CU_ADD_TEST(hitCounting, test_no_hits);  
    CU_ADD_TEST(hitCounting, test_hits_out_of_order_do_not_count);


    CU_ADD_TEST(wordChecking, test_check_for_word_in_jdict);
    CU_ADD_TEST(wordChecking, test_winnowing_jdict);
  
    CU_basic_run_tests();
    CU_cleanup_registry();
}
开发者ID:dblack,项目名称:cjotto,代码行数:30,代码来源:jotto.c


示例18: main

int main()
{
    CU_pSuite pSuite = NULL;
    
    /* initialize the CUnit test registry */
    if (CUE_SUCCESS != CU_initialize_registry())
        return CU_get_error();
    
    /* add a suite to the registry */
    pSuite = CU_add_suite("csound_orc_semantics function tests", init_suite1, clean_suite1);
    if (NULL == pSuite) {
        CU_cleanup_registry();
        return CU_get_error();
    }
    
    /* add the tests to the suite */
    if ((NULL == CU_add_test(pSuite, "Test find_opcode2()", test_find_opcode2))
        || (NULL == CU_add_test(pSuite, "Test resolve_opcode()", test_resolve_opcode))
        || (NULL == CU_add_test(pSuite, "Test find_opcode_new()", test_find_opcode_new))
        || (NULL == CU_add_test(pSuite, "Test check_out_arg()", test_check_out_arg))
        || (NULL == CU_add_test(pSuite, "Test check_out_args()", test_check_out_args))
        || (NULL == CU_add_test(pSuite, "Test check_in_arg()", test_check_in_arg))
        || (NULL == CU_add_test(pSuite, "Test check_in_args()", test_check_in_args))
        )
    {
        CU_cleanup_registry();
        return CU_get_error();
    }
    
    /* Run all tests using the CUnit Basic interface */
    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
    CU_cleanup_registry();
    return CU_get_error();
}
开发者ID:amitkumar3968,项目名称:csound,代码行数:35,代码来源:csound_orc_semantics_test.c


示例19: main

int main(void) {
	CU_initialize_registry();

	CU_pSuite pSuite_cf_surname, pSuite_cf_name, pSuite_cf_date,
	          pSuite_cf_ctrl_code, pSuite_cf_generator;

	pSuite_cf_surname = CU_add_suite("cf_surname", init_suite_default,
			clean_suite_default);

	pSuite_cf_name = CU_add_suite("cf_name",init_suite_default,
				clean_suite_default);
	pSuite_cf_date = CU_add_suite("cf_date",init_suite_default,
				clean_suite_default);
	pSuite_cf_ctrl_code = CU_add_suite("cf_ctrl_code",init_suite_default,
				clean_suite_default);
	pSuite_cf_generator = CU_add_suite("cf_generator",init_suite_default,
				clean_suite_default);

	CU_add_test(pSuite_cf_surname, "surname2code()",
			test_surname2code);
	CU_add_test(pSuite_cf_name, "name2code()", test_name2code);
	CU_add_test(pSuite_cf_date, "date2code()", test_date2code);
	CU_add_test(pSuite_cf_ctrl_code, "cf_ctrl_code()",
			test_cf_ctrl_code);
	CU_add_test(pSuite_cf_generator, "cf_generator()",
			test_cf_generator);

	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();
	CU_cleanup_registry();

	return CU_get_error();
}
开发者ID:michelerana,项目名称:university,代码行数:33,代码来源:main.c


示例20: main

int main(int argc, char **argv) {
    CU_pSuite suite = NULL;

    if(CU_initialize_registry() != CUE_SUCCESS) {
        return CU_get_error();
    }

    // Init suite
    suite = CU_add_suite("Shadowdive", NULL, NULL);
    if(suite == NULL) {
        goto end;
    }
    
    // Add tests
    if(CU_add_test(suite, "test of sd_bk_create", test_sd_bk_create) == NULL) { goto end; }
    if(CU_add_test(suite, "test of sd_bk_delete", test_sd_bk_delete) == NULL) { goto end; }
    if(CU_add_test(suite, "test of sd_af_create", test_sd_af_create) == NULL) { goto end; }
    if(CU_add_test(suite, "test of sd_af_delete", test_sd_af_delete) == NULL) { goto end; }

    // Run tests
    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();
   
end:
    CU_cleanup_registry();
    return CU_get_error();
}
开发者ID:rev22,项目名称:libShadowDive,代码行数:27,代码来源:test_lib.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CU_cleanup_registry函数代码示例发布时间:2022-05-30
下一篇:
C++ CU_basic_run_tests函数代码示例发布时间: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