本文整理汇总了C++中CU_cleanup_registry函数的典型用法代码示例。如果您正苦于以下问题:C++ CU_cleanup_registry函数的具体用法?C++ CU_cleanup_registry怎么用?C++ CU_cleanup_registry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CU_cleanup_registry函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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() {
ks3_global_init();
int ret = load_ak_sk();
if (ret != 0) {
printf("[ERROR] load ak, sk failed\n");
return ret;
}
ret = CreateBucket(host, bucket);
if (ret != 0) {
printf("[ERROR] create bucket failed\n");
return ret;
}
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();
ks3_global_destroy();
return CU_get_error();
}
/* add the tests to the suite */
if (NULL == CU_add_test(pSuite, "test complete multipart para null\n", TEST_COMPLETE_MULTIPART_UPLOAD_ALL_NULL)
|| NULL == CU_add_test(pSuite, "test complete multipart para return code null\n", TEST_COMPLETE_MULTIPART_UPLOAD_RETURNCODE_NULL)
|| NULL == CU_add_test(pSuite, "test complete multipart para host\n", TEST_COMPLETE_MULTIPART_UPLOAD_HOST)
|| NULL == CU_add_test(pSuite, "test complete multipart para bucket\n", TEST_COMPLETE_MULTIPART_UPLOAD_BUCKET)
|| NULL == CU_add_test(pSuite, "test complete multipart para object\n", TEST_COMPLETE_MULTIPART_UPLOAD_OBJECT)
|| NULL == CU_add_test(pSuite, "test complete multipart para key\n", TEST_COMPLETE_MULTIPART_UPLOAD_KEY)
|| NULL == CU_add_test(pSuite, "test complete multipart para data buf\n", TEST_COMPLETE_MULTIPART_UPLOAD_BUFDATAPARA)
|| NULL == CU_add_test(pSuite, "test complete multipart para query\n", TEST_COMPLETE_MULTIPART_UPLOAD_QUERYPARA)
|| NULL == CU_add_test(pSuite, "test complete multipart para header\n", TEST_COMPLETE_MULTIPART_UPLOAD_HEADERPARA)) {
CU_cleanup_registry();
ks3_global_destroy();
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();
ret = DeleteBucket(host, bucket);
if (ret != 0) {
printf("[ERROR] delete bucket failed\n");
}
ks3_global_destroy();
return CU_get_error();
}
示例2: main
int main(int argc, char **argv) {
// use CUnit test framework
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("Header", NULL, NULL);
if(!pSuite) {
CU_cleanup_registry();
return CU_get_error();
}
// add the tests to the suite
if(!CU_add_test(pSuite, "First header byte construction", testHeaderFirstByteConstruction)) {
CU_cleanup_registry();
return CU_get_error();
}
if(!CU_add_test(pSuite, "Method codes", testMethodCodes)) {
CU_cleanup_registry();
return CU_get_error();
}
if(!CU_add_test(pSuite, "Message ID", testMessageID)) {
CU_cleanup_registry();
return CU_get_error();
}
if(!CU_add_test(pSuite, "Token insertion", testTokenInsertion)) {
CU_cleanup_registry();
return CU_get_error();
}
if(!CU_add_test(pSuite, "Option insertion", testOptionInsertion)) {
CU_cleanup_registry();
return CU_get_error();
}
if(!CU_add_test(pSuite, "URI setting", testURISetting)) {
CU_cleanup_registry();
return CU_get_error();
}
CU_pTest payloadTest = CU_add_test(pSuite, "Payload setting", testPayload);
if(!payloadTest) {
CU_cleanup_registry();
return CU_get_error();
}
// Run all tests using the CUnit Basic interface
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_set_error_action(CUEA_ABORT);
CU_basic_run_tests();
CU_cleanup_registry();
//optionInsertionTest();
return CU_get_error();
}
示例3: 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() */
示例4: 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);
}
示例5: main
int main(int argc, char *argv[]) {
CU_ErrorCode error;
/**
* Definizione dei test array
* NOTA ? L?ORDINE DI INSERIMENTO E? IMPORTANTE
*/
CU_TestInfo test_array_conta_parole_bis[] = { {
"test di conta_parole_bis()", test_conta_parole_bis },
CU_TEST_INFO_NULL, };
/**
* crea le suite e vi aggiunge i test array
* NOTA ? L?ORDINE DI INSERIMENTO E? IMPORTANTE
*/
CU_SuiteInfo suites[] = { { "test suite per conta_parole_bis ",
suite_void_init, suite_void_cleanup, test_array_conta_parole_bis },
CU_SUITE_INFO_NULL, };
/* inizializza registro ? e? la prima istruzione */
if (CUE_SUCCESS != CU_initialize_registry()) {
error = CU_get_error();
system("PAUSE");
return -1;
}
// add the suites to the registry
error = CU_register_suites(suites);
if (CUE_SUCCESS != error) {
CU_cleanup_registry();
error = CU_get_error();
system("PAUSE");
return -1;
}
/**
* Esegue tutti i casi di test con output sulla console
*/
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
/**
* Pulisce il registro e termina lo unit test
**/
CU_cleanup_registry();
//system("PAUSE");
return error;
}
示例6: 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;
}
示例7: 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);
}
示例8: 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();
}
示例9: us894_add_suite
/* The main() function for setting up and running the tests.
* Returns a CUE_SUCCESS on successful running, another
* CUnit error code on failure.
*/
int us894_add_suite (void)
{
#ifdef HAVE_CUNIT
CU_pSuite pSuite = NULL;
/* add a suite to the registry */
pSuite = CU_add_suite("us894_proxy_cacerts",
us894_init_suite,
us894_destroy_suite);
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, "HTTP Basic Auth", us894_test1)) ||
(NULL == CU_add_test(pSuite, "HTTP Basic Auth Fail", us894_test2)) ||
(NULL == CU_add_test(pSuite, "HTTP Digest Auth", us894_test3)) ||
(NULL == CU_add_test(pSuite, "HTTP Digest Auth Fail", us894_test4)) ||
(NULL == CU_add_test(pSuite, "Get CA Certificates", us894_test5)) ||
(NULL == CU_add_test(pSuite, "SSL 3.0 Fail", us894_test6)) ||
(NULL == CU_add_test(pSuite, "TLS 1.0 Fail", us894_test7)) ||
(NULL == CU_add_test(pSuite, "TLS 1.1", us894_test8)) ||
(NULL == CU_add_test(pSuite, "TLS 1.2", us894_test9)) ||
(NULL == CU_add_test(pSuite, "Certificate auth - explicit cert chain", us894_test10)) ||
(NULL == CU_add_test(pSuite, "Certificate auth - implicit cert chain", us894_test11)) ||
(NULL == CU_add_test(pSuite, "Certificate auth - revoked cert", us894_test12)) ||
(NULL == CU_add_test(pSuite, "Certificate auth - self-signed cert", us894_test13)) ||
(NULL == CU_add_test(pSuite, "Anon cipher suite disabled", us894_test14)) ||
(NULL == CU_add_test(pSuite, "NULL Realm", us894_test15)) ||
(NULL == CU_add_test(pSuite, "NULL server cert", us894_test16)) ||
(NULL == CU_add_test(pSuite, "NULL server key", us894_test17)) ||
(NULL == CU_add_test(pSuite, "NULL local CA chain", us894_test18)) ||
(NULL == CU_add_test(pSuite, "Corrupted local CA chain", us894_test19)) ||
(NULL == CU_add_test(pSuite, "HTTP POST cacerts", us894_test20)) ||
(NULL == CU_add_test(pSuite, "SimpleEnroll - good HTTP auth/good Cert", us894_test21)) ||
(NULL == CU_add_test(pSuite, "SimpleEnroll - bad HTTP auth/good Cert", us894_test22)) ||
(NULL == CU_add_test(pSuite, "SimpleEnroll - no HTTP auth/no Cert", us894_test23)) ||
(NULL == CU_add_test(pSuite, "Set Server Invalid parameters", us894_test24)) ||
(NULL == CU_add_test(pSuite, "Set Auth Mode Invalid parameters", us894_test25)) ||
(NULL == CU_add_test(pSuite, "Optional CA Chain Response", us894_test26)) ||
(NULL == CU_add_test(pSuite, "Bad userid/password for proxy init", us894_test27)))
{
CU_cleanup_registry();
return CU_get_error();
}
return CUE_SUCCESS;
#endif
}
示例10: main
int main() {
unsigned int result;
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("SCPI Utils", init_suite, clean_suite);
if (NULL == pSuite) {
CU_cleanup_registry();
return CU_get_error();
}
/* Add the tests to the suite */
if (0
|| (NULL == CU_add_test(pSuite, "strnpbrk", test_strnpbrk))
|| (NULL == CU_add_test(pSuite, "Int32ToStr", test_Int32ToStr))
|| (NULL == CU_add_test(pSuite, "UInt32ToStrBase", test_UInt32ToStrBase))
|| (NULL == CU_add_test(pSuite, "Int64ToStr", test_Int64ToStr))
|| (NULL == CU_add_test(pSuite, "UInt64ToStrBase", test_UInt64ToStrBase))
|| (NULL == CU_add_test(pSuite, "SCPI_dtostre", test_scpi_dtostre))
|| (NULL == CU_add_test(pSuite, "floatToStr", test_floatToStr))
|| (NULL == CU_add_test(pSuite, "doubleToStr", test_doubleToStr))
|| (NULL == CU_add_test(pSuite, "strBaseToInt32", test_strBaseToInt32))
|| (NULL == CU_add_test(pSuite, "strBaseToUInt32", test_strBaseToUInt32))
|| (NULL == CU_add_test(pSuite, "strBaseToInt64", test_strBaseToInt64))
|| (NULL == CU_add_test(pSuite, "strBaseToUInt64", test_strBaseToUInt64))
|| (NULL == CU_add_test(pSuite, "strToDouble", test_strToDouble))
|| (NULL == CU_add_test(pSuite, "compareStr", test_compareStr))
|| (NULL == CU_add_test(pSuite, "compareStrAndNum", test_compareStrAndNum))
|| (NULL == CU_add_test(pSuite, "matchPattern", test_matchPattern))
|| (NULL == CU_add_test(pSuite, "matchCommand", test_matchCommand))
|| (NULL == CU_add_test(pSuite, "composeCompoundCommand", test_composeCompoundCommand))
|| (NULL == CU_add_test(pSuite, "swap", test_swap))
#if USE_DEVICE_DEPENDENT_ERROR_INFORMATION && !USE_MEMORY_ALLOCATION_FREE
|| (NULL == CU_add_test(pSuite, "heap", test_heap))
#endif
) {
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();
result = CU_get_number_of_tests_failed();
CU_cleanup_registry();
return result ? result : CU_get_error();
}
示例11: test_string
CU_ErrorCode test_string(CU_pSuite suite){
suite = CU_add_suite("CryString Tests (test_string.c)", before_all_test_string, after_all_test_string);
if(suite == NULL){
CU_cleanup_registry();
return CU_get_error();
}
if( (CU_add_test(suite, "String's tests are not done yet!", test_missing_strings_tests ) == NULL ) ){
CU_cleanup_registry();
return CU_get_error();
}
return CUE_SUCCESS;
}
示例12: main
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("Suite1", 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, " 1: Requesting a single record in a compressed warc file", test1)) ||
(NULL == CU_add_test(pSuite, " 2: Requesting a whole warc file", test2)) ||
(NULL == CU_add_test(pSuite, " 3: sending a bad request", test3)) ||
(NULL == CU_add_test(pSuite," 4: sending a filter request", test4)) ||
(NULL == CU_add_test(pSuite," 5: sending a List request with severral output format", test5)))
{
CU_cleanup_registry();
return CU_get_error();
}
/* Run all tests using the automated interface*/
switch (menu())
{
case 1: {CU_console_run_tests(); break;}
case 2: {
case 21: {CU_basic_set_mode(CU_BRM_NORMAL); CU_basic_run_tests(); break;}
case 22:{CU_basic_set_mode(CU_BRM_VERBOSE ); CU_basic_run_tests(); break;}
case 23:{CU_basic_set_mode(CU_BRM_SILENT); CU_basic_run_tests(); break;}
}
case 3:{
CU_set_output_filename("./utest/outputs/client");
CU_set_output_filename("./utest/outputs/client" );
CU_automated_run_tests();
CU_list_tests_to_file();
break;}
}
CU_cleanup_registry();
return CU_get_error();
}
示例13: 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("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;
}
示例14: main
int
main(int argc, char **argv)
{
CU_pSuite pSuite = NULL;
putenv("LC_ALL=C");
putenv("LANG=C");
/* initialize the CUnit test registry */
if(CUE_SUCCESS != CU_initialize_registry()){
return CU_get_error();
}
/* remove a suite to the registry */
pSuite = CU_add_suite("AgsConnectableTest", ags_connectable_test_init_suite, ags_connectable_test_clean_suite);
if(pSuite == NULL){
CU_cleanup_registry();
return CU_get_error();
}
/* remove the tests to the suite */
if((CU_add_test(pSuite, "test of AgsConnectable get uuid", ags_connectable_test_get_uuid) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable has resource", ags_connectable_test_has_resource) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable is ready", ags_connectable_test_is_ready) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable add to registry", ags_connectable_test_add_to_registry) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable remove from registry", ags_connectable_test_remove_from_registry) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable list resource", ags_connectable_test_list_resource) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable xml compose", ags_connectable_test_xml_compose) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable xml parse", ags_connectable_test_xml_parse) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable is connected", ags_connectable_test_is_connected) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable connect", ags_connectable_test_connect) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable disconnect", ags_connectable_test_disconnect) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable connect connection", ags_connectable_test_connect_connection) == NULL) ||
(CU_add_test(pSuite, "test of AgsConnectable disconnect connection", ags_connectable_test_disconnect_connection) == 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());
}
示例15: hello_test_register
int hello_test_register(CU_pSuite pSuite)
{
/* add a suite to the registry */
pSuite = CU_add_suite("Suite_hello", hello_test_init_suite, hello_test_clean_suite);
if (NULL == pSuite) {
CU_cleanup_registry();
return CU_get_error();
}
if ((NULL == CU_add_test(pSuite, "hello::get_msg", hello_test_get_msg)))
{
CU_cleanup_registry();
return CU_get_error();
}
}