当前位置: 首页>>代码示例>>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;未经允许,请勿转载。