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("nvme_ctrlr_cmd", NULL, NULL); if (suite == NULL) { CU_cleanup_registry(); return CU_get_error(); } if ( CU_add_test(suite, "test ctrlr cmd get_firmware_page", test_firmware_get_log_page) == NULL || CU_add_test(suite, "test ctrlr cmd get_health_page", test_health_get_log_page) == NULL || CU_add_test(suite, "test ctrlr cmd get_error_page", test_error_get_log_page) == NULL || CU_add_test(suite, "test ctrlr cmd set_feature", test_set_feature_cmd) == NULL || CU_add_test(suite, "test ctrlr cmd get_feature", test_get_feature_cmd) == NULL || CU_add_test(suite, "test ctrlr cmd abort_cmd", test_abort_cmd) == NULL || CU_add_test(suite, "test ctrlr cmd io_raw_cmd", test_io_raw_cmd) == 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; }
/** Handler function called at completion of all tests in a suite. * @param pFailure Pointer to the test failure record list. */ static void curses_all_tests_complete_message_handler(const CU_pFailureRecord pFailure) { /* Not used in curses implementation - quiet compiler warning */ CU_UNREFERENCED_PARAMETER(pFailure); f_pCurrentTest = NULL; f_pCurrentSuite = NULL; if (!create_pad(&details_pad, application_windows.pDetailsWin, 16 , 256)) { return; } mvwprintw(details_pad.pPad, 0, 0, "%s", "====== Suite Run Summary ======"); mvwprintw(details_pad.pPad, 1, 0, " TOTAL SUITES: %4u", f_uiTotalSuites); mvwprintw(details_pad.pPad, 2, 0, " Run: %4u", f_uiTotalSuites - f_uiSuitesSkipped); mvwprintw(details_pad.pPad, 3, 0, " Skipped: %4u", f_uiSuitesSkipped); mvwprintw(details_pad.pPad, 5, 0, "%s", "====== Test Run Summary ======="); mvwprintw(details_pad.pPad, 6, 0, " TOTAL TESTS: %4u", f_uiTotalTests); mvwprintw(details_pad.pPad, 7, 0, " Run: %4u", f_uiTestsRun); mvwprintw(details_pad.pPad, 8, 0, " Skipped: %4u", f_uiTestsSkipped); mvwprintw(details_pad.pPad, 9, 0, " Successful: %4u", f_uiTestsRunSuccessful); mvwprintw(details_pad.pPad, 10, 0, " Failed: %4u", f_uiTestsFailed); mvwprintw(details_pad.pPad, 12, 0, "%s", "====== Assertion Summary ======"); mvwprintw(details_pad.pPad, 13, 0, " TOTAL ASSERTS: %4u", CU_get_number_of_asserts()); mvwprintw(details_pad.pPad, 14, 0, " Passed: %4u", CU_get_number_of_successes()); mvwprintw(details_pad.pPad, 15, 0, " Failed: %4u", CU_get_number_of_failures()); refresh_details_window(); refresh_run_summary_window(); }
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; }
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, "nvmf_process_discovery_command", test_nvmf_process_discovery_cmd) == NULL || CU_add_test(suite, "nvmf_process_fabrics_command", test_nvmf_process_fabrics_cmd) == 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; }
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; }
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("ejdbtest1", 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, "testTicket53", testTicket53)) || (NULL == CU_add_test(pSuite, "testBSONExportImport", testBSONExportImport)) || (NULL == CU_add_test(pSuite, "testBSONExportImport2", testBSONExportImport2)) || (NULL == CU_add_test(pSuite, "testTicket135", testTicket135)) ) { 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; }
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; }
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; }
int main( 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 */ } /* logging system initialized */ return exitCode; }
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; }
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; }
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("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; }
void linphone_core_manager_destroy(LinphoneCoreManager* mgr) { if (mgr->stat.last_received_chat_message) { linphone_chat_message_unref(mgr->stat.last_received_chat_message); } if (mgr->stat.last_received_info_message) linphone_info_message_destroy(mgr->stat.last_received_info_message); if (mgr->lc){ const char *record_file=linphone_core_get_record_file(mgr->lc); int unterminated_calls; if (!liblinphone_tester_keep_record_files && record_file){ if ((CU_get_number_of_failures()-mgr->number_of_cunit_error_at_creation)>0) { ms_message ("Test has failed, keeping recorded file [%s]",record_file); } else { unlink(record_file); } } BC_ASSERT_EQUAL((unterminated_calls=ms_list_size(mgr->lc->calls)), 0, int, "%i"); if (unterminated_calls != 0) { ms_error("There are still %d calls pending, please terminates them before invoking linphone_core_manager_destroy().", unterminated_calls); } linphone_core_destroy(mgr->lc); } if (mgr->identity) { linphone_address_destroy(mgr->identity); } manager_count--; ms_free(mgr); }
int main( 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 (log_init(argv[0])) { (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; }
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); }
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("nvme_ns_cmd", NULL, NULL); if (suite == NULL) { CU_cleanup_registry(); return CU_get_error(); } if ( CU_add_test(suite, "split_test", split_test) == NULL || CU_add_test(suite, "split_test2", split_test2) == NULL || CU_add_test(suite, "split_test3", split_test3) == NULL || CU_add_test(suite, "split_test4", split_test4) == NULL || CU_add_test(suite, "nvme_ns_cmd_flush testing", test_nvme_ns_cmd_flush) == NULL || CU_add_test(suite, "nvme_ns_cmd_deallocate testing", test_nvme_ns_cmd_deallocate) == 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; }
int main(int argc, char *argv[]) { CU_pSuite simpleS = NULL; CU_pSuite complexS = NULL; if (CUE_SUCCESS != CU_initialize_registry()) { return CU_get_error(); } simpleS = CU_add_suite("simple_tests", init_suite, clean_suite); complexS = CU_add_suite("complex_tests", init_suite, clean_suite); if (NULL == simpleS || NULL == complexS){ CU_cleanup_registry(); return CU_get_error(); } if ( //Simple NULL == CU_ADD_TEST(simpleS, s_test_create_tree_fail) || NULL == CU_ADD_TEST(simpleS, s_test_create_tree_succ) || NULL == CU_ADD_TEST(simpleS, s_test_ins_tree_height) || NULL == CU_ADD_TEST(simpleS, s_test_tree_balance) || NULL == CU_ADD_TEST(simpleS, s_test_tree_search) || NULL == CU_ADD_TEST(simpleS, s_test_tree_delete) || NULL == CU_ADD_TEST(simpleS, s_test_tree_insert_delete) || //Complex NULL == CU_ADD_TEST(complexS, c_test_create_tree_succ) || NULL == CU_ADD_TEST(complexS, c_test_ins_tree_height) || NULL == CU_ADD_TEST(complexS, c_test_tree_balance) || NULL == CU_ADD_TEST(complexS, c_test_tree_search) || NULL == CU_ADD_TEST(complexS, c_test_tree_delete) || NULL == CU_ADD_TEST(complexS, c_test_tree_insert_delete) || NULL == CU_ADD_TEST(complexS, c_test_ins_tree_equal) ) { CU_cleanup_registry(); return CU_get_error(); } CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); int failures = CU_get_number_of_failures(); CU_cleanup_registry(); assert(failures == 0); return EXIT_SUCCESS; }
//-------------------------------------------------------------------------------------------------- static void test(void* context) { // Init the test case / test suite data structures CU_TestInfo smstest[] = { { "Test le_sms_SetGetSmsCenterAddress()", Testle_sms_SetGetSmsCenterAddress }, { "Test le_sms_SetGetText()", Testle_sms_SetGetText }, { "Test le_sms_SetGetBinary()", Testle_sms_SetGetBinary }, { "Test le_sms_SetGetPDU()", Testle_sms_SetGetPDU }, { "Test le_sms_ReceivedList()", Testle_sms_ReceivedList }, { "Test le_sms_SendBinary()", Testle_sms_SendBinary }, { "Test le_sms_SendText()", Testle_sms_SendText }, #if 0 { "Test le_sms_SendPdu()", Testle_sms_SendPdu }, #endif CU_TEST_INFO_NULL, }; CU_SuiteInfo suites[] = { { "SMS tests", NULL, NULL, smstest }, CU_SUITE_INFO_NULL, }; fprintf(stderr, "Please ensure that there is enough space on SIM to receive new SMS messages!\n"); #ifndef AUTOMATIC GetTel(); #endif // Initialize the CUnit test registry and register the test suite if (CUE_SUCCESS != CU_initialize_registry()) exit(CU_get_error()); if ( CUE_SUCCESS != CU_register_suites(suites)) { CU_cleanup_registry(); exit(CU_get_error()); } CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); // Output summary of failures, if there were any if ( CU_get_number_of_failures() > 0 ) { fprintf(stdout,"\n [START]List of Failure :\n"); CU_basic_show_failures(CU_get_failure_list()); fprintf(stdout,"\n [STOP]List of Failure\n"); } }
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); }
//-------------------------------------------------------------------------------------------------- static void* test(void* context) { // Init the test case / test suite data structures CU_TestInfo audiotest[] = { { "Test pa_audio_EnableCodecInput()" , Test_pa_audio_EnableCodecInput }, { "Test pa_audio_DisableCodecInput()" , Test_pa_audio_DisableCodecInput }, { "Test pa_audio_EnableCodecOutput()" , Test_pa_audio_EnableCodecOutput }, { "Test pa_audio_DisableCodecOutput()" , Test_pa_audio_DisableCodecOutput }, { "Test pa_audio_SetDspAudioPath()" , Test_pa_audio_SetDspAudioPath }, { "Test pa_audio_ResetDspAudioPath()" , Test_pa_audio_ResetDspAudioPath }, { "Test pa_audio_SetGain()" , Test_pa_audio_SetGain }, { "Test pa_audio_GetGain()" , Test_pa_audio_GetGain }, { "Test pa_audio_StartPlayback()" , Test_pa_audio_StartPlayback }, { "Test pa_audio_StopPlayback()" , Test_pa_audio_StopPlayback }, { "Test pa_audio_StartCapture()" , Test_pa_audio_StartCapture }, { "Test pa_audio_StopCapture()" , Test_pa_audio_StopCapture }, CU_TEST_INFO_NULL, }; CU_SuiteInfo suites[] = { { "PA Audio tests", NULL, NULL, audiotest }, CU_SUITE_INFO_NULL, }; // Initialize the CUnit test registry and register the test suite if (CUE_SUCCESS != CU_initialize_registry()) exit(CU_get_error()); if ( CUE_SUCCESS != CU_register_suites(suites)) { CU_cleanup_registry(); exit(CU_get_error()); } CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); // Output summary of failures, if there were any if ( CU_get_number_of_failures() > 0 ) { fprintf(stdout,"\n [START]List of Failure :\n"); CU_basic_show_failures(CU_get_failure_list()); fprintf(stdout,"\n [STOP]List of Failure\n"); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); }
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("scsi_suite", null_init, null_clean); if (suite == NULL) { CU_cleanup_registry(); return CU_get_error(); } if ( CU_add_test(suite, "scsi init - set default scsi params", \ scsi_init_sp_null) == NULL || CU_add_test(suite, "scsi init - set max_unmap_lba_count", \ scsi_init_set_max_unmap_lba_count_config_param) == NULL || CU_add_test(suite, "scsi init - set max_unmap_block_descriptor_count", \ scsi_init_set_max_unmap_block_descriptor_count_config_param) == NULL || CU_add_test(suite, "scsi init - set optimal_unmap_granularity", \ scsi_init_set_optimal_unmap_granularity_config_param) == NULL || CU_add_test(suite, "scsi init - set unmap_granularity_alignment", \ scsi_init_set_unmap_granularity_alignment_config_param) == NULL || CU_add_test(suite, "scsi init - ugavalid value yes", \ scsi_init_ugavalid_yes) == NULL || CU_add_test(suite, "scsi init - ugavalid value no", \ scsi_init_ugavalid_no) == NULL || CU_add_test(suite, "scsi init - ugavalid unknown value", \ scsi_init_ugavalid_unknown_value_failure) == NULL || CU_add_test(suite, "scsi init - set max_write_same_length", \ scsi_init_max_write_same_length) == NULL || CU_add_test(suite, "scsi init - read config scsi parameters", \ scsi_init_read_config_scsi_params) == NULL || CU_add_test(suite, "scsi init - success", scsi_init_success) == 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; }
void linphone_core_manager_destroy(LinphoneCoreManager* mgr) { if (mgr->lc){ const char *record_file=linphone_core_get_record_file(mgr->lc); if (record_file){ if ((CU_get_number_of_failures()-mgr->number_of_cunit_error_at_creation)>0) { ms_message ("Test has failed, keeping recorded file [%s]",record_file); } else { unlink(record_file); } } linphone_core_destroy(mgr->lc); } if (mgr->identity) linphone_address_destroy(mgr->identity); if (mgr->stat.last_received_chat_message) linphone_chat_message_unref(mgr->stat.last_received_chat_message); manager_count--; ms_free(mgr); }
int main(int argc, char *argv[]) { CU_pSuite pSuite = NULL; size_t ii; test_case ALL_CASES[2]; unsigned int failures = 0; ALL_CASES[0].message = "helium_free(NULL) should be a no-op"; ALL_CASES[0].test = test_freeing_null; ALL_CASES[1].message = "alloc then free should have no footprint"; ALL_CASES[1].test = test_alloc_then_free; if (CUE_SUCCESS != CU_initialize_registry()) { return CU_get_error(); } /* add a suite to the registry */ pSuite = CU_add_suite("Suite_1", NULL, NULL); if (pSuite == NULL) { CU_cleanup_registry(); return CU_get_error(); } for (ii=0; ii < (sizeof(ALL_CASES) / sizeof(test_case)); ii++) { test_case tc = ALL_CASES[ii]; if (CU_add_test(pSuite, tc.message, tc.test) == NULL) { CU_cleanup_registry(); return CU_get_error(); } } /* add the tests to the suite */ /* Run all tests using the CUnit Basic interface */ CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); failures = CU_get_number_of_failures(); CU_cleanup_registry(); return (int)failures; }
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, "nvmf_test_init", nvmf_test_init) == NULL || CU_add_test(suite, "nvmf_test_create_subsystem", nvmf_test_create_subsystem) == NULL || CU_add_test(suite, "nvmf_test_find_subsystem", nvmf_test_find_subsystem) == NULL || CU_add_test(suite, "nvmf_test_create_session", nvmf_test_create_session) == NULL || CU_add_test(suite, "nvmf_test_find_session_by_id", nvmf_test_find_session_by_id) == NULL || CU_add_test(suite, "nvmf_test_delete_session", nvmf_test_delete_session) == NULL || CU_add_test(suite, "nvmf_test_connect", nvmf_test_connect) == NULL || CU_add_test(suite, "nvmf_test_process_io_cmd", nvmf_test_process_io_cmd) == NULL || CU_add_test(suite, "nvmf_test_process_admin_cmd", nvmf_test_process_admin_cmd) == NULL || CU_add_test(suite, "nvmf_test_property_get", nvmf_test_property_get) == NULL || CU_add_test(suite, "nvmf_test_property_set", nvmf_test_property_set) == NULL || CU_add_test(suite, "nvmf_test_check_admin_completions", nvmf_test_check_admin_completions) == NULL || CU_add_test(suite, "nvmf_test_check_io_completions", nvmf_test_check_io_completions) == NULL || CU_add_test(suite, "nvmf_test_disconnect", nvmf_test_disconnect) == NULL || CU_add_test(suite, "nvmf_test_delete_subsystem", nvmf_test_delete_subsystem) == NULL || CU_add_test(suite, "nvmf_test_shutdown", nvmf_test_shutdown) == 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; }
int main(int args, char** argv){ int return_code; //main to call all the other tests written in the oder files in this folder CU_pSuite bufs_suite = NULL; /* initialize the CUnit test registry */ if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error(); if((bufs_suite = CU_add_suite("Suite for pipeline pkt transversing tests\n", bufs_set_up, bufs_tear_down))==NULL){ CU_cleanup_registry(); return CU_get_error(); } if ((CU_add_test(bufs_suite,"No output action (drop)\n",bufs_no_output_action)==NULL) || (CU_add_test(bufs_suite,"Single output apply action\n",bufs_apply_output_action)==NULL) || (CU_add_test(bufs_suite,"Single output write action\n",bufs_write_output_action)==NULL) || (CU_add_test(bufs_suite,"Multiple output apply actions\n",bufs_multiple_apply_output_actions)==NULL) || (CU_add_test(bufs_suite,"Multiple output apply and write actions\n",bufs_multiple_apply_write_output_actions)==NULL) || (CU_add_test(bufs_suite,"Single output in a group in apply_actions (indirect)\n",bufs_single_output_action_group_apply)==NULL) || (CU_add_test(bufs_suite,"Single output in a group in write_actions (indirect)\n",bufs_single_output_action_group_write)==NULL) || (CU_add_test(bufs_suite,"Apply and group(indirect) single output\n",bufs_apply_and_group_output_actions)==NULL) || (CU_add_test(bufs_suite,"Write and group(indirect) single output\n",bufs_write_and_group_output_actions)==NULL) || (CU_add_test(bufs_suite,"Multiple outputs in a group(type ALL)\n", bufs_multiple_output_actions_group)==NULL) || (CU_add_test(bufs_suite,"No output action with goto\n", bufs_no_output_action_goto)==NULL) || (CU_add_test(bufs_suite,"Output action(apply) with goto in the second table\n", bufs_apply_output_action_last_table_goto)==NULL) || (CU_add_test(bufs_suite,"Output action(apply) on both tables\n", bufs_apply_output_action_both_tables_goto)==NULL) || (CU_add_test(bufs_suite,"Two output actions (apply) on first able, one in the second table\n", bufs_apply_output_action_both_tables_goto)==NULL) || (CU_add_test(bufs_suite,"Output (apply) o first table, output action on an indirect group in second table\n",bufs_output_first_table_output_on_group_second_table)==NULL) || (CU_add_test(bufs_suite,"Output on apply and group on first table, output on apply, group and write actions(output and group again) on the second table (write set on the first table)\n",bufs_output_all)==NULL) ){ fprintf(stderr,"ERROR WHILE ADDING TEST\n"); 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(); return_code = CU_get_number_of_failures(); CU_cleanup_registry(); return return_code; }
int main(int argc, char** argv) { if (CU_initialize_registry() != CUE_SUCCESS) { return CU_get_error(); } // Add new test suites here test_helper_suite(); test_url_suite(); CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); int failure_count = CU_get_number_of_failures(); CU_cleanup_registry(); int cuerr = CU_get_error(); return (cuerr != 0) ? cuerr : (failure_count > 0); }
//-------------------------------------------------------------------------------------------------- static void* test(void* context) { // Init the test case / test suite data structures CU_TestInfo simtestInteractive[] = { { "Test Interactive le_sim_Authentication()", TestInteractivele_sim_Authentication }, { "Test le_sim_Create()", Testle_sim_Create }, { "Test le_sim_States()", Testle_sim_States }, CU_TEST_INFO_NULL, }; CU_SuiteInfo suites[] = { { "SIM tests Interactive", NULL, NULL, simtestInteractive }, CU_SUITE_INFO_NULL, }; // Initialize the CUnit test registry and register the test suite if (CUE_SUCCESS != CU_initialize_registry()) exit(CU_get_error()); if ( CUE_SUCCESS != CU_register_suites(suites)) { CU_cleanup_registry(); exit(CU_get_error()); } CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); // Output summary of failures, if there were any if ( CU_get_number_of_failures() > 0 ) { fprintf(stdout,"\n [START]List of Failure :\n"); CU_basic_show_failures(CU_get_failure_list()); fprintf(stdout,"\n [STOP]List of Failure\n"); } le_event_RunLoop(); }
int main(int argc, char const *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("list_t *", init_suite, clean_suite); if (NULL == pSuite) { CU_cleanup_registry(); return CU_get_error(); } if ((NULL == CU_add_test(pSuite, "test of list_create and list_free", testCREATEFREE)) || (NULL == CU_add_test(pSuite, "test that new list is empty", testCREATEEMPTY)) || (NULL == CU_add_test(pSuite, "test list_len function", testLENGTH)) || (NULL == CU_add_test(pSuite, "test list_nth function", testNTH)) || (NULL == CU_add_test(pSuite, "test list_has function", testLISTHAS)) || (NULL == CU_add_test(pSuite, "test getting first element", testITER_GET)) || (NULL == CU_add_test(pSuite, "test list iteration", testITERATION))) { 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 failures = CU_get_number_of_failures(); CU_cleanup_registry(); assert(failures == 0); return EXIT_SUCCESS; }
int main(int argc, char const *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("graph_t *", init_suite, clean_suite); if (NULL == pSuite) { CU_cleanup_registry(); return CU_get_error(); } if ((NULL == CU_add_test(pSuite, "test of graph_create and graph_free", testCREATEFREE)) || (NULL == CU_add_test(pSuite, "test of graph_add_edge", testADDEDGE)) || (NULL == CU_add_test(pSuite, "test of graph_has_node", testHASNODE)) || (NULL == CU_add_test(pSuite, "test of graph_find_neighbors", testFINDNEIGHBORS)) || (NULL == CU_add_test(pSuite, "test of graph_find_path", testFINDPATH)) || (NULL == CU_add_test(pSuite, "test of edge labels", testEDGELABELS))) { 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 failures = CU_get_number_of_failures(); CU_cleanup_registry(); assert(failures == 0); return EXIT_SUCCESS; }
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("json", NULL, NULL); if (suite == NULL) { CU_cleanup_registry(); return CU_get_error(); } if ( CU_add_test(suite, "write_literal", test_write_literal) == NULL || CU_add_test(suite, "write_string_simple", test_write_string_simple) == NULL || CU_add_test(suite, "write_string_escapes", test_write_string_escapes) == NULL || CU_add_test(suite, "write_number_int32", test_write_number_int32) == NULL || CU_add_test(suite, "write_number_uint32", test_write_number_uint32) == NULL || CU_add_test(suite, "write_array", test_write_array) == NULL || CU_add_test(suite, "write_object", test_write_object) == NULL || CU_add_test(suite, "write_nesting", test_write_nesting) == NULL || CU_add_test(suite, "write_val", test_write_val) == 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; }