Exemple #1
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;
}
Exemple #2
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;
}
Exemple #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();
  char *a = strdup("bla"); // unsound; specification currently unsupported
  char *b = strndup("bla", 2); // unsound; specification currently unsupported
  return 0;
}
Exemple #4
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;
}
Exemple #5
0
int main(int argc, char **argv)
{
  test_memcpy();
  test_memmove();
  test_strlen();
  test_strnlen();
  test_memset();
  test_strcmp();
  test_strncmp();
  test_memcmp();
  test_strcat();
  // strncat is not tested (code from the man page)
  test_strcpy();
  test_strncpy();
  test_strchr();
  test_strrchr();
  test_memchr();
  test_memrchr();
  test_strstr();
  // strerror not tested
  // strdup not tested (uses malloc)
  // strndup not tested (uses malloc)
  return 0;
}
Exemple #6
0
int main(int argc, char ** argv) {
    test_strstr();
    test_strtok();
    
    return 0;
}