您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CU_basic_run_tests函数代码示例

51自学网 2021-06-01 20:07:36
  C++
这篇教程C++ CU_basic_run_tests函数代码示例写得很实用,希望能帮到您。

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

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

示例1: main

intmain(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("bit_array", NULL, NULL);	if (suite == NULL) {		CU_cleanup_registry();		return CU_get_error();	}	if (		CU_add_test(suite, "test_1bit", test_1bit) == NULL ||		CU_add_test(suite, "test_64bit", test_64bit) == NULL ||		CU_add_test(suite, "test_find", test_find) == NULL ||		CU_add_test(suite, "test_resize", test_resize) == NULL ||		CU_add_test(suite, "test_errors", test_errors) == 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,代码行数:35,


示例2: main

int main(int argc, char **argv){        /* Initialize CUnit. */        if (CUE_SUCCESS != CU_initialize_registry())                return CU_get_error();        /* Here's an example test suite.  First we initialize the suit. */        {                CU_pSuite s = CU_add_suite("example test suite",                                &init_suite_example,                                &clean_suite_example);                CU_add_test(s, "test of mm_malloc()", &test_malloc);                CU_add_test(s, "test #1 of mm_malloc()", &test_malloc_1);                CU_add_test(s, "test #2 of mm_malloc()", &test_malloc_2);                CU_add_test(s, "test #3 of mm_malloc()", &test_malloc_3);                CU_add_test(s, "test #4 of mm_malloc()", &test_malloc_4);                CU_add_test(s, "test #5 of mm_malloc()", &test_malloc_5);                CU_add_test(s, "test #6 of mm_malloc()", &test_malloc_6);                CU_add_test(s, "test #1 of mm_realloc()", &test_realloc_1);                CU_add_test(s, "test #2 of mm_realloc()", &test_realloc_2);                CU_add_test(s, "test #3 of mm_realloc()", &test_realloc_3);                CU_add_test(s, "test #4 of mm_realloc()", &test_realloc_4);                CU_add_test(s, "test #5 of mm_realloc()", &test_realloc_5);                CU_add_test(s, "test #1 of mm_free()", &test_free_1);                CU_add_test(s, "test #2 of mm_free()", &test_free_2);        }        /* Actually run your tests here. */        CU_basic_set_mode(CU_BRM_VERBOSE);        CU_basic_run_tests();        CU_cleanup_registry();        return CU_get_error();}
开发者ID:coconan,项目名称:cbs-scheduler,代码行数:35,


示例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("google_oauth2_access_test", 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, "testBuildAccessTokenRequestAsHtmlRequest", testBuildAccessTokenRequestAsHtmlRequest)) ||            (NULL == CU_add_test(pSuite, "testBuildPostFieldsForRefreshingTheAccessToken", testBuildPostFieldsForRefreshingTheAccessToken)) ||            (NULL == CU_add_test(pSuite, "testBuildPostFieldsForRequestingAnAccessToken", testBuildPostFieldsForRequestingAnAccessToken)) ||            (NULL == CU_add_test(pSuite, "testMakeHttpsRequestWithResponse", testMakeHttpsRequestWithResponse)) ||            (NULL == CU_add_test(pSuite, "testProcessIncomingAccessTokenResponse", testProcessIncomingAccessTokenResponse)) ||            (NULL == CU_add_test(pSuite, "testProcessIncomingRefreshTokenResponse", testProcessIncomingRefreshTokenResponse)) ||            (NULL == CU_add_test(pSuite, "testcheckIfErrorOccured", testcheckIfErrorOccured)))    {        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:EarlOfEgo,项目名称:GoogleTasksClientLibrary,代码行数:35,


示例4: 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 */   /* NOTE - ORDER IS IMPORTANT - MUST TEST fread() AFTER fprintf() */   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();   }   /* 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:gobbigustavo,项目名称:PaiDePiper,代码行数:34,


示例5: 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("gcd_suite", NULL, NULL);    if (NULL == pSuite) {        CU_cleanup_registry();        return CU_get_error();    }    /* add the tests to the suite */    if ((NULL == CU_add_test(pSuite, "test_same_number", test_same_number)) ||        (NULL == CU_add_test(pSuite, "test_nothing_common", test_nothing_common)) ||        (NULL == CU_add_test(pSuite, "test_factorize", test_factorize)) ||        (NULL == CU_add_test(pSuite, "test_gcd_ok", test_gcd_ok)) ||        (NULL == CU_add_test(pSuite, "test_malloc_fail", test_malloc_fail)) ||        (NULL == CU_add_test(pSuite, "test_malloc_equals_free", test_malloc_equals_free)) ||        (NULL == CU_add_test(pSuite, "test_nb_threads", test_nb_threads)))    {        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:UCL-INGI,项目名称:SINF1252,代码行数:35,


示例6: main

int main(        const int argc,        const char* const * argv){    int exitCode = 1; /* failure */    if (CUE_SUCCESS == CU_initialize_registry()) {        CU_Suite* testSuite = CU_add_suite(__FILE__, setup, teardown);        if (NULL != testSuite) {            const char* progname = basename((char*)argv[0]);            CU_ADD_TEST(testSuite, test_create);            CU_ADD_TEST(testSuite, test_get);            CU_ADD_TEST(testSuite, test_write_lock);            CU_ADD_TEST(testSuite, test_read_lock);            CU_ADD_TEST(testSuite, test_multiple_write);            CU_ADD_TEST(testSuite, test_multiple_read);            if (log_init(progname)) {                (void) fprintf(stderr, "Couldn't open logging system/n");            }            else {                if (CU_basic_run_tests() == CUE_SUCCESS) {                    if (0 == CU_get_number_of_failures())                        exitCode = 0; /* success */                }            }        }        CU_cleanup_registry();    } /* CUnit registry allocated */    return exitCode;}
开发者ID:Unidata,项目名称:LDM,代码行数:35,


示例7: 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("nvmf", NULL, NULL);	if (suite == NULL) {		CU_cleanup_registry();		return CU_get_error();	}	if (		CU_add_test(suite, "create_subsystem", nvmf_test_create_subsystem) == NULL ||		CU_add_test(suite, "find_subsystem", nvmf_test_find_subsystem) == NULL ||		CU_add_test(suite, "discovery_log", test_discovery_log) == 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,代码行数:29,


示例8: main

int main(){   /* initialize the CUnit test registry */   if (CUE_SUCCESS != CU_initialize_registry())      return CU_get_error();   if (CUE_SUCCESS != create_tlv_suit()) {       goto exit;   }   if (CUE_SUCCESS != create_uri_suit()) {       goto exit;   }   if (CUE_SUCCESS != create_convert_numbers_suit()) {       goto exit;   }   if (CUE_SUCCESS != create_tlv_json_suit()) {       goto exit;   }   CU_basic_set_mode(CU_BRM_VERBOSE);   CU_basic_run_tests();exit:   CU_cleanup_registry();   return CU_get_error();}
开发者ID:duanlhjoe,项目名称:wakaama,代码行数:25,


示例9: main

int main(int argc, char const *argv[]) {	if (CUE_SUCCESS != CU_initialize_registry())		return CU_get_error();	CU_pSuite pSuite = NULL;	pSuite = CU_add_suite("Suite de tests : libfractal", setup, teardown);	if (NULL == pSuite) {		CU_cleanup_registry();		return CU_get_error();	}	if ((NULL == CU_add_test(pSuite, "Name", test_libfractal_ptr_not_null)) ||			(NULL == CU_add_test(pSuite, "Name", test_libfractal_ptr_value_not_null)) ||			(NULL == CU_add_test(pSuite, "Name", test_libfractal_get_name)) ||			(NULL == CU_add_test(pSuite, "Name", test_libfractal_get_width)) ||			(NULL == CU_add_test(pSuite, "Name", test_libfractal_get_height)) ||			(NULL == CU_add_test(pSuite, "Name", test_libfractal_get_a)) ||			(NULL == CU_add_test(pSuite, "Name", test_libfractal_get_b))||			(NULL == CU_add_test(pSuite, "Name", test_libfractal_get_set_value))) {		CU_cleanup_registry();		return CU_get_error();	}	CU_basic_run_tests();	CU_basic_show_failures(CU_get_failure_list());	CU_cleanup_registry();	return 0;}
开发者ID:pgonzalezalv,项目名称:os_project2,代码行数:25,


示例10: main

int main(int argc, char const *argv[]) {	if (CUE_SUCCESS != CU_initialize_registry())		return CU_get_error();	CU_pSuite pSuite = NULL;	pSuite = CU_add_suite("Suite de tests : malloc", setup, teardown);	if (NULL == pSuite) {		CU_cleanup_registry();		return CU_get_error();	}	if ((NULL == CU_add_test(pSuite, "Blocks réallouables", test_free_block_reallouable)) ||	 		(NULL == CU_add_test(pSuite, "Pointeur non null", test_malloc_pointeur_non_null)) ||			(NULL == CU_add_test(pSuite, "Deux pointeurs différents", test_malloc_deux_pointeurs_differents)) ||			(NULL == CU_add_test(pSuite, "Size 0", test_malloc_size_0)) ||			(NULL == CU_add_test(pSuite, "Pointeur invalide", test_free_malloc)) ||			(NULL == CU_add_test(pSuite, "Test valeur", test_malloc_ajout)) ||			(NULL == CU_add_test(pSuite, "Double Free", test_double_free)) ||			(NULL == CU_add_test(pSuite, "Test Calloc", callocTest))) {		CU_cleanup_registry();		return CU_get_error();	}	CU_basic_set_mode(CU_BRM_VERBOSE);	CU_basic_run_tests();	CU_basic_show_failures(CU_get_failure_list());	CU_cleanup_registry();	return 0;}
开发者ID:CelineDknp,项目名称:Projet1-C,代码行数:26,


示例11: main

int main(void){	CU_pSuite pSuite = NULL;	if (CUE_SUCCESS != CU_initialize_registry())		return CU_get_error();	pSuite = CU_add_suite("toml suite", init_toml, fini_toml);	if (NULL == pSuite)		goto out;	if ((NULL == CU_add_test(pSuite, "test fruit", testFruit)))		goto out;	if ((NULL == CU_add_test(pSuite, "test types", testTypes)))		goto out;	if ((NULL == CU_add_test(pSuite, "test hex", testHex)))		goto out;	if ((NULL == CU_add_test(pSuite, "test good examples", testGoodExamples)))		goto out;	if ((NULL == CU_add_test(pSuite, "test bad examples", testBadExamples)))		goto out;	CU_basic_set_mode(CU_BRM_VERBOSE);	CU_basic_run_tests();out:	CU_cleanup_registry();	exit(CU_get_error());}
开发者ID:medcat,项目名称:libtoml,代码行数:33,


示例12: liblinphone_tester_run_tests

int liblinphone_tester_run_tests(const char *suite_name, const char *test_name) {	int i;	int ret;	/* initialize the CUnit test registry */	if (CUE_SUCCESS != CU_initialize_registry())		return CU_get_error();	for (i = 0; i < liblinphone_tester_nb_test_suites(); i++) {		run_test_suite(test_suite[i]);	}	if (suite_name){		CU_pSuite suite;		CU_basic_set_mode(CU_BRM_VERBOSE);		suite=CU_get_suite(suite_name);		if (!suite) {			ms_error("Could not find suite '%s'. Available suites are:", suite_name);			liblinphone_tester_list_suites();			return -1;		} else if (test_name) {			CU_pTest test=CU_get_test_by_name(test_name, suite);			if (!test) {				ms_error("Could not find test '%s' in suite '%s'. Available tests are:", test_name, suite_name);				// do not use suite_name here, since this method is case sentisitive				liblinphone_tester_list_suite_tests(suite->pName);				return -2;			} else {				CU_ErrorCode err= CU_basic_run_test(suite, test);				if (err != CUE_SUCCESS) ms_error("CU_basic_run_test error %d", err);			}		} else {			CU_basic_run_suite(suite);		}	} else	{#if HAVE_CU_CURSES		if (curses) {			/* Run tests using the CUnit curses interface */			CU_curses_run_tests();		}		else#endif		{			/* Run all tests using the CUnit Basic interface */			CU_basic_set_mode(CU_BRM_VERBOSE);			CU_basic_run_tests();		}	}	ret=CU_get_number_of_tests_failed()!=0;	/* Redisplay list of failed tests on end */	if (CU_get_number_of_failure_records()){		CU_basic_show_failures(CU_get_failure_list());		printf("/n");	}	CU_cleanup_registry();	return ret;}
开发者ID:brenttsai1148,项目名称:linphone-android,代码行数:60,


示例13: 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 */   /* NOTE - ORDER IS IMPORTANT*/   if ((NULL == CU_add_test(pSuite, "test of test_listdir()", test_listdir)) ||       (NULL == CU_add_test(pSuite, "test of test_movefile()", test_movefile)) ||	   (NULL == CU_add_test(pSuite, "test of test_makefolder()", test_makefolder)) ||	   (NULL == CU_add_test(pSuite, "test of test_checkfordir()", test_checkfordir)) ||	   (NULL == CU_add_test(pSuite, "test of test_changedirdown()", test_changedirdown)) ||	   (NULL == CU_add_test(pSuite, "test of test_dirconcat()", test_dirconcat)) ||	   (NULL == CU_add_test(pSuite, "test of test_getfilename()", test_getfilename)))   {      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:maxfalk,项目名称:Ioopm,代码行数:39,


示例14: 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("dwistring_test", 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, "test_concat_null", test_concat_null)) ||            (NULL == CU_add_test(pSuite, "test_concat_both_null", test_concat_both_null))||            (NULL == CU_add_test(pSuite, "test_concat_both_null", test_concat_both_null))||            (NULL == CU_add_test(pSuite, "test_concatall_three_values", test_concatall_three_values))||            (NULL == CU_add_test(pSuite, "test_contains_char_positive", test_contains_char_positive))||            (NULL == CU_add_test(pSuite, "test_contains_char_null", test_contains_char_null))||            (NULL == CU_add_test(pSuite, "test_contains_char_empty", test_contains_char_empty))||            (NULL == CU_add_test(pSuite, "test_null_string_normal", test_null_string_normal))||            (NULL == CU_add_test(pSuite, "test_null_string_nullpointer", test_null_string_nullpointer))||            (NULL == CU_add_test(pSuite, "test_concatall_first_null", test_concatall_first_null))) {        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:DanielWieczorek,项目名称:dwilib,代码行数:35,


示例15: 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("asf suite", NULL, NULL);   if (NULL == pSuite) {      CU_cleanup_registry();      return CU_get_error();   }   /* add the tests to the suite */   if ((NULL == CU_add_test(pSuite, "vector", test_vector)) ||       (NULL == CU_add_test(pSuite, "strUtil", test_strUtil)) ||       (NULL == CU_add_test(pSuite, "solve1d", test_solve1d)) ||       (NULL == CU_add_test(pSuite, "complex", test_complex)))   {      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 nfail = CU_get_number_of_failures();   CU_cleanup_registry();   return nfail>0;}
开发者ID:asfadmin,项目名称:ASF_MapReady,代码行数:32,


示例16: main

int main(int argc, char **argv){    int status;    if(CUE_SUCCESS != CU_initialize_registry())        return CU_get_error();    if(!(status = setup_object_tests())        || !(status = setup_list_tests()))    {        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_automated_run_tests();    CU_list_tests_to_file();    //CU_console_run_tests();    CU_cleanup_registry();    return CU_get_error();}
开发者ID:dylan-evans,项目名称:objspace,代码行数:30,


示例17: main

intmain(int argc, char **argv){  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("AgsRecallIDTest", ags_recall_id_test_init_suite, ags_recall_id_test_clean_suite);    if(pSuite == NULL){    CU_cleanup_registry();        return CU_get_error();  }  /* add the tests to the suite */  if((CU_add_test(pSuite, "test of AgsRecallID find reycling context", ags_recall_id_test_find_recycling_context) == NULL) ||     (CU_add_test(pSuite, "test of AgsRecallID find parent reycling context", ags_recall_id_test_find_parent_recycling_context) == NULL)){    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:gsequencer,项目名称:gsequencer,代码行数:35,


示例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("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, "test chord_reset"         , test_chord_reset))         ||		(NULL == CU_add_test(pSuite, "test chord_touch_start"   , test_chord_touch_start))   ||		(NULL == CU_add_test(pSuite, "test chord_touch_end"     , test_chord_touch_end))     ||		(NULL == CU_add_test(pSuite, "test chord_state_is_empty", test_chord_state_is_empty))||		(NULL == CU_add_test(pSuite, "test chord_state_bitmap"  , test_chord_state_bitmap))	){		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:juhakivekas,项目名称:asetniop-for-linux,代码行数:33,


示例19: main

int main() {  int i = 0;  CU_ErrorCode error;    test_initialize();  CU_SuiteInfo all_test_suites[TEST_CUITES_COUNT + 1];  all_test_suites[i++] = fs_test_suite;  all_test_suites[i++] = mm_test_suite;  all_test_suites[i++] = glibc_test_suite;  all_test_suites[i++] = shell_test_suite;  all_test_suites[i++] = ring_buffer_test_suite;  all_test_suites[i++] = (CU_SuiteInfo)CU_SUITE_INFO_NULL;  if (CUE_SUCCESS != CU_initialize_registry())	return CU_get_error();  error = CU_register_suites(all_test_suites);  CU_basic_set_mode(CU_BRM_VERBOSE);  CU_basic_run_tests();  CU_cleanup_registry();  error = CU_get_error();  test_finalize();  return error;}
开发者ID:Markgorden,项目名称:Sparrow,代码行数:28,


示例20: 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("logTest", 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, "test2", test2)) ||            (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:jzendle,项目名称:INIT-101-UTIL,代码行数:27,


示例21: 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("nvmf", NULL, NULL);	if (suite == NULL) {		CU_cleanup_registry();		return CU_get_error();	}	if (		CU_add_test(suite, "foobar", test_foobar) == 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:lkpdn,项目名称:spdk,代码行数:27,


示例22: main

int main(int argc, char *argv[]) {	bool runTests = false;	if (runTests == true) {		CU_initialize_registry();		CU_register_suites(suites);		CU_basic_set_mode(CU_BRM_VERBOSE);		CU_basic_run_tests();		CU_cleanup_registry();		return CU_get_error();	}	puts("Inicializando");	conf_nodo* configuracion = cargarConfiguracion(argc, argv);	estadoGlobal= inicializarEstado(configuracion);	int resultado = ejecutarProgramaPrincipal(estadoGlobal);	return resultado;}
开发者ID:alejandrozalazar,项目名称:tp-2015-1c-los-salieris,代码行数:25,


示例23: main

intmain (){    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 merge", 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 merge", test_merge_suite1))       || (NULL == CU_add_test(pSuite1, "test mergesort", test_merge_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-mergesort,代码行数:32,


示例24: main

/* *Function main. *This function builds the suite of tests. *After execution it shows a tabe that records all the tests and  *that shows where there is an error. */int main(){	CU_pSuite pSuite = NULL; 	if(CUE_SUCCESS != CU_initialize_registry()){		return CU_get_error();	}	pSuite = CU_add_suite("Suite de tests pour sender.c et receiver.c", init_suite,clean_suite); 	if (NULL == pSuite) { 		CU_cleanup_registry(); 		return CU_get_error(); 	}		if( (NULL == CU_add_test(pSuite,"test create socket",test_create_socket)))	{		CU_cleanup_registry();		return CU_get_error();	}			CU_basic_run_tests();	CU_basic_show_failures(CU_get_failure_list());	CU_cleanup_registry();	return CU_get_error();}
开发者ID:cmomin,项目名称:LINGI1341-Projet1,代码行数:31,


示例25: main

int main(int argc, char** argv){    CU_SuiteInfo suites[] = {        pro_expr_test_suite,        pro_identifier_expr_test_suite,        pro_string_expr_test_suite,        pro_number_expr_test_suite,        pro_let_expr_test_suite,        pro_send_expr_test_suite,        pro_become_expr_test_suite,        CU_SUITE_INFO_NULL    };        // initialize the CUnit test registry    if (CUE_SUCCESS != CU_initialize_registry())        return CU_get_error();    // add suites to the registry    if (CUE_SUCCESS != CU_register_suites(suites))    {        CU_cleanup_registry();        return CU_get_error();    }    // run all tests    CU_basic_set_mode(CU_BRM_VERBOSE);    CU_basic_run_tests();    CU_cleanup_registry();    return CU_get_error();}
开发者ID:mattbierner,项目名称:prosopon-interpreter,代码行数:30,


示例26: main

int main() {    if (CU_initialize_registry() != CUE_SUCCESS)        return CU_get_error();    unsigned int tests_failed = 0;    CU_pSuite suite = CU_add_suite("Shunting Yard", NULL, NULL);    if (!suite)        goto exit;    if (!CU_add_test(suite, "addition", test_addition) ||            !CU_add_test(suite, "subtraction", test_subtraction) ||            !CU_add_test(suite, "multiplication", test_multiplication) ||            !CU_add_test(suite, "division", test_division) ||            !CU_add_test(suite, "modulus", test_modulus) ||            !CU_add_test(suite, "exponentiation", test_exponentiation) ||            !CU_add_test(suite, "factorials", test_factorials) ||            !CU_add_test(suite, "functions", test_functions) ||            !CU_add_test(suite, "constants", test_constants) ||            !CU_add_test(suite, "operator precedence", test_precedence) ||            !CU_add_test(suite, "error handling", test_errors))        goto exit;    CU_basic_set_mode(CU_BRM_NORMAL);    CU_basic_run_tests();    tests_failed = CU_get_number_of_tests_failed();exit:    CU_cleanup_registry();    return tests_failed ? EXIT_FAILURE : CU_get_error();}
开发者ID:bmars,项目名称:shunting-yard,代码行数:29,


示例27: main

intmain(    const int           argc,    const char* const*  argv){    int         exitCode = EXIT_FAILURE;    if (-1 == openulog(basename(argv[0]), 0, LOG_LOCAL0, "-")) {        (void)fprintf(stderr, "Couldn't initialize logging system/n");    }    else {        if (CUE_SUCCESS == CU_initialize_registry()) {            CU_Suite*       testSuite = CU_add_suite(__FILE__, setup,                teardown);            if (NULL != testSuite) {                CU_ADD_TEST(testSuite, test_add_get);                CU_ADD_TEST(testSuite, test_order);                if (CU_basic_run_tests() == CUE_SUCCESS)                    exitCode = CU_get_number_of_failures();            }            CU_cleanup_registry();        } /* CUnit registery allocated */        log_free();    } /* logging system initialized */    return exitCode;}
开发者ID:khallock,项目名称:LDM,代码行数:31,


示例28: main

int main(){	CU_pSuite ps = NULL;	if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error();	if(NULL == (ps = CU_add_suite("suite_1", init_suite1, clean_suite1)))	{		CU_cleanup_registry();		return CU_get_error();	}	if (		(NULL == CU_add_test(ps, "test_set_lrumc_data_buff()", test_set_lrumc_data_buff)) ||		(NULL == CU_add_test(ps, "test_set_lrumc_data_int()", test_set_lrumc_data_int)) ||		(NULL == CU_add_test(ps, "test_set_lrumc_data_double()", test_set_lrumc_data_double)) ||		(NULL == CU_add_test(ps, "test_set_lrumc_data_object()", test_set_lrumc_data_object)) ||		(NULL == CU_add_test(ps, "test_set_lrumc_data_bool()", test_set_lrumc_data_bool)) ||		(NULL == CU_add_test(ps, "test_add_lrumc_data_buff()", test_add_lrumc_data_buff)) ||		(NULL == CU_add_test(ps, "test_add_lrumc_data_int()", test_add_lrumc_data_int)) ||		(NULL == CU_add_test(ps, "test_add_lrumc_data_double()", test_add_lrumc_data_double)) ||		(NULL == CU_add_test(ps, "test_add_lrumc_data_object()", test_add_lrumc_data_object)) ||		(NULL == CU_add_test(ps, "test_add_lrumc_data_bool()", test_add_lrumc_data_bool)) 	) 	{		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:KevinQi1981,项目名称:irid,代码行数:35,


示例29: main

intmain(    const int     argc,    char* const*  argv){    int         exitCode = EXIT_FAILURE;    if (CUE_SUCCESS == CU_initialize_registry()) {        CU_Suite*       testSuite = CU_add_suite(__FILE__, setup, teardown);        if (NULL != testSuite) {            CU_ADD_TEST(testSuite, test_getDottedDecimal);#           if WANT_MULTICAST                CU_ADD_TEST(testSuite, test_sa_getInetSockAddr);                CU_ADD_TEST(testSuite, test_sa_getInet6SockAddr);                CU_ADD_TEST(testSuite, test_sa_parse);                CU_ADD_TEST(testSuite, test_sa_parseWithDefaults);#           endif            if (-1 == openulog(basename(argv[0]), 0, LOG_LOCAL0, "-")) {                (void)fprintf(stderr, "Couldn't open logging system/n");            }            else {                if (CU_basic_run_tests() == CUE_SUCCESS) {                    if (0 == CU_get_number_of_failures())                        exitCode = EXIT_SUCCESS;                }            }        }        CU_cleanup_registry();    }                           /* CUnit registery allocated */    return exitCode;}
开发者ID:khallock,项目名称:LDM,代码行数:35,


示例30: main

int main(){	int i;	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 */	if (!(pSuite = CU_add_suite("Test Suite", init_suite1, clean_suite1)))	{		CU_cleanup_registry();		return CU_get_error();	}	for (i=0;unit_tests[i].test;i++)	{		if (!CU_add_test(pSuite, unit_tests[i].name, unit_tests[i].test))		{			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:sba1,项目名称:simplemail,代码行数:33,



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


C++ CU_basic_set_mode函数代码示例
C++ CU_add_test函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。