本文整理汇总了C++中CU_add_suite函数的典型用法代码示例。如果您正苦于以下问题:C++ CU_add_suite函数的具体用法?C++ CU_add_suite怎么用?C++ CU_add_suite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CU_add_suite函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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);
}
示例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++;
}
}
示例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++;
}
}
示例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);
}
示例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++;
}
}
示例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;
}
示例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() */
示例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;
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}