Beispiel #1
0
int main( void )
{
    TESTCASE( isblank( ' ' ) );
    TESTCASE( isblank( '\t' ) );
    TESTCASE( ! isblank( '\v' ) );
    TESTCASE( ! isblank( '\r' ) );
    TESTCASE( ! isblank( 'x' ) );
    TESTCASE( ! isblank( '@' ) );
    return TEST_RESULTS;
}
Beispiel #2
0
int main( void )
{
    TESTCASE( islower( 'a' ) );
    TESTCASE( islower( 'z' ) );
    TESTCASE( ! islower( 'A' ) );
    TESTCASE( ! islower( 'Z' ) );
    TESTCASE( ! islower( ' ' ) );
    TESTCASE( ! islower( '@' ) );
    return TEST_RESULTS;
}
Beispiel #3
0
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;
}
Beispiel #4
0
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;
}
Beispiel #5
0
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;
}
Beispiel #6
0
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;
}
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;
    }
}
Beispiel #8
0
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;
}
Beispiel #9
0
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;
}
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;
    }
}
Beispiel #11
0
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;
}
Beispiel #12
0
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;
}
Beispiel #13
0
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;
}
Beispiel #14
0
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
    }
}
Beispiel #15
0
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;
}
static bool self_check(void) {
	struct TestCase {
		uint32_t answer[STATE_LEN];
		const char *message;
	};
	
	static const struct TestCase cases[] = {
		#define TESTCASE(a,b,c,d,e,f,g,h,msg) {{UINT32_C(a),UINT32_C(b),UINT32_C(c),UINT32_C(d),UINT32_C(e),UINT32_C(f),UINT32_C(g),UINT32_C(h)}, msg}
		TESTCASE(0xE3B0C442,0x98FC1C14,0x9AFBF4C8,0x996FB924,0x27AE41E4,0x649B934C,0xA495991B,0x7852B855, ""),
		TESTCASE(0xCA978112,0xCA1BBDCA,0xFAC231B3,0x9A23DC4D,0xA786EFF8,0x147C4E72,0xB9807785,0xAFEE48BB, "a"),
		TESTCASE(0xBA7816BF,0x8F01CFEA,0x414140DE,0x5DAE2223,0xB00361A3,0x96177A9C,0xB410FF61,0xF20015AD, "abc"),
		TESTCASE(0xF7846F55,0xCF23E14E,0xEBEAB5B4,0xE1550CAD,0x5B509E33,0x48FBC4EF,0xA3A1413D,0x393CB650, "message digest"),
		TESTCASE(0x71C480DF,0x93D6AE2F,0x1EFAD144,0x7C66C952,0x5E316218,0xCF51FC8D,0x9ED832F2,0xDAF18B73, "abcdefghijklmnopqrstuvwxyz"),
		TESTCASE(0x248D6A61,0xD20638B8,0xE5C02693,0x0C3E6039,0xA33CE459,0x64FF2167,0xF6ECEDD4,0x19DB06C1, "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"),
		#undef TESTCASE
	};
	
	size_t numCases = sizeof(cases) / sizeof(cases[0]);
	for (size_t i = 0; i < numCases; i++) {
		const struct TestCase *tc = &cases[i];
		size_t len = strlen(tc->message);
		uint8_t *msg = calloc(len, sizeof(uint8_t));
		if (msg == NULL) {
			perror("calloc");
			exit(1);
		}
		for (size_t j = 0; j < len; j++)
			msg[j] = (uint8_t)tc->message[j];
		
		uint32_t hash[STATE_LEN];
		sha256_hash(msg, len, hash);
		if (memcmp(hash, tc->answer, sizeof(tc->answer)) != 0)
			return false;
		free(msg);
	}
	return true;
}
Beispiel #17
0
UPerfFunction* CharPerformanceTest::runIndexedTest(int32_t index, UBool exec,
                                                   const char *&name, 
                                                   char* par) 
{
    switch (index) {
        TESTCASE(0, TestIsAlpha);
        TESTCASE(1, TestIsUpper);
        TESTCASE(2, TestIsLower);
        TESTCASE(3, TestIsDigit);
        TESTCASE(4, TestIsSpace);
        TESTCASE(5, TestIsAlphaNumeric);
        TESTCASE(6, TestIsPrint);
        TESTCASE(7, TestIsControl);
        TESTCASE(8, TestToLower);
        TESTCASE(9, TestToUpper);
        TESTCASE(10, TestIsWhiteSpace);
        TESTCASE(11, TestStdLibIsAlpha);
        TESTCASE(12, TestStdLibIsUpper);
        TESTCASE(13, TestStdLibIsLower);
        TESTCASE(14, TestStdLibIsDigit);
        TESTCASE(15, TestStdLibIsSpace);
        TESTCASE(16, TestStdLibIsAlphaNumeric);
        TESTCASE(17, TestStdLibIsPrint);
        TESTCASE(18, TestStdLibIsControl);
        TESTCASE(19, TestStdLibToLower);
        TESTCASE(20, TestStdLibToUpper);
        TESTCASE(21, TestStdLibIsWhiteSpace);
        default: 
            name = ""; 
            return NULL;
    }
    return NULL;
}
Beispiel #18
0
int main (int argc, char **argv)
{
    GTestSuite *suite;
    TestData *data;
    int i;
    const char *port = NULL;
    gint result;

    g_test_init (&argc, &argv, NULL);

    /* See if we got passed a serial port for live testing */
    for (i = 0; i < argc; i++) {
        if (!strcmp (argv[i], "--port")) {
            /* Make sure there's actually a port in the next arg */
            g_assert (argc > i + 1);
            port = argv[++i];
        }
    }

    data = test_data_new (port);

    suite = g_test_get_root ();

    g_test_suite_add (suite, TESTCASE (test_crc16_1, NULL));
    g_test_suite_add (suite, TESTCASE (test_crc16_2, NULL));
    g_test_suite_add (suite, TESTCASE (test_escape1, NULL));
    g_test_suite_add (suite, TESTCASE (test_escape2, NULL));
    g_test_suite_add (suite, TESTCASE (test_escape_unescape, NULL));
    g_test_suite_add (suite, TESTCASE (test_utils_decapsulate_buffer, NULL));
    g_test_suite_add (suite, TESTCASE (test_utils_encapsulate_buffer, NULL));
    g_test_suite_add (suite, TESTCASE (test_utils_decapsulate_sierra_cns, NULL));
    g_test_suite_add (suite, TESTCASE (test_result_string, NULL));
    g_test_suite_add (suite, TESTCASE (test_result_uint32, NULL));
    g_test_suite_add (suite, TESTCASE (test_result_uint8, NULL));
    g_test_suite_add (suite, TESTCASE (test_result_uint8_array, NULL));

    /* Live tests */
    if (port) {
        g_test_suite_add (suite, TESTCASE (test_com_port_init, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_version_info, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_esn, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_mdn, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_read_roam_pref, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_read_mode_pref, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_read_hybrid_pref, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_read_ipv6_enabled, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_read_hdr_rev_pref, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_status, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_sw_version, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_status_snapshot, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_pilot_sets, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_cm_subsys_state_info, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_hdr_subsys_state_info, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_ext_logmask, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_event_report, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_log_config, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_zte_subsys_status, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_nw_subsys_modem_snapshot_cdma, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_nw_subsys_eri, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_wcdma_subsys_state_info, data->com_data));
        g_test_suite_add (suite, TESTCASE (test_com_gsm_subsys_state_info, data->com_data));
    }

	result = g_test_run ();

	test_data_free (data);

	return result;
}
Beispiel #19
0
int main( void )
{
    TESTCASE( NO_TESTDRIVER );
    return TEST_RESULTS;
}
void addDateTimePatternGeneratorTest(TestNode** root) {
    TESTCASE(TestOpenClose);
    TESTCASE(TestUsage);
    TESTCASE(TestBuilder);
    TESTCASE(TestOptions);
}
Beispiel #21
0
void RbnfRoundTripTest::runIndexedTest(int32_t index, UBool exec, const char* &name, char* /*par*/)
{
    if (exec) logln("TestSuite RuleBasedNumberFormatRT");
    switch (index) {
#if U_HAVE_RBNF
      TESTCASE(0, TestEnglishSpelloutRT);
      TESTCASE(1, TestDurationsRT);
      TESTCASE(2, TestSpanishSpelloutRT);
      TESTCASE(3, TestFrenchSpelloutRT);
      TESTCASE(4, TestSwissFrenchSpelloutRT);
      TESTCASE(5, TestItalianSpelloutRT);
      TESTCASE(6, TestGermanSpelloutRT);
      TESTCASE(7, TestSwedishSpelloutRT);
      TESTCASE(8, TestDutchSpelloutRT);
      TESTCASE(9, TestJapaneseSpelloutRT);
      TESTCASE(10, TestRussianSpelloutRT);
      TESTCASE(11, TestGreekSpelloutRT);
#else
      TESTCASE(0, TestRBNFDisabled);
#endif
    default:
      name = "";
      break;
    }
}
Beispiel #22
0
void addUListFmtTest(TestNode** root)
{
    TESTCASE(TestUListFmt);
}
Beispiel #23
0
int main( void )
{
    /* Testing all the basic I/O functions individually would result in lots
       of duplicated code, so I took the liberty of lumping it all together
       here.
    */
    /* The following functions delegate their tests to here:
       fgetc fflush rewind fputc ungetc fseek
       flushbuffer seek fillbuffer prepread prepwrite
    */
    char * buffer = (char*)malloc( 4 );
    FILE * fh;
    TESTCASE( ( fh = tmpfile() ) != NULL );
    TESTCASE( setvbuf( fh, buffer, _IOLBF, 4 ) == 0 );
    /* Testing ungetc() at offset 0 */
    rewind( fh );
    TESTCASE( ungetc( 'x', fh ) == 'x' );
    TESTCASE( ftell( fh ) == -1l );
    rewind( fh );
    TESTCASE( ftell( fh ) == 0l );
    /* Commence "normal" tests */
    TESTCASE( fputc( '1', fh ) == '1' );
    TESTCASE( fputc( '2', fh ) == '2' );
    TESTCASE( fputc( '3', fh ) == '3' );
    /* Positions incrementing as expected? */
    TESTCASE( ftell( fh ) == 3l );
    TESTCASE_NOREG( fh->pos.offset == 0l );
    TESTCASE_NOREG( fh->bufidx == 3l );
    /* Buffer properly flushed when full? */
    TESTCASE( fputc( '4', fh ) == '4' );
    TESTCASE_NOREG( fh->pos.offset == 4l );
    TESTCASE_NOREG( fh->bufidx == 0 );
    /* fflush() resetting positions as expected? */
    TESTCASE( fputc( '5', fh ) == '5' );
    TESTCASE( fflush( fh ) == 0 );
    TESTCASE( ftell( fh ) == 5l );
    TESTCASE_NOREG( fh->pos.offset == 5l );
    TESTCASE_NOREG( fh->bufidx == 0l );
    /* rewind() resetting positions as expected? */
    rewind( fh );
    TESTCASE( ftell( fh ) == 0l );
    TESTCASE_NOREG( fh->pos.offset == 0 );
    TESTCASE_NOREG( fh->bufidx == 0 );
    /* Reading back first character after rewind for basic read check */
    TESTCASE( fgetc( fh ) == '1' );
    /* TODO: t.b.c. */
    TESTCASE( fclose( fh ) == 0 );
    return TEST_RESULTS;
}
Beispiel #24
0
void IdnaConfTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/){
    switch (index) {
        TESTCASE(0,Test);
        default: name = ""; break;
    }
}
void addRelativeDateFormatTest(TestNode** root)
{
    TESTCASE(TestRelDateFmt);
    TESTCASE(TestCombineDateTime);
}
Beispiel #26
0
int main( void )
{
    TESTCASE( strlen( tmpnam( NULL ) ) < L_tmpnam );
    return TEST_RESULTS;
}
Beispiel #27
0
/*
 * getastring() parses something vaguely like an astring, with a few differences.
 */
static void test_getastring(void)
{
    /* Simple sequences of ascii alphanumerics characters are atoms */
    TESTCASE(getastring, "hydrogen helium", ' ', "hydrogen");
    TESTCASE(getastring, "258 uranium", ' ', "258");
    TESTCASE(getastring, "uranium258 plutonium", ' ', "uranium258");

    /* The character sequence NIL is not special, it's parsed as an atom */
    TESTCASE(getastring, "NIL by mouth", ' ', "NIL");
    TESTCASE(getastring, "NELLY the lamb", ' ', "NELLY");

    /*
     * List wildcards aren't part of an atom, but Cyrus accepts them
     * in order to implement the "mailbox" and "list-mailbox" rules,
     * which are like astrings but also allow unquoted wildcards,
     * as astrings.
     */
    TESTCASE(getastring, "foo*bar baz", ' ', "foo*bar");
    TESTCASE(getastring, "baz%quux foo", ' ', "baz%quux");

    /*
     * Various special characters are not part of atoms.
     *
     * Again the server code is very liberal in accepting all kinds of
     * things which aren't in the ABNF, so we test for the liberal
     * interpretation and note the conservative one in a comment.
     */
    TESTCASE(getastring, "foo(bar baz", '(', "foo");
    TESTCASE(getastring, "foo)bar baz", ')', "foo");
    TESTCASE(getastring, "foo{bar baz", ' ', "foo{bar"); /* should be: '{', "foo" */
    TESTCASE(getastring, "foo\"bar baz", '"', "foo");
    TESTCASE(getastring, "foo\\bar baz", ' ', "foo\\bar"); /* should be: '\\', "foo" */
    TESTCASE(getastring, "foo]bar baz", ' ', "foo]bar"); /* should be ']', "foo" */

    /*
     * Quoted strings are astrings
     */
    TESTCASE(getastring, "\"foo\" bar", ' ', "foo");
    TESTCASE(getastring, "\"foo bar\" baz", ' ', "foo bar");
    TESTCASE(getastring, "\"foo bar", EOF, "");
    TESTCASE(getastring, "\"foo\\\"bar\" baz", ' ', "foo\"bar");
    TESTCASE(getastring, "\"foo\\\\bar\" baz", ' ', "foo\\bar");
    /* Any non-special char can be escaped with \ */
    TESTCASE(getastring, "\"foo\\bar\" baz", ' ', "foobar");
    /* \n and \r can be escaped with \ */
    TESTCASE(getastring, "\"foo\\\nbar\" baz", ' ', "foo\nbar");
    TESTCASE(getastring, "\"foo\\\rbar\" baz", ' ', "foo\rbar");
    /* Non-escaped \n and \r.  The server is actually more
     * conversative than the ABNF and rejects these. */
    TESTCASE(getastring, "\"foo\nbar\" baz", EOF, ""); /* should be ' ', "foo\nbar" */
    TESTCASE(getastring, "\"foo\rbar\" baz", EOF, ""); /* should be ' ', "foo\rbar" */

    /*
     * Literals are astrings
     */
    /* boring literal */
    TESTCASE(getastring, "{3}\r\nfoo ", ' ', "foo");
    /* literals with embedded space */
    TESTCASE(getastring, "{7}\r\nfoo bar ", ' ', "foo bar");
    /* literals with embedded \n or \r */
    TESTCASE(getastring, "{7}\r\nfoo\nbar ", ' ', "foo\nbar");
    TESTCASE(getastring, "{7}\r\nfoo\rbar ", ' ', "foo\rbar");
    /* literals with 8-bit chars */
    TESTCASE(getastring, "{7}\r\nfoo\277bar ", ' ', "foo\277bar");
    /* literals with embedded NUL - getastring() rejects these */
    TESTCASE(getastring, "{7}\r\nfoo\0bar ", EOF, ""); /* should be ' ', "foo\0bar" */
}
Beispiel #28
0
UPerfFunction* NormalizerPerformanceTest::runIndexedTest(int32_t index, UBool exec,const char* &name, char* par) {
    switch (index) {
        TESTCASE(0,TestICU_NFC_NFD_Text);
        TESTCASE(1,TestICU_NFC_NFC_Text);
        TESTCASE(2,TestICU_NFC_Orig_Text);

        TESTCASE(3,TestICU_NFD_NFD_Text);
        TESTCASE(4,TestICU_NFD_NFC_Text);
        TESTCASE(5,TestICU_NFD_Orig_Text);

        TESTCASE(6,TestICU_FCD_NFD_Text);
        TESTCASE(7,TestICU_FCD_NFC_Text);
        TESTCASE(8,TestICU_FCD_Orig_Text);

        TESTCASE(9,TestWin_NFC_NFD_Text);
        TESTCASE(10,TestWin_NFC_NFC_Text);
        TESTCASE(11,TestWin_NFC_Orig_Text);

        TESTCASE(12,TestWin_NFD_NFD_Text);
        TESTCASE(13,TestWin_NFD_NFC_Text);
        TESTCASE(14,TestWin_NFD_Orig_Text);

        TESTCASE(15,TestQC_NFC_NFD_Text);
        TESTCASE(16,TestQC_NFC_NFC_Text);
        TESTCASE(17,TestQC_NFC_Orig_Text);

        TESTCASE(18,TestQC_NFD_NFD_Text);
        TESTCASE(19,TestQC_NFD_NFC_Text);
        TESTCASE(20,TestQC_NFD_Orig_Text);

        TESTCASE(21,TestQC_FCD_NFD_Text);
        TESTCASE(22,TestQC_FCD_NFC_Text);
        TESTCASE(23,TestQC_FCD_Orig_Text);

        TESTCASE(24,TestIsNormalized_NFC_NFD_Text);
        TESTCASE(25,TestIsNormalized_NFC_NFC_Text);
        TESTCASE(26,TestIsNormalized_NFC_Orig_Text);

        TESTCASE(27,TestIsNormalized_NFD_NFD_Text);
        TESTCASE(28,TestIsNormalized_NFD_NFC_Text);
        TESTCASE(29,TestIsNormalized_NFD_Orig_Text);

        TESTCASE(30,TestIsNormalized_FCD_NFD_Text);
        TESTCASE(31,TestIsNormalized_FCD_NFC_Text);
        TESTCASE(32,TestIsNormalized_FCD_Orig_Text);

        default: 
            name = ""; 
            return NULL;
    }
    return NULL;

}
Beispiel #29
0
void addGendInfoForTest(TestNode** root)
{
    TESTCASE(TestGenderInfo);
}
Beispiel #30
0
int main( void )
{
    TESTCASE(wctype("")   == 0);
    TESTCASE_NOREG(wctype(NULL) == 0); // mingw libc crashes on this

    TESTCASE(wctype("alpha")  != 0);
    TESTCASE(wctype("alnum")  != 0);
    TESTCASE(wctype("blank")  != 0);
    TESTCASE(wctype("cntrl")  != 0);
    TESTCASE(wctype("digit")  != 0);
    TESTCASE(wctype("graph")  != 0);
    TESTCASE(wctype("lower")  != 0);
    TESTCASE(wctype("print")  != 0);
    TESTCASE(wctype("punct")  != 0);
    TESTCASE(wctype("space")  != 0);
    TESTCASE(wctype("upper")  != 0);
    TESTCASE(wctype("xdigit") != 0);

    TESTCASE_NOREG(wctype("alpha")  == _PDCLIB_CTYPE_ALPHA);
    TESTCASE_NOREG(wctype("alnum")  == (_PDCLIB_CTYPE_ALPHA | _PDCLIB_CTYPE_DIGIT));
    TESTCASE_NOREG(wctype("blank")  == _PDCLIB_CTYPE_BLANK);
    TESTCASE_NOREG(wctype("cntrl")  == _PDCLIB_CTYPE_CNTRL);
    TESTCASE_NOREG(wctype("digit")  == _PDCLIB_CTYPE_DIGIT);
    TESTCASE_NOREG(wctype("graph")  == _PDCLIB_CTYPE_GRAPH);
    TESTCASE_NOREG(wctype("lower")  == _PDCLIB_CTYPE_LOWER);
    TESTCASE_NOREG(wctype("print")  == (_PDCLIB_CTYPE_GRAPH | _PDCLIB_CTYPE_SPACE));
    TESTCASE_NOREG(wctype("punct")  == _PDCLIB_CTYPE_PUNCT);
    TESTCASE_NOREG(wctype("space")  == _PDCLIB_CTYPE_SPACE);
    TESTCASE_NOREG(wctype("upper")  == _PDCLIB_CTYPE_UPPER);
    TESTCASE_NOREG(wctype("xdigit") == _PDCLIB_CTYPE_XDIGT);
    return TEST_RESULTS;
}