Exemplo n.º 1
0
int
main (int   argc,
      char *argv[])
{
    test_sprintf ();
    test_vsprintf ();
    test_strdup ();
    test_strndup ();
    test_strcat ();
    test_strncat ();
    test_strcat_sprintf ();
    test_strcat_vsprintf ();
    test_str_split ();
    test_array_new ();
    test_array_add ();
    test_array_addn ();
    test_array_addp ();
    test_array_copy ();
    test_array_append ();
    test_str_wrap ();
    test_str_screen_width ();
    test_str_screen_wrap ();

    return 0;
}
Exemplo n.º 2
0
int main()
{
	//strcpy
	printf("%d\n", test_strcpy("hello", 0));

	//strncpy
	printf("%d\n", test_strncpy("hellohellohello", 7, 0));
	printf("%d\n", test_strncpy("hello", 7, 0));
	printf("%d\n", test_strncpy("hellohello", 10, 0));

	//strcmp
	printf("%d\n", test_strcmp("aaa", "arc", 0));
	printf("%d\n", test_strcmp("abc", "abc", 0));
	printf("%d\n", test_strcmp("ccc", "abc", 0));

	//strncmp
	printf("%d\n", test_strncmp("aaaddd", "alcccc", 3, 0));
	printf("%d\n", test_strncmp("abcddd", "abcccc", 3, 0));
	printf("%d\n", test_strncmp("cccddd", "abcccc", 3, 0));

	//strcat
	printf("%d\n", test_strcat("world", "hello", 0));
	printf("%d\n", test_strcat("fg", "", 0));
	printf("%d\n", test_strcat("", "hello", 0));

	//strncat
	printf("%d\n", test_strncat("world", "hello", 3, 0));
	printf("%d\n", test_strncat("world", "hello", 10, 0));
	printf("%d\n", test_strncat("", "hello", 10, 0));

	//strlen
	printf("%d\n", test_strlen("", 0));
	printf("%d\n", test_strlen("hello", 0));

	//strchr
	printf("%d\n", test_strchr("world", 'r', 0));
	printf("%d\n", test_strchr("world", 'a', 0));
	printf("%d\n", test_strchr("", 'a', 0));

	//strstr
	printf("%d\n", test_strstr("world", "rl", 0));
	printf("%d\n", test_strstr("needle", "nee", 0));
	printf("%d\n", test_strstr("world", "hello", 0));


	return 0;
}
Exemplo n.º 3
0
int main(int argc, char **argv)
{
  test_strcmp();
  test_strcat();
  test_strstr();
  test_strncat();
  if (!nondet) crashes_gcc();
  test_strtok();
  test_strtok_r();
  return 0;
}
Exemplo n.º 4
0
int main(int argc, char **argv)
{
  test_strcmp();
  test_strcat();
  test_strstr();
  test_strncat();
  if (!nondet) crashes_gcc();
  test_strtok();
  test_strtok_r();
  char *a = strdup("bla"); // unsound; specification currently unsupported
  char *b = strndup("bla", 2); // unsound; specification currently unsupported
  return 0;
}
Exemplo n.º 5
0
int main(int argc, char** argv){
#ifdef USE_SECURE_LIB
	printf("USE secure lib\n");
#else
	printf("NOT USE secure lib\n");
#endif
	test_strncpy();
	test_strncat();
	test_strlen();
	test_snprintf();
	test_popen();
	test_usleep();
	return 0;
}
Exemplo n.º 6
0
int main()
{
	test_strchr();
	test_strcmp();
	test_strncmp();
	test_strcpy();
	test_strncpy();
	test_strcspn();
	test_strlen();
	test_strcat();
	test_strncat();
	test_strpbrk();
	test_strrchr();
	test_strspn();
	test_strstr();
	test_strtok();
	return 0;
}