當前位置: 首頁>>代碼示例>>C++>>正文


C++ CuStringNew函數代碼示例

本文整理匯總了C++中CuStringNew函數的典型用法代碼示例。如果您正苦於以下問題:C++ CuStringNew函數的具體用法?C++ CuStringNew怎麽用?C++ CuStringNew使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CuStringNew函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: main

int
main (void)
{
    CuString *output = CuStringNew ();
    CuSuite* suite = CuSuiteNew ();
    int ret;

    _p11_mutex_init (&race_mutex);
    mock_module_init ();
    _p11_library_init ();

#ifdef OS_UNIX
    SUITE_ADD_TEST (suite, test_fork_initialization);
#endif

    SUITE_ADD_TEST (suite, test_recursive_initialization);
    SUITE_ADD_TEST (suite, test_threaded_initialization);

    CuSuiteRun (suite);
    CuSuiteSummary (suite, output);
    CuSuiteDetails (suite, output);
    printf ("%s\n", output->buffer);
    ret = suite->failCount;
    CuSuiteDelete (suite);
    CuStringDelete (output);

    return ret;
}
開發者ID:pexip,項目名稱:os-p11-kit,代碼行數:28,代碼來源:test-init.c

示例2: RunAllTests

void RunAllTests(void) 
{
    CuString *output = CuStringNew();
    CuSuite* suite = CuSuiteNew();


    SUITE_ADD_TEST(suite, Test_find_decoded_line_length_b4_should_be_four);
    SUITE_ADD_TEST(suite, Test_find_decoded_line_length_b1000_should_be_one_thousand);
    SUITE_ADD_TEST(suite, Test_find_decoded_line_length_b502_should_be_502);
    SUITE_ADD_TEST(suite, Test_string_of_encode);
    SUITE_ADD_TEST(suite, Test_string_of_encode_with_all_the_same_character);
    SUITE_ADD_TEST(suite, Test_string_of_encode_with_a_large_number_of_characters);
    SUITE_ADD_TEST(suite, Test_string_of_encode_with_single_occurrence_characters);
    SUITE_ADD_TEST(suite, Test_same_character_string_of_decode);
    SUITE_ADD_TEST(suite, Test_multicharacter_string_of_decode);
    SUITE_ADD_TEST(suite, Test_140character_string_of_decode);
    SUITE_ADD_TEST(suite, Test_1character_occurrences_string_of_decode);

    CuSuiteRun(suite);
    CuSuiteSummary(suite, output);
    CuSuiteDetails(suite, output);
    printf("%s\n", output->buffer);
    CuStringDelete(output);
    CuSuiteDelete(suite);
}
開發者ID:daniel-l-burkhart,項目名稱:RunLengthEncoding,代碼行數:25,代碼來源:AllTests.c

示例3: RunAllTests

void RunAllTests(void)
{
    LOGD("RunAllTests() Entered!\n");
	CuString *output = CuStringNew();//Êä³ö½á¹¹Ìå
	CuSuite* suite = CuSuiteNew();//²âÊÔ×é¾ä±ú
	CuSuite* suite_test = NULL;//²âÊÔ×é¾ä±ú

	//Ôö¼ÓµÄ²âÊÔ×é
	printf("Step1\n");
	suite_test = CuGetSuite();
	CuSuiteRobSuite(suite, suite_test);
	CuSuiteDelete(suite_test);
	printf("Step2\n");
	suite_test = CuStringGetSuite();
	CuSuiteRobSuite(suite, suite_test);
	CuSuiteDelete(suite_test);
	printf("Step3\n");
	CuSuiteRun(suite);
	printf("Step4\n");
	CuSuiteSummary(suite, output);
	printf("Step5\n");
	CuSuiteDetails(suite, output);
	printf("%s\n", output->buffer);
	
	CuSuiteDelete(suite);
	CuStringDelete(output);
}
開發者ID:searKing,項目名稱:CuTest,代碼行數:27,代碼來源:AllTests.c

示例4: main

int main(int argc, char **argv)
{
    CuString *output = CuStringNew();
    CuSuite *suite = CuSuiteNew();

    SUITE_ADD_TEST(suite, test_user_get_uid_retrieves_targetted_user);
    SUITE_ADD_TEST(suite, test_user_get_uid_does_not_retrieve_invalid_user);
    SUITE_ADD_TEST(suite, test_user_get_group_gid_retrieves_desired_group);
    SUITE_ADD_TEST(suite, test_user_get_group_gid_does_not_retrieve_invalid_group);
    SUITE_ADD_TEST(suite, test_user_is_in_group_true_when_user_in_group);
    SUITE_ADD_TEST(suite, test_user_is_in_group_false_when_user_not_in_group);
    SUITE_ADD_TEST(suite, test_user_group_add_succeeds_for_valid_user_group);
    SUITE_ADD_TEST(suite, test_user_group_add_fails_for_invalid_user);
    SUITE_ADD_TEST(suite, test_user_groups_retrieves_users_groups);
    SUITE_ADD_TEST(suite, test_users_in_animal_is_not_null);
    SUITE_ADD_TEST(suite, test_user_in_animal_returns_two_users_for_first_animal);
    SUITE_ADD_TEST(suite, test_user_get_record_returns_a_record);
    SUITE_ADD_TEST(suite, test_user_get_record_returns_requested_user);

    CuSuiteRun(suite);
    CuSuiteSummary(suite, output);
    CuSuiteDetails(suite, output);
    printf("%s\n", output->buffer);

    return suite->failCount;
}
開發者ID:ClayDowling,項目名稱:makeadmin,代碼行數:26,代碼來源:testmain.c

示例5: main

int main() {
    CuSuite *suites[] = {
        strtrim_get_cusuite(),
        strrpl_get_cusuite(),
        iv_parse_config_get_cusuite(),
        iv_parse_index_get_cusuite(),
        iv_parse_series_get_cusuite(),
        iv_parse_auth_get_cusuite(),
        iv_parse_categories_get_cusuite(),
    };
    CuString *output = CuStringNew();
    CuSuite *suite = CuSuiteNew();
    unsigned int i;
    for(i=0; i<SUITE_COUNT(suites); i++) {
        if(suites[i]) { CuSuiteAddSuite(suite, suites[i]); }
        /* Hack for CuTest odditiy - CuSuiteAddSuite() implementation copies
         * tests attached to suites[i] into suite and doesn't internally free
         * suites[i]. Documentation doesn't mention anything about this. */
        free(suites[i]);
    }
    CuSuiteRun(suite);
    CuSuiteSummary(suite, output);
    CuSuiteDetails(suite, output);
    printf("%s\n", output->buffer);
    CuSuiteDelete(suite);
    CuStringDelete(output);
    return 0;
}
開發者ID:amboar,項目名稱:iviewiir,代碼行數:28,代碼來源:test-executor.c

示例6: RunAllTests

void RunAllTests(void)
{
    CuString *output = CuStringNew();
    CuSuite* suite = CuSuiteNew();


    SUITE_ADD_TEST(suite, TestInitLL);
    SUITE_ADD_TEST(suite, TestLengthLL);
    SUITE_ADD_TEST(suite, TestInsertLLIncreasesLength);
    SUITE_ADD_TEST(suite, TestInsertLLInserts);
    SUITE_ADD_TEST(suite, TestCountLL);
    SUITE_ADD_TEST(suite, TestIndexLL);
    SUITE_ADD_TEST(suite, TestRemoveLL);
    SUITE_ADD_TEST(suite, TestExtendLL);
    SUITE_ADD_TEST(suite, TestLookup);
    SUITE_ADD_TEST(suite, TestLookup2);
    SUITE_ADD_TEST(suite, TestLookup3);

    CuSuiteRun(suite);
    CuSuiteSummary(suite, output);
    CuSuiteDetails(suite, output);
    printf("%s\n", output->buffer);
    CuStringDelete(output);
    CuSuiteDelete(suite);
}
開發者ID:Ceasar,項目名稱:masochism,代碼行數:25,代碼來源:AllTests.c

示例7: TestCuStringAppendNULL

void TestCuStringAppendNULL(CuTest* tc)
{
	CuString* str = CuStringNew();
	CuStringAppend(str, NULL);
	CuAssertIntEquals(tc, 4, str->length);
	CuAssertStrEquals(tc, "NULL", str->buffer);
}
開發者ID:jvbenavi,項目名稱:c_prj,代碼行數:7,代碼來源:CuTestTest.c

示例8: TestCuStringNew

void TestCuStringNew(CuTest* tc)
{
	CuString* str = CuStringNew();
	CuAssertTrue(tc, 0 == str->length);
	CuAssertTrue(tc, 0 != str->size);
	CuAssertStrEquals(tc, "", str->buffer);
}
開發者ID:jvbenavi,項目名稱:c_prj,代碼行數:7,代碼來源:CuTestTest.c

示例9: main

int main(int argc, char *argv[]) {
	int idx;
	for (idx = 1; idx < argc; ++idx) {
		if (strcmp(argv[idx], "--env-file-name") == 0) {
			printf("envDefault");
			return 0;
		} else {
			printf("error:\tinvalid option '%s'\n", argv[idx]);
			return 2;
		}
	}

	/* this is our global suite */
	CuSuite *suite  = CuSuiteNew();

	/* register the functions in the order that we should run them */
	CuSuiteAddSuite(suite, GetSuiteTXT());
	CuSuiteAddSuite(suite, GetSuiteTXTCompare());
	CuSuiteAddSuite(suite, GetSuiteTXTConcat());

	/* run them */
	CuSuiteRun(suite);

	/* format our output for the log */
	CuString *output = CuStringNew();
	CuSuiteSummary(suite, output);
	CuSuiteDetails(suite, output);
	printf("%s:\t%s\n", argv[0], output->buffer);

	/* there's no public interface to the failCount, so cheat
	 * and use the value directly
	 */
	return suite->failCount == 0 ? 0 : 2;
}
開發者ID:quoha,項目名稱:conan,代碼行數:34,代碼來源:main.c

示例10: main

int main(int argc, char* argv[]) {
    CuSuite* suite = CuSuiteNew();

    if (argc < 2 || !strcmp(argv[1], "testCall0ReturnByte")) SUITE_ADD_TEST(suite, testCall0ReturnByte);
    if (argc < 2 || !strcmp(argv[1], "testCall0ReturnInt")) SUITE_ADD_TEST(suite, testCall0ReturnInt);
    if (argc < 2 || !strcmp(argv[1], "testCall0ReturnPtr")) SUITE_ADD_TEST(suite, testCall0ReturnPtr);
    if (argc < 2 || !strcmp(argv[1], "testCall0ReturnLong")) SUITE_ADD_TEST(suite, testCall0ReturnLong);
    if (argc < 2 || !strcmp(argv[1], "testCall0ReturnFloat")) SUITE_ADD_TEST(suite, testCall0ReturnFloat);
    if (argc < 2 || !strcmp(argv[1], "testCall0ReturnDouble")) SUITE_ADD_TEST(suite, testCall0ReturnDouble);
    if (argc < 2 || !strcmp(argv[1], "testCall0OneArgOfEach")) SUITE_ADD_TEST(suite, testCall0OneArgOfEach);
    if (argc < 2 || !strcmp(argv[1], "testCall0ManyArgsOfEach")) SUITE_ADD_TEST(suite, testCall0ManyArgsOfEach);
    if (argc < 2 || !strcmp(argv[1], "testCall0Unwind")) SUITE_ADD_TEST(suite, testCall0Unwind);
    if (argc < 2 || !strcmp(argv[1], "testCall0StackAlignment1")) SUITE_ADD_TEST(suite, testCall0StackAlignment1);
    if (argc < 2 || !strcmp(argv[1], "testCall0StackAlignment2")) SUITE_ADD_TEST(suite, testCall0StackAlignment2);

    CuSuiteRun(suite);

    if (argc < 2) {
        CuString *output = CuStringNew();
        CuSuiteSummary(suite, output);
        CuSuiteDetails(suite, output);
        printf("%s\n", output->buffer);
    }

    return suite->failCount;
}
開發者ID:AlexeyBychkov,項目名稱:robovm,代碼行數:26,代碼來源:test_call0.c

示例11: halGeneratorAllTests

int halGeneratorAllTests(void) {
	CuString *output = CuStringNew();
	CuSuite* suite = CuSuiteNew();
	CuSuiteRun(suite);
	CuSuiteSummary(suite, output);
	CuSuiteDetails(suite, output);
	printf("%s\n", output->buffer);
	return suite->failCount > 0;
}
開發者ID:benedictpaten,項目名稱:cactus,代碼行數:9,代碼來源:allTests.c

示例12: RunTests

void RunTests(CuSuite * suite, const char *name) {
    CuString *output = CuStringNew();

    CuSuiteRun(suite);
    CuSuiteDetails(suite, output);
    if (suite->failCount) CuSuiteSummary(suite, output);
    printf("%s: %s", name, output->buffer);
    CuStringDelete(output);
}
開發者ID:stm2,項目名稱:server,代碼行數:9,代碼來源:test_eressea.c

示例13: runAllTests

int runAllTests(void) {
  CuString *output = CuStringNew();
  CuSuite* suite = CuSuiteNew(); 
  CuSuiteAddSuite(suite, pathMapperTestSuite());
  CuSuiteRun(suite);
  CuSuiteSummary(suite, output);
  CuSuiteDetails(suite, output);
  printf("%s\n", output->buffer);
  return suite->failCount > 0;
}
開發者ID:glennhickey,項目名稱:vg2sg,代碼行數:10,代碼來源:unitTests.cpp

示例14: main

int main(){
  CuString *output = CuStringNew();
  CuSuite* suite = CuSuiteNew();
  CuSuiteAddSuite(suite, geometry_get_suite());
  CuSuiteRun(suite);
  CuSuiteSummary(suite, output);
  CuSuiteDetails(suite, output);
  printf("%s\n", output->buffer);
  return suite->failCount;  
}
開發者ID:FXIhub,項目名稱:hawk,代碼行數:10,代碼來源:geometry_tests.c

示例15: RunC4Tests

void RunC4Tests(void) {
   CuString *output = CuStringNew();
   CuSuite* suite = CuSuiteNew();

   CuSuiteAddSuite(suite, c4_engine_suite());
   CuSuiteRun(suite);
   CuSuiteSummary(suite, output);
   CuSuiteDetails(suite, output);
   printf("%s\n", output->buffer);
}
開發者ID:ryanabel03,項目名稱:CS_343,代碼行數:10,代碼來源:c4_engine_test.c


注:本文中的CuStringNew函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。