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


C++ TESTCASE函数代码示例

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


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

示例1: main

int main( void )
{
    TESTCASE( isblank( ' ' ) );
    TESTCASE( isblank( '\t' ) );
    TESTCASE( ! isblank( '\v' ) );
    TESTCASE( ! isblank( '\r' ) );
    TESTCASE( ! isblank( 'x' ) );
    TESTCASE( ! isblank( '@' ) );
    return TEST_RESULTS;
}
开发者ID:Bigcheese,项目名称:nucleo-toolchain,代码行数:10,代码来源:isblank.c

示例2: main

int main( void )
{
    TESTCASE( islower( 'a' ) );
    TESTCASE( islower( 'z' ) );
    TESTCASE( ! islower( 'A' ) );
    TESTCASE( ! islower( 'Z' ) );
    TESTCASE( ! islower( ' ' ) );
    TESTCASE( ! islower( '@' ) );
    return TEST_RESULTS;
}
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:10,代码来源:islower.c

示例3: main

int main( void )
{
    TESTCASE(iswgraph(L'a'));
    TESTCASE(iswgraph(L'z'));
    TESTCASE(iswgraph(L'E'));
    TESTCASE(!iswgraph(L' '));
    TESTCASE(!iswgraph(L'\t'));
    TESTCASE(!iswgraph(L'\n'));
    return TEST_RESULTS;
}
开发者ID:Zeke-OS,项目名称:zeke,代码行数:10,代码来源:iswgraph.c

示例4: main

int main( void )
{
    TESTCASE(iswlower(L'a'));
    TESTCASE(iswlower(L'e'));
    TESTCASE(iswlower(L'z'));
    TESTCASE(!iswlower(L'A'));
    TESTCASE(!iswlower(L'E'));
    TESTCASE(!iswlower(L'Z'));
    return TEST_RESULTS;
}
开发者ID:Zeke-OS,项目名称:zeke,代码行数:10,代码来源:iswlower.c

示例5: main

int main( void )
{
    TESTCASE(towctrans(L'a', wctrans("toupper")) == L'A');
    TESTCASE(towctrans(L'B', wctrans("toupper")) == L'B');
    TESTCASE(towctrans(L'a', wctrans("tolower")) == L'a');
    TESTCASE(towctrans(L'B', wctrans("tolower")) == L'b');
    TESTCASE(towctrans(L'B', wctrans("invalid")) == L'B');
    TESTCASE(towctrans(L'B', 0)                  == L'B');
    return TEST_RESULTS;
}
开发者ID:fixos,项目名称:fixos-libc,代码行数:10,代码来源:towctrans.c

示例6: main

int main( void )
{
#ifndef REGTEST
    {
    char * startbreak = sbrk( 0 );
    TESTCASE( _PDCLIB_allocpages( 0 ) );
    TESTCASE( ( (char *)sbrk( 0 ) - startbreak ) <= _PDCLIB_PAGESIZE );
    startbreak = sbrk( 0 );
    TESTCASE( _PDCLIB_allocpages( 1 ) );
    TESTCASE( sbrk( 0 ) == startbreak + ( 1 * _PDCLIB_PAGESIZE ) );
    TESTCASE( _PDCLIB_allocpages( 5 ) );
    TESTCASE( sbrk( 0 ) == startbreak + ( 6 * _PDCLIB_PAGESIZE ) );
    TESTCASE( _PDCLIB_allocpages( -3 ) );
    TESTCASE( sbrk( 0 ) == startbreak + ( 3 * _PDCLIB_PAGESIZE ) );
    }
#endif
    return TEST_RESULTS;
}
开发者ID:MatiasNAmendola,项目名称:CSOS,代码行数:18,代码来源:allocpages.c

示例7: switch

void LocaleDisplayNamesTest::runIndexedTest(int32_t index, UBool exec, const char* &name, 
					    char* /*par*/) {
    switch (index) {
#if !UCONFIG_NO_FORMATTING
        TESTCASE(0, TestCreate);
        TESTCASE(1, TestCreateDialect);
	TESTCASE(2, TestWithKeywordsAndEverything);
	TESTCASE(3, TestUldnOpen);
	TESTCASE(4, TestUldnOpenDialect);
	TESTCASE(5, TestUldnWithKeywordsAndEverything);
	TESTCASE(6, TestUldnComponents);
	TESTCASE(7, TestRootEtc);
#endif
        default:
	  name = "";
	  break;
    }
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:18,代码来源:locnmtst.cpp

示例8: main

int main( void )
{
    char s[] = "abcabcabcdabcde";
    TESTCASE( strstr( s, "x" ) == NULL );
    TESTCASE( strstr( s, "xyz" ) == NULL );
    TESTCASE( strstr( s, "a" ) == &s[0] );
    TESTCASE( strstr( s, "abc" ) == &s[0] );
    TESTCASE( strstr( s, "abcd" ) == &s[6] );
    TESTCASE( strstr( s, "abcde" ) == &s[10] );
    return TEST_RESULTS;
}
开发者ID:fixos,项目名称:fixos-libc,代码行数:11,代码来源:strstr.c

示例9: main

int main( void )
{
    char s[] = "xxxxabcde";
    TESTCASE( memmove( s, s + 4, 5 ) == s );
    TESTCASE( s[0] == 'a' );
    TESTCASE( s[4] == 'e' );
    TESTCASE( s[5] == 'b' );
    TESTCASE( memmove( s + 4, s, 5 ) == s + 4 );
    TESTCASE( s[4] == 'a' );
    return TEST_RESULTS;
}
开发者ID:fixos,项目名称:fixos-libc,代码行数:11,代码来源:memmove.c

示例10: switch

void 
ICUServiceTest::runIndexedTest(int32_t index, UBool exec, const char* &name,
char* /*par*/)
{
    switch (index) {
        TESTCASE(0,testAPI_One);
        TESTCASE(1,testAPI_Two);
        TESTCASE(2,testRBF);
        TESTCASE(3,testNotification);
        TESTCASE(4,testLocale);
        TESTCASE(5,testWrapFactory);
        TESTCASE(6,testCoverage);
    default: name = ""; break;
    }
}
开发者ID:ACSOP,项目名称:android_external_icu4c,代码行数:15,代码来源:icusvtst.cpp

示例11: main

int main( void )
{
    FILE * fh;
    char const * message = "SUCCESS testing puts()";
    char buffer[23];
    buffer[22] = 'x';
    TESTCASE( ( fh = freopen( testfile, "wb+", stdout ) ) != NULL );
    TESTCASE( puts( message ) >= 0 );
    rewind( fh );
    TESTCASE( fread( buffer, 1, 22, fh ) == 22 );
    TESTCASE( memcmp( buffer, message, 22 ) == 0 );
    TESTCASE( buffer[22] == 'x' );
    TESTCASE( fclose( fh ) == 0 );
    TESTCASE( remove( testfile ) == 0 );
    return TEST_RESULTS;
}
开发者ID:zzyjsjcom,项目名称:os_diy,代码行数:16,代码来源:puts.c

示例12: main

int main( void )
{
    char cmpabcde[] = "abcde";
    char cmpabcd_[] = "abcd\xfc";
    char empty[] = "";
    TESTCASE( strcmp( abcde, cmpabcde ) == 0 );
    TESTCASE( strcmp( abcde, abcdx ) < 0 );
    TESTCASE( strcmp( abcdx, abcde ) > 0 );
    TESTCASE( strcmp( empty, abcde ) < 0 );
    TESTCASE( strcmp( abcde, empty ) > 0 );
    TESTCASE( strcmp( abcde, cmpabcd_ ) < 0 );
    return TEST_RESULTS;
}
开发者ID:DavideD,项目名称:BizHawk,代码行数:13,代码来源:strcmp.c

示例13: main

int main( void )
{
    FILE * fh;
    unsigned long long max = ULLONG_MAX;
    char buffer[100];
    sprintf( buffer, "%llu", max );
    TESTCASE( ( fh = freopen( testfile, "wb+", stderr ) ) != NULL );
    TESTCASE( strtol( buffer, NULL, 10 ) == LONG_MAX );
    perror( "Test" );
    rewind( fh );
    TESTCASE( fread( buffer, 1, 7, fh ) == 7 );
    TESTCASE( memcmp( buffer, "Test: ", 6 ) == 0 );
    TESTCASE( fclose( fh ) == 0 );
    TESTCASE( remove( testfile ) == 0 );
    return TEST_RESULTS;
}
开发者ID:fixos,项目名称:fixos-libc,代码行数:16,代码来源:perror.c

示例14: switch

void LocaleAliasTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ ){
    switch (index) {
        TESTCASE(0, TestCalendar);
        TESTCASE(1, TestDateFormat);
        TESTCASE(2, TestCollation);
        TESTCASE(3, TestULocale);
        TESTCASE(4, TestUResourceBundle);
        TESTCASE(5, TestDisplayName);
        // keep the last index in sync with the condition in default:

        default:
            if (index <= 5) { // keep this in sync with the last index!
                name = "(test omitted by !UCONFIG_NO_FORMATTING)";
            } else {
                name = "";
            }
            break; //needed to end loop
    }
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:19,代码来源:aliastst.cpp

示例15: main

int main()
{
  int retcode = 0;
  
  struct testcase testcases[] = {
    TESTCASE(tgps_nmea_nextField),
    TESTCASE(tgps_nmea_checksum),
    TESTCASE(tgps_nmea_GPGSA),
    TESTCASE(tgps_nmea_GPRMC),
    TESTCASE(tgps_nmea_GPGGA),
    TESTCASE(tgps_nmea_GPGSV),
  };
  
  /* initialize things */
  
  /* run test suite on the airborne code */
  retcode = runSuite((char*)"airborne_test_results.xml",
		     (char*)"airborne",
		     testcases,
		     sizeof(testcases)/sizeof(testcases[0]));
  
  return (retcode == 0) ? 0 : -1;
}
开发者ID:mantauav,项目名称:paparazzi,代码行数:23,代码来源:testdriver.c


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