예제 #1
0
 bool parse(Iterator& f, Iterator const& l, Attribute& a) const {
   if (f == l || !test_char(*f, CharClass{}))
     return false;
   detail::absorb(a, *f);
   ++f;
   return true;
 }
예제 #2
0
int
main()
{
  test_char();

  return 0;
}
예제 #3
0
int main( void )
{
    test_char();
    test_foo();
    test_many();
    
    return 0;
}
예제 #4
0
파일: case.c 프로젝트: lilin5819/win
int main(int argc, char const* argv[])
{
    int ch;
    printf("请输入一个字符\n");
    scanf("%c",&ch);
    printf("char ch=%d\n",ch);
    test_char(ch);
    return 0;
}
예제 #5
0
파일: add.c 프로젝트: wgtdkp/wgtcc
int main() {
  test_char();
  test_uchar();
  test_short();
  test_ushort();
  test_int();
  test_uint();
  test_long();
  test_ulong();
  test_float();
  test_double();
  return 0;
}
예제 #6
0
int main( int argc , char ** argv) {
  test_empty();
  test_char();
  test_join();
  test_reverse();
  test_iget_as_int();
  test_iget_as_bool();
  test_iget_as_double();
  test_split();
  test_matching();
  test_unique();
  test_predicate_matching();
  exit(0);
}
예제 #7
0
int main(int argc, char *argv[]) {
	test_long();
	test_int();
	test_short();
	test_char();
	test_unsigned_long();
	test_unsigned_int();
	test_unsigned_short();
	test_unsigned_char();
#if 0
	test_unsigned_long_long();
	test_long_long();
#endif
	return 0;
}
예제 #8
0
int main()
{
    int ret;
#ifdef HELLO_WORLD
    ret = print_hellword();
 #endif // HELLO_WORLD

 #ifdef FAHR_TO_CELSIUS
    ret = fahr_to_celsius();
 #endif // FAHR_TO_CELSIUS

 #ifdef FILE_COPY
    ret = file_copy();
 #endif // FILE_COPY

#ifdef TEST_CHAR
    ret = test_char();
#endif // TEST_CHAR

#ifdef CHAR_COUNTING
    ret = char_counting();
#endif // CHAR_COUNTING

#ifdef LINE_COUNTING
    ret = line_counting();
#endif // LINE_COUNTING

#ifdef FUNC_PL
    struct pl_ops *func_pl;
    func_pl = pl_setup();
    func_pl->arrays();
#endif // FUNC_PL

#ifdef FUNC_PL_TEST
    char s1[] = "hello world";
    char *s2   = "hello world";

    printf("s1 is %d\n", sizeof(s1));
    printf("s2 is %d\n", sizeof(s2));
#endif // FUNC_PL_TEST
     ret = 0;
     if (ret > 0){
        printf("\nprint successfully!, result is 0x%x.\n", ret);
    }
}
예제 #9
0
int
main ( int argc, char *argv[] )
{
	int failed = 0;
	int ntest = 2;
	int i;
	newstr s;
	newstr_init( &s );

	/* ...core functions */
	for ( i=0; i<ntest; ++i )
		failed += test_empty( &s );

	/* ...adding functions */
	for ( i=0; i<ntest; ++i)
		failed += test_addchar( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_strcat( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_newstrcat( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_segcat( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_indxcat( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_cattodelim( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_prepend( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_pad( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_mergestrs( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_makepath( &s );

	/* ...copying functions */
	for ( i=0; i<ntest; ++i)
		failed += test_strcpy( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_newstrcpy( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_cpytodelim( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_segcpy( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_indxcpy( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_copyposlen( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_strdup();

	/* ...utility functions */
	for ( i=0; i<ntest; ++i)
		failed += test_findreplace( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_reverse( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_toupper( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_tolower( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_trimws( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_trim( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_case( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_newstrcmp( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_char( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_swapstrings( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_match( &s );

	newstr_free( &s );

	if ( !failed ) {
		printf( "%s: PASSED\n", progname );
		return EXIT_SUCCESS;
	} else {
		printf( "%s: FAILED\n", progname );
		return EXIT_FAILURE;
	}
	return EXIT_SUCCESS;
}
예제 #10
0
파일: main.c 프로젝트: txdv/cmark
static void
utf8(test_batch_runner *runner)
{
	// Ranges
	test_char(runner, 1, "\x01", "valid utf8 01");
	test_char(runner, 1, "\x7F", "valid utf8 7F");
	test_char(runner, 0, "\x80", "invalid utf8 80");
	test_char(runner, 0, "\xBF", "invalid utf8 BF");
	test_char(runner, 0, "\xC0\x80", "invalid utf8 C080");
	test_char(runner, 0, "\xC1\xBF", "invalid utf8 C1BF");
	test_char(runner, 1, "\xC2\x80", "valid utf8 C280");
	test_char(runner, 1, "\xDF\xBF", "valid utf8 DFBF");
	test_char(runner, 0, "\xE0\x80\x80", "invalid utf8 E08080");
	test_char(runner, 0, "\xE0\x9F\xBF", "invalid utf8 E09FBF");
	test_char(runner, 1, "\xE0\xA0\x80", "valid utf8 E0A080");
	test_char(runner, 1, "\xED\x9F\xBF", "valid utf8 ED9FBF");
	test_char(runner, 0, "\xED\xA0\x80", "invalid utf8 EDA080");
	test_char(runner, 0, "\xED\xBF\xBF", "invalid utf8 EDBFBF");
	test_char(runner, 0, "\xF0\x80\x80\x80", "invalid utf8 F0808080");
	test_char(runner, 0, "\xF0\x8F\xBF\xBF", "invalid utf8 F08FBFBF");
	test_char(runner, 1, "\xF0\x90\x80\x80", "valid utf8 F0908080");
	test_char(runner, 1, "\xF4\x8F\xBF\xBF", "valid utf8 F48FBFBF");
	test_char(runner, 0, "\xF4\x90\x80\x80", "invalid utf8 F4908080");
	test_char(runner, 0, "\xF7\xBF\xBF\xBF", "invalid utf8 F7BFBFBF");
	test_char(runner, 0, "\xF8", "invalid utf8 F8");
	test_char(runner, 0, "\xFF", "invalid utf8 FF");

	// Incomplete byte sequences at end of input
	test_incomplete_char(runner, "\xE0\xA0", "invalid utf8 E0A0");
	test_incomplete_char(runner, "\xF0\x90\x80", "invalid utf8 F09080");

	// Invalid continuation bytes
	test_continuation_byte(runner, "\xC2\x80");
	test_continuation_byte(runner, "\xE0\xA0\x80");
	test_continuation_byte(runner, "\xF0\x90\x80\x80");

	// Test string containing null character
	static const char string_with_null[] = "((((\0))))";
	char *html = cmark_markdown_to_html(string_with_null,
					    sizeof(string_with_null) - 1,
		                            CMARK_OPT_DEFAULT);
	STR_EQ(runner, html, "<p>((((" UTF8_REPL "))))</p>\n",
	       "utf8 with U+0000");
	free(html);
}
예제 #11
0
int main(int argc, char **argv)
{
    test_char();
    //fmt(argv[1]);
    return EXIT_SUCCESS;
}