当前位置: 首页>>代码示例>>C++>>正文


C++ CU_initialize_registry函数代码示例

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


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

示例1: 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,代码来源:test.c

示例2: 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("TestCommunicationProtocol", 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, "testEventHandlerInvocation", testEventHandlerInvocation))) {
        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:NKSG,项目名称:Distributed-Chang-Roberts-Spanning-Tree,代码行数:26,代码来源:TestCommunicationProtocol.c

示例3: main

/* MAIN */
int main(void) {
  CU_pSuite ste = NULL;

  if (CUE_SUCCESS != CU_initialize_registry()) {
    return CU_get_error();
  }

  ste = CU_add_suite("sllist_suite", init_sllist_suite, clean_sllist1_suite);
  if (NULL == ste) {
    CU_cleanup_registry();
    return CU_get_error();
  }

  ADD_TEST(CU_add_test(ste, "Verify insert...", t_insert));

  // CU_console_run_tests();
  CU_basic_set_mode(CU_BRM_VERBOSE);
  CU_basic_run_suite(ste);
  CU_basic_show_failures(CU_get_failure_list());
  CU_cleanup_registry();

  printf("\n");

  return CU_get_error();
}
开发者ID:manchicken,项目名称:libmanchicken,代码行数:26,代码来源:t_single_linked_list.c

示例4: 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("cryptography_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_twofish_decrypt_encrypt", test_twofish_decrypt_encrypt)) ||
            (NULL == CU_add_test(pSuite, "test_twofish_decrypt_encrypt_null", test_twofish_decrypt_encrypt_null))||
            (NULL == CU_add_test(pSuite, "test_twofish_decrypt_encrypt_wrong_size", test_twofish_decrypt_encrypt_wrong_size))||
            (NULL == CU_add_test(pSuite, "test_sha256_normal", test_sha256_normal))||
            (NULL == CU_add_test(pSuite, "test_sha512_normal", test_sha512_normal))||
            (NULL == CU_add_test(pSuite, "test_sha512_null", test_sha512_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,项目名称:PasswordManager,代码行数:31,代码来源:cryptography_test.c

示例5: main

int main(void)
{
	if (CU_initialize_registry() != CUE_SUCCESS) {
		return CU_get_error();
	}

	CU_SuiteInfo suites[] = {
		{"Policy Version 21", policy_21_init, policy_21_cleanup, policy_21_tests},
		{"AV Rule Query", avrule_init, avrule_cleanup, avrule_tests},
		{"Domain Transition Analysis", dta_init, dta_cleanup, dta_tests},
		{"Infoflow Analysis", infoflow_init, infoflow_cleanup, infoflow_tests},
		{"Role Query", role_init, role_cleanup, role_tests},
		{"TE Rule Query", terule_init, terule_cleanup, terule_tests},
		{"User Query", user_init, user_cleanup, user_tests},
		{"Constrain query", constrain_init, constrain_cleanup, constrain_tests},
		CU_SUITE_INFO_NULL
	};

	CU_register_suites(suites);
	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();
	unsigned int num_failures = CU_get_number_of_failure_records();
	CU_cleanup_registry();
	return (int)num_failures;
}
开发者ID:0xroot,项目名称:setools3,代码行数:25,代码来源:libapol-tests.c

示例6: main

int
main(void)
{
  /* initialize the CUnit test registry */
  if (CUE_SUCCESS != CU_initialize_registry())
    return CU_get_error();

  /* add a suite to the registry */
  if (1 == test_mman_suite())
    return CU_get_error();

  /* Run all tests using the basic interface */
  CU_basic_set_mode(CU_BRM_VERBOSE);
  CU_basic_run_tests();

  /* Report failures */
  printf("\n\nSummary of failures:\n");
  CU_basic_show_failures(CU_get_failure_list());

  /* Clean up registry and return */
  printf("\n\nCleaning ...");
  CU_cleanup_registry();
  return CU_get_error();

}
开发者ID:fangbin,项目名称:mem,代码行数:25,代码来源:dkbttst.c

示例7: main

int main()
{
    CU_pSuite pSuite = NULL;
    if ( CUE_SUCCESS != CU_initialize_registry() )
        return CU_get_error();

    /* add a suite to the registry */
    pSuite = CU_add_suite( "max_test_suite", 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_strategy_stand", test_strategy_stand)) ||
        (NULL == CU_add_test(pSuite, "test_strategy_dealer", test_strategy_dealer)) ||
        (NULL == CU_add_test(pSuite, "test_strategy_basic", test_strategy_basic))
    )
    {
        CU_cleanup_registry();
        return CU_get_error();
    }

    // Run all tests using the basic interface
    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_cleanup_registry();
    return CU_get_error();
}
开发者ID:fabricereix,项目名称:Blackjack,代码行数:33,代码来源:strategy.c

示例8: main

int main(
        const int argc,
        const char* const * argv)
{
    int exitCode = 1;
    const char* progname = basename((char*) argv[0]);

    if (-1 == openulog(progname, 0, LOG_LOCAL0, "-")) {
        (void) fprintf(stderr, "Couldn't open logging system\n");
    }
    else {
        if (CUE_SUCCESS == CU_initialize_registry()) {
            CU_Suite* testSuite = CU_add_suite(__FILE__, setup, teardown);

            if (NULL != testSuite) {
                if (CU_ADD_TEST(testSuite, test_msm_init)
                        && CU_ADD_TEST(testSuite, test_locking)
                        && CU_ADD_TEST(testSuite, test_msm_put)
                        && CU_ADD_TEST(testSuite, test_msm_getPid)
                        && CU_ADD_TEST(testSuite, test_msm_removePid)
                        && CU_ADD_TEST(testSuite, test_msm_destroy)
                        ) {
                    CU_basic_set_mode(CU_BRM_VERBOSE);
                    (void) CU_basic_run_tests();
                }
            }

            exitCode = CU_get_number_of_tests_failed();
            CU_cleanup_registry();
        }
    }

    return exitCode;
}
开发者ID:PatrickHildreth-NOAA,项目名称:LDM,代码行数:34,代码来源:mldm_sender_map_test.c

示例9: 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("newcunittest", 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, "testScpi_glue_input", testScpi_glue_input)) ||
            (NULL == CU_add_test(pSuite, "test_output_matches", test_output_matches)) ||
            (NULL == CU_add_test(pSuite, "test_output_load", test_output_load)) ||
            (NULL == CU_add_test(pSuite, "test_bjarni3", test_bjarni3)) ||
            (NULL == CU_add_test(pSuite, "test_applyq", test_applyq)) ||
            0) {
        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:vjine,项目名称:discotmc,代码行数:33,代码来源:newcunittest.c

示例10: main

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 (-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,代码来源:test_inetutil.c

示例11: 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("perfthread tests", 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 server", test_server))
        )
    {
        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:csound,项目名称:csound,代码行数:29,代码来源:server_test.cpp

示例12: 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,代码来源:google_oauth2_access_test.c

示例13: main

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 */

        log_free();
    } /* logging system initialized */

    return exitCode;
}
开发者ID:khallock,项目名称:LDM,代码行数:31,代码来源:prod_index_queue_test.c

示例14: 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,代码来源:test_mm.c

示例15: main

int main()
{
    CU_pSuite suite = 0;

    if (CUE_SUCCESS != CU_initialize_registry())
        goto didnt_even_fail;

    suite = CU_add_suite("result functions", 0, 0);
    if (!suite)
        goto failed;

    if (!CU_ADD_TEST(suite, test_error) ||
        !CU_ADD_TEST(suite, test_blank_success) ||
        !CU_ADD_TEST(suite, test_success_with_entity) ||
        !CU_ADD_TEST(suite, test_entity_without_free) ||
        !CU_ADD_TEST(suite, test_free_result) ||
        !CU_ADD_TEST(suite, test_success_with_location) ||
        !CU_ADD_TEST(suite, test_success_with_entity_and_location) ||
        !CU_ADD_TEST(suite, test_success_with_cookie))
        goto failed;

    CU_basic_set_mode(CU_BRM_VERBOSE);
    CU_basic_run_tests();

failed:
    CU_cleanup_registry();
didnt_even_fail:
    return CU_get_error();
}
开发者ID:tps12,项目名称:tripping-sansa,代码行数:29,代码来源:test_result.c


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