本文整理汇总了C++中CU_add_suite函数的典型用法代码示例。如果您正苦于以下问题:C++ CU_add_suite函数的具体用法?C++ CU_add_suite怎么用?C++ CU_add_suite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CU_add_suite函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: add_lattice2d_suite
void add_lattice2d_suite() {
CU_pSuite lattice2d_suite = NULL;
lattice2d_suite = CU_add_suite("2D-lattice Suite",NULL,NULL);
CU_add_test(
lattice2d_suite, "Create 2x2 n=3 lattice",
test_create_2x2_n3_lattice);
CU_add_test(
lattice2d_suite, "norm 2x2 n=2 lat",test_norm_2x2_n2_lat);
CU_add_test(
lattice2d_suite, "norm 3x3 n=4 lat",test_norm_3x3_n4_lat);
}
开发者ID:Ununquadium,项目名称:cluster,代码行数:11,代码来源:suite_lattice2d.c
示例2: register_suite_property
void register_suite_property(void)
{
CU_Suite * suite;
suite = CU_add_suite("property", NULL, NULL);
CU_add_test(suite, "list init", test_list_init);
CU_add_test(suite, "list free", test_list_free);
CU_add_test(suite, "list append", test_list_append);
CU_add_test(suite, "list set", test_list_set);
CU_add_test(suite, "list contains", test_list_contains);
CU_add_test(suite, "list value", test_list_value);
CU_add_test(suite, "list find", test_list_find);
}
开发者ID:mariokonrad,项目名称:navd,代码行数:12,代码来源:test_property.c
示例3: add_tests
void add_tests(void)
{
assert(NULL != CU_get_registry());
assert(!CU_is_test_running());
CU_pSuite pSuite;
pSuite = CU_add_suite("suite_success_both", suite_success_init, suite_success_clean);
CU_add_test(pSuite, "testSuccess1", testSuccess1);
CU_add_test(pSuite, "testSuccess2", testSuccess2);
CU_add_test(pSuite, "testSuccess3", testSuccess3);
}
开发者ID:foxostro,项目名称:GrimWaffle_old,代码行数:12,代码来源:test.c
示例4: migration_add_suite
void migration_add_suite(void)
{
size_t i = 0;
CU_pSuite suite;
suite = CU_add_suite("Migration Handling", NULL, NULL);
while (migration_tests[i].pName) {
CU_add_test(suite, migration_tests[i].pName,
migration_tests[i].pTestFunc);
i++;
}
}
开发者ID:thentenaar,项目名称:mmm,代码行数:12,代码来源:migration.c
示例5: utils_add_suite
void utils_add_suite(void)
{
size_t i = 0;
CU_pSuite suite;
suite = CU_add_suite("Utils", NULL, NULL);
while (utils_tests[i].pName) {
CU_add_test(suite, utils_tests[i].pName,
utils_tests[i].pTestFunc);
i++;
}
}
开发者ID:thentenaar,项目名称:mmm,代码行数:12,代码来源:utils.c
示例6: misc_suite_setup
void misc_suite_setup(void)
{
CU_pSuite suite = CU_add_suite("miscellaneous", NULL, NULL);
PG_ADD_TEST(suite, test_misc_force_2d);
PG_ADD_TEST(suite, test_misc_simplify);
PG_ADD_TEST(suite, test_misc_count_vertices);
PG_ADD_TEST(suite, test_misc_area);
PG_ADD_TEST(suite, test_misc_wkb);
PG_ADD_TEST(suite, test_grid);
PG_ADD_TEST(suite, test_clone);
PG_ADD_TEST(suite, test_lwmpoint_from_lwgeom);
}
开发者ID:gbroccolo,项目名称:postgis,代码行数:12,代码来源:cu_misc.c
示例7: stringbuf_add_suite
void stringbuf_add_suite(void)
{
size_t i = 0;
CU_pSuite suite;
suite = CU_add_suite("String Buffer", NULL, NULL);
while (stringbuf_tests[i].pName) {
CU_add_test(suite, stringbuf_tests[i].pName,
stringbuf_tests[i].pTestFunc);
i++;
}
}
开发者ID:thentenaar,项目名称:mmm,代码行数:12,代码来源:stringbuf.c
示例8: initialize_runtime_suite
CU_pSuite initialize_runtime_suite(void)
{
CU_pSuite pSuite = CU_add_suite("runtime", NULL, NULL);
if (pSuite == NULL) {
return NULL;
}
ADD_TEST(test_creation);
ADD_TEST(test_bootstrap);
return pSuite;
}
开发者ID:smashwilson,项目名称:segment,代码行数:12,代码来源:runtime_tests.c
示例9: run_unit_tests
int run_unit_tests()
{
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("File Scanning", NULL, NULL);
if (NULL == pSuite) {
CU_cleanup_registry();
return CU_get_error();
}
#ifdef SUPER
// ms_set_log_level(DEBUG);
// av_log_set_level(AV_LOG_DEBUG);
/* add the tests to the ms_scan suite */
if (
NULL == CU_add_test(pSuite, "Simple test of ms_scan()", test_ms_scan) ||
NULL == CU_add_test(pSuite, "Test ms_scan() with no paths", test_ms_scan_2) ||
NULL == CU_add_test(pSuite, "Test of ms_scan() with too many paths", test_ms_scan_3) ||
NULL == CU_add_test(pSuite, "Test of ms_scan() with a bad directory", test_ms_scan_4) ||
// TODO: The following test fails due to the scanner freezing up.
// NULL == CU_add_test(pSuite, "Test of ms_scan() with strange path slashes", test_ms_scan_5) ||
NULL == CU_add_test(pSuite, "Test of ms_scan()'s progress notifications", test_ms_scan_6) ||
NULL == CU_add_test(pSuite, "Test of ms_file_scan()", test_ms_file_scan_1) ||
//NULL == CU_add_test(pSuite, "Test of scanning LOTS of files", test_ms_large_directory) ||
NULL == CU_add_test(pSuite, "Test of misc functions", test_ms_misc_functions) ||
NULL == CU_add_test(pSuite, "Simple test of ASF audio file", test_ms_file_asf_audio) ||
NULL == CU_add_test(pSuite, "Test Berkeley database functionality", test_ms_db)
)
{
CU_cleanup_registry();
return CU_get_error();
}
#endif
// setupbackground_tests();
setupdefect_tests();
// setupimage_tests();
// setup_thumbnail_tests();
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
// CU_automated_run_tests();
CU_cleanup_registry();
return CU_get_error();
} /* run_unit_tests() */
开发者ID:chincheta0815,项目名称:libmediascan,代码行数:53,代码来源:test.c
示例10: main
int main(int argc, char **argv) {
if (argc == 2 && (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0)) {
fprintf(stderr, "usage %s [test prefix]\n\ntest options:\n", argv[0]);
for (test_case_t *p = test_cases; p != NULL; p = p->next) {
fprintf(stderr, " %s\n", p->description);
}
return EXIT_FAILURE;
}
if (CU_initialize_registry() != CUE_SUCCESS) {
CU_ErrorCode err = CU_get_error();
fprintf(stderr, "failed to initialise CUnit registry\n");
return err;
}
CU_pSuite suite = CU_add_suite("passwand", NULL, NULL);
if (suite == NULL) {
CU_ErrorCode err = CU_get_error();
CU_cleanup_registry();
fprintf(stderr, "failed to add suite\n");
return err;
}
unsigned total = 0;
for (test_case_t *p = test_cases; p != NULL; p = p->next) {
if (argc == 1 || strncmp(argv[1], p->description, strlen(argv[1])) == 0) {
if (CU_add_test(suite, p->description, p->function) == NULL) {
CU_ErrorCode err = CU_get_error();
fprintf(stderr, "failed to add test \"%s\"\n", p->description);
CU_cleanup_registry();
return err;
}
total++;
}
}
if (total == 0) {
fprintf(stderr, "no tests found\n");
return EXIT_FAILURE;
}
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
unsigned failed = CU_get_number_of_tests_failed();
CU_cleanup_registry();
printf("%u/%u passed\n", total - failed, total);
return failed > 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
开发者ID:Smattr,项目名称:passwand,代码行数:53,代码来源:main.c
示例11: main
int main(void) {
CU_pSuite pSuite1 = NULL;
/* Initialize CUnit test registry */
if(CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* add suite to the registry */
pSuite1 = CU_add_suite("Suite 1", init_suite, clean_suite);
if(NULL == pSuite1) {
CU_cleanup_registry();
return CU_get_error();
}
/* add tests to suite */
if(NULL == CU_add_test(pSuite1, "Test case 1", testCase1)
// || NULL == CU_add_test(pSuite1, ...[next test case]...)
) {
CU_cleanup_registry();
return CU_get_error();
}
if(NULL == CU_add_test(pSuite1, "Test case 2", testCase2)
// || NULL == CU_add_test(pSuite1, ...[next test case]...)
) {
CU_cleanup_registry();
return CU_get_error();
}
if(NULL == CU_add_test(pSuite1, "Test case 3", testCase3)
// || NULL == CU_add_test(pSuite1, ...[next test case]...)
) {
CU_cleanup_registry();
return CU_get_error();
}
if(NULL == CU_add_test(pSuite1, "Test case 4", testCase4)
// || NULL == CU_add_test(pSuite1, ...[next test case]...)
) {
CU_cleanup_registry();
return CU_get_error();
}
if(NULL == CU_add_test(pSuite1, "Test case 5", testCase5)
// || NULL == CU_add_test(pSuite1, ...[next test case]...)
) {
CU_cleanup_registry();
return CU_get_error();
}
/* Run all tests using console interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
}
开发者ID:nellysek,项目名称:moto,代码行数:53,代码来源:test_proto.c
示例12: TMR_Unit_Test_Handler
GOS_ERROR_CODE TMR_Unit_Test_Handler(VOS_APPL_UNIT_TEST_T *ut)
{
int i = 0;
CU_pSuite pSuite = NULL;
// show all the test suites
if (0 == ut->id)
{
printf("\r\n");
while(i < sizeof(tmr_suites)/sizeof(CU_SuiteInfo))
{
if (CU_INVALID_SUITE != tmr_suites[i].id)
printf("%d:\t%s\r\n", tmr_suites[i].id, tmr_suites[i].pName);
i++;
}
return GOS_OK;
}
if(CU_initialize_registry()){
fprintf(stderr, " Initialization of Test Registry failed. ");
return GOS_ERR_NOT_INIT;
}else{
/**//* shortcut regitry */
if(CU_ALL_TEST == ut->id)
{
if(CUE_SUCCESS != CU_register_suites(&tmr_suites[0])){
fprintf(stderr, "Register suites failed - %s ", CU_get_error_msg());
return GOS_ERR_NOT_INIT;
}
}
else
{
int j = ut->id - 1;
if ((ut->id < 1) || (ut->id >= sizeof(tmr_suites)/sizeof(CU_SuiteInfo)))
{
return GOS_ERR_NOTSUPPORT;
}
pSuite = CU_add_suite(tmr_suites[j].pName,
tmr_suites[j].pInitFunc,
tmr_suites[j].pCleanupFunc);
for (i = 0; NULL != tmr_suites[ut->id-1].pTests[i].pName; i++)
{
CU_add_test(pSuite,
tmr_suites[j].pTests[i].pName,
tmr_suites[j].pTests[i].pTestFunc) ;
}
}
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
}
return GOS_OK;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:53,代码来源:ut_tmr_main.c
示例13: adicionar_suite
void adicionar_suite(void){
CU_pSuite suite;
suite = CU_add_suite("Testes",NULL,NULL);
CU_ADD_TEST(suite, teste_cria_tela);
CU_ADD_TEST(suite, teste_mostra_tela);
CU_ADD_TEST(suite, teste_mostra_tela_inicial);
CU_ADD_TEST(suite, teste_mostra_tela_final);
CU_ADD_TEST(suite, teste_mostra_tela_placar);
}
开发者ID:gerudoking,项目名称:lery-tetris,代码行数:12,代码来源:Tela_Teste.c
示例14: test_main
static void
test_main(spdk_event_t event)
{
CU_pSuite suite = NULL;
unsigned int num_failures;
if (bdevio_construct_targets() < 0) {
spdk_app_stop(-1);
return;
}
if (CU_initialize_registry() != CUE_SUCCESS) {
spdk_app_stop(CU_get_error());
return;
}
suite = CU_add_suite("components_suite", NULL, NULL);
if (suite == NULL) {
CU_cleanup_registry();
spdk_app_stop(CU_get_error());
return;
}
if (
CU_add_test(suite, "blockdev write read 4k", blockdev_write_read_4k) == NULL
|| CU_add_test(suite, "blockdev write read 512 bytes",
blockdev_write_read_512Bytes) == NULL
|| CU_add_test(suite, "blockdev write read size > 128k",
blockdev_write_read_size_gt_128k) == NULL
|| CU_add_test(suite, "blockdev write read invalid size",
blockdev_write_read_invalid_size) == NULL
|| CU_add_test(suite, "blockdev write read offset + nbytes == size of blockdev",
blockdev_write_read_offset_plus_nbytes_equals_bdev_size) == NULL
|| CU_add_test(suite, "blockdev write read offset + nbytes > size of blockdev",
blockdev_write_read_offset_plus_nbytes_gt_bdev_size) == NULL
|| CU_add_test(suite, "blockdev write read max offset",
blockdev_write_read_max_offset) == NULL
|| CU_add_test(suite, "blockdev write read 8k on overlapped address offset",
blockdev_overlapped_write_read_8k) == NULL
) {
CU_cleanup_registry();
spdk_app_stop(CU_get_error());
return;
}
pthread_mutex_init(&g_test_mutex, NULL);
pthread_cond_init(&g_test_cond, NULL);
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
num_failures = CU_get_number_of_failures();
CU_cleanup_registry();
spdk_app_stop(num_failures);
}
开发者ID:weber-wenbo-wang,项目名称:spdk,代码行数:53,代码来源:bdevio.c
示例15: AddBasicSuite
/*------------------------------------------------------------*
* Test Function implementation for hash calculation *
*------------------------------------------------------------*/
int32_t AddBasicSuite()
{
CU_pSuite pSuite = CU_add_suite("Hash Value Calculation", NULL, NULL);
if (!pSuite)
return ERR_REG;
CU_pTest pTest = CU_add_test(pSuite, "MurMur hash V3", TestMurMur32);
if (!pTest)
return ERR_REG;
return SUCC;
}
开发者ID:Masshat,项目名称:C-Common-Data-Structures,代码行数:15,代码来源:unit_hash.c
示例16: buildarea_suite_setup
void buildarea_suite_setup(void)
{
CU_pSuite suite = CU_add_suite("buildarea", NULL, NULL);
PG_ADD_TEST(suite,buildarea1);
PG_ADD_TEST(suite,buildarea2);
PG_ADD_TEST(suite,buildarea3);
PG_ADD_TEST(suite,buildarea4);
PG_ADD_TEST(suite,buildarea4b);
PG_ADD_TEST(suite,buildarea5);
PG_ADD_TEST(suite,buildarea6);
PG_ADD_TEST(suite,buildarea7);
}
开发者ID:NianYue,项目名称:pipelinedb,代码行数:12,代码来源:cu_buildarea.c
示例17: main
/* Função principal para estabelecer e rodar os testes, retornando CUE_SUCCESS em caso de sucesso e outro 'CUnit error code' caso contrário. */
int main(){
CU_pSuite pSuite_Pilha = NULL;
CU_pSuite pSuite_File = NULL;
printf("\033[2J");
printf("\033[1;1f");
/* Inicializa o registro de testes CUnit. */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* Inclui uma suíte ao registro. */
pSuite_Pilha = CU_add_suite("Suite_Pilha", init_suite1, clean_suite1);
if (NULL == pSuite_Pilha) {
CU_cleanup_registry();
return CU_get_error();
}/*if*/
pSuite_File = CU_add_suite("Suite_File", init_suite2, clean_suite2);
if (NULL == pSuite_File) {
CU_cleanup_registry();
return CU_get_error();
}/*if*/
/* Adiciona os testes às suítes. */
if ( (NULL==CU_add_test(pSuite_File, "teste de criarNovoArquivo(void)",testaAberturaArq)) ||
(NULL == CU_add_test(pSuite_File, "teste de leitura(char *nomearq)", testaLEITURA)) ||
(NULL==CU_add_test(pSuite_File, "teste de EditarExpr(char *nomearq)",testaEDICAO)) )
{
CU_cleanup_registry();
return CU_get_error();
}/*if*/
/* Roda todos os teste usando o 'CUnit Basic interface'. */
CU_basic_set_mode(CU_BRM_VERBOSE);
(void) CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
}
开发者ID:ingridsl,项目名称:calculadora_polonesa_inversa,代码行数:41,代码来源:testa_calculadora.c
示例18: main
int main()
{
CU_pSuite pSuite = NULL;
/* Init CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* Add suite to the registry */
pSuite = CU_add_suite("yee_common", init_testsuite1, clean_testsuite1);
if (!pSuite) {
CU_cleanup_registry();
return CU_get_error();
}
/* Add the tests to the suite */
if (!CU_add_test(pSuite, "py_alloc_field", test_alloc_field)
|| !CU_add_test(pSuite, "py_set_grid", test_set_grid)
|| !CU_add_test(pSuite, "py_vec_func", test_vec_func)
|| !CU_add_test(pSuite, "py_vec_func2d", test_vec_func2d)
|| !CU_add_test(pSuite, "py_apply_func", test_apply_func)
|| !CU_add_test(pSuite, "py_init_acoustic_field",
test_init_acoustic_field)
|| !CU_add_test(pSuite, "py_init_local_acoustic_field",
test_init_local_acoustic_field)
|| !CU_add_test(pSuite, "py_assign_to, get_from",
test_assign_and_get)
|| !CU_add_test(pSuite, "py_set_boundary", test_set_boundary)
|| !CU_add_test(pSuite, "py_leapfrog", test_leapfrog)
|| !CU_add_test(pSuite, "py_partition_grid", test_partition_grid)
|| !CU_add_test(pSuite, "py_get_partition_coords",
test_get_partition_coords)
/*|| !CU_add_test(pSuite, "py_expand_indices", test_expand_indices) */
/*|| !CU_add_test(pSuite, "py_verify_grid_integrity", test_verify_grid) */
/*|| !CU_add_test(pSuite, "py_set_local_index", test_set_local_index) */
|| !CU_add_test(pSuite, "py_parse_cmdline", test_parse_cmdline)
|| !CU_add_test(pSuite, "py_zero", test_zero)
|| !CU_add_test(pSuite, "py_zero2d", test_zero2d)
|| !CU_add_test(pSuite, "py_identity", test_identity)
|| !CU_add_test(pSuite, "py_identity2d", test_identity)
|| !CU_add_test(pSuite, "py_round_up_divide",
test_round_up_divide)) {
CU_cleanup_registry();
return CU_get_error();
}
/* Run all the 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:octol,项目名称:paryee,代码行数:52,代码来源:yee_common_tests.c
示例19: main
/*
* Main
*/
int
main(void)
{
CU_pSuite ptr_suite = NULL;
int nr_of_failed_tests = 0;
int nr_of_failed_suites = 0;
/* Initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/* add a suite to the registry */
ptr_suite = CU_add_suite("ofp port config", init_suite, clean_suite);
if (NULL == ptr_suite) {
CU_cleanup_registry();
return CU_get_error();
}
if (NULL == CU_ADD_TEST(ptr_suite,
test_sinlge_port_basic)) {
CU_cleanup_registry();
return CU_get_error();
}
if (NULL == CU_ADD_TEST(ptr_suite,
test_two_ports_vlan)) {
CU_cleanup_registry();
return CU_get_error();
}
if (NULL == CU_ADD_TEST(ptr_suite,
test_gre_port)) {
CU_cleanup_registry();
return CU_get_error();
}
#if OFP_TESTMODE_AUTO
CU_set_output_filename("CUnit-Port-conf");
CU_automated_run_tests();
#else
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
#endif
nr_of_failed_tests = CU_get_number_of_tests_failed();
nr_of_failed_suites = CU_get_number_of_suites_failed();
CU_cleanup_registry();
return (nr_of_failed_suites > 0 ?
nr_of_failed_suites : nr_of_failed_tests);
}
开发者ID:babubalu,项目名称:ofp,代码行数:55,代码来源:ofp_test_port_conf.c
示例20: bc_tester_run_suite
int bc_tester_run_suite(test_suite_t *suite) {
int i;
CU_pSuite pSuite = CU_add_suite(suite->name, suite->before_all, suite->after_all);
for (i = 0; i < suite->nb_tests; i++) {
if (NULL == CU_add_test(pSuite, suite->tests[i].name, suite->tests[i].func)) {
return CU_get_error();
}
}
return 0;
}
开发者ID:kevinlovesing,项目名称:linphone,代码行数:13,代码来源:bc_tester_utils.c
注:本文中的CU_add_suite函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论