Esempio n. 1
0
File: main.c Progetto: jwalle/libASM
/*
void	test_putstr(void)
{
	char	str[] = "PUTSTR";
	printf("\033[1;33m%s\033[0m\n", str);
	ft_putstr("Bonjour");
	ft_putstr(" les");
	ft_putstr(" amis");
	ft_putstr(" !");
	ft_putstr("\n");
	ft_putstr(NULL);
	ft_putstr("\n");
	printf("\033[1;32m%s passed.\033[0m\n\n", str);
}

void	test_add(void)
{
//This function adds i & j
	char	str[] = "ADD";

	printf("\033[1;33m%s\033[0m\n", str);
	printf("3 + 5 = %d\n", ft_add(3, 5));
	printf("39 + 39 = %d\n", ft_add(39, 39));
	printf("0 + 0 = %d\n", ft_add(0, 0));
	printf("0 + (-100) = %d\n", ft_add(0, -100));
	printf("\033[1;32m%s passed.\033[0m\n\n", str);
}

void	test_mult(void)
{
//This function multiplies i & j
	char	str[] = "MULT";

	printf("\033[1;33m%s\033[0m\n", str);
	printf("3 * 5 = %d\n", ft_mult(3, 5));
	printf("39 * 39 = %d\n", ft_mult(39, 39));
	printf("-3 * -1000 = %d\n", ft_mult(-3, -1000));
	printf("0 * (-100) = %d\n", ft_mult(0, -100));
	printf("\033[1;32m%s passed.\033[0m\n\n", str);
}

void	test_putstr_fd(void)
{
	char	str[] = "PUTSTR_FD";
	printf("\033[1;33m%s\033[0m\n", str);
	ft_putstr_fd("Bonjour", 2);
	ft_putstr_fd(" les", 1);
	ft_putstr_fd(" amis", 2);
	ft_putstr_fd(" !", 1);
	ft_putstr_fd("\n", 3);
	ft_putstr_fd(NULL, 1);
	ft_putstr_fd("\n", 1);
	printf("\033[1;32m%s passed.\033[0m\n\n", str);
}

void	test_strclr(void)
{
	char	str[] = "STRCLR";
	char	str1[] = "COUCOU";
	char	str2[] = "LES";
	printf("\033[1;33m%s\033[0m\n", str);
	
	printf("%s et %s deviennent :  \n", str1, str2);
	ft_strclr(str1);
	ft_strclr(str2);
	printf("%s et %s\n", str1, str2);
	printf("\033[1;32m%s passed.\033[0m\n\n", str);
}
*/
int		main(void)
{
	test_isascii();
	test_isdigit();
	test_isalpha();
	test_isalnum();
	test_isprint();
	test_bzero();
	//test_toupper();
	//test_tolower();
	test_strlen();
	test_strcat();
	test_memset();
	test_memcpy();
	test_puts();
	test_strdup();
	test_cat();
	printf("\n\n\033[1;32m  !!  BONUS  !!  \033[0m\n\n");
	//test_putstr();
	//test_add();
	//test_mult();
	//test_putstr_fd();
	//test_strclr();
	test_strnew();
	test_putchar();
	return (0);
}
Esempio n. 2
0
int			main(void)
{
	set(MAGENTA);
	set(BOLD);
	printf("\n\t\t\t\t\t\t\t\t=============== FUNCTIONS ===============\n\n");
	set(UNCOLOR);
	test_bzero();
	test_strcat();
	test_isalpha();
	test_isdigit();
	test_isalnum();
	test_isascii();
	test_isprint();
	test_toupper();
	test_tolower();
	test_puts();
	test_strlen();
	test_memset();
	test_memcpy();
	test_strdup();

	set(MAGENTA);
	set(BOLD);
	printf("\t\t\t\t\t\t\t\t================= BONUS =================\n\n");
	set(UNCOLOR);
	test_islower();
	test_isupper();
	test_strcpy();
	test_putchar();
	test_putstr();
	return (0);
}
Esempio n. 3
0
int
main (int argc, char* argv[])
{
#if __FUNCTION__ != main
# error your compiler system does not define __FUNCTION__.
#endif
	/* Avoid NLS nuisances.  */
	(void) setlocale (LC_ALL, "POSIX");
	
	test_isalnum_macro ();
	test_isalpha_macro ();
	test_isascii_macro ();
	test_iscntrl_macro ();
	test_isdigit_macro ();
	test_isgraph_macro ();
	test_isprint_macro ();
	test_ispunct_macro ();
	test_isspace_macro ();
	test_isupper_macro ();
	test_isxdigit_macro ();
	test_isblank_macro ();
	
	test_isalnum ();
	test_isalpha ();
	test_isascii ();
	test_iscntrl ();
	test_isdigit ();
	test_isgraph ();
	test_isprint ();
	test_ispunct ();
	test_isspace ();
	test_isupper ();
	test_isxdigit ();
	test_isblank ();
	
	test_toascii_macro ();
	test__toupper_macro ();
	test__tolower_macro ();
	
	test_toascii ();
	test__toupper ();
	test__tolower ();

#ifdef __MINT__	
	test_toint_macro ();
	test_isodigit_macro ();
	test_iscymf_macro ();
	test_iscym_macro ();
#endif
	
	test_toupper ();
	test_tolower ();
	
	return 0;
}
Esempio n. 4
0
File: main.c Progetto: ptitmax/42
int main()
{
	test_isalpha();
	test_isdigit();
	test_isalnum();
	test_isascii();
	test_isprint();
	test_tolower();
	test_toupper();
	test_bzero();
	test_strcat();
	test_strlen();
	test_memset();
	test_memcpy();
	test_puts();
	test_strdup();
	test_strcmp();
	test_cat();
	test_isspace();
}
Esempio n. 5
0
int		main(void)
{
#ifdef TEST_ATOI	
# ifdef DEP
# endif
	test_atoi();
#endif
#ifdef TEST_ABSOLUTE
# ifdef DEP
# endif
	test_absolute();
#endif
#ifdef TEST_BZERO
# ifdef DEP
# endif
	test_bzero();
#endif
#ifdef TEST_ISALNUM
# ifdef DEP
# endif
	test_isalnum();
#endif
#ifdef TEST_ISALPHA
# ifdef DEP
# endif
	test_isalpha();
#endif
#ifdef TEST_ISASCII
# ifdef DEP
# endif
	test_isascii();
#endif
#ifdef TEST_ISDIGIT
# ifdef DEP
# endif
	test_isdigit();
#endif
#ifdef TEST_ISLOWER
# ifdef DEP
# endif
	test_islower();
#endif
#ifdef TEST_ISPRINT
# ifdef DEP
# endif
	test_isprint();
#endif
#ifdef TEST_ISUPPER
# ifdef DEP
# endif
	test_isupper();
#endif
#ifdef TEST_ITOA
# ifdef DEP
# endif
	test_itoa();
#endif
#ifdef TEST_LSTNEW
# ifdef DEP
# endif
	test_lstnew();
#endif
#ifdef TEST_LSTADD
# ifdef DEP
	printf("/!\\ ft_lstadd() requires ft_lstnew(). /!\\\n");
# endif
	test_lstadd();
#endif
#ifdef TEST_LSTDELONE
# ifdef DEP
# endif
	test_lstdelone();
#endif
#ifdef TEST_LSTDEL
# ifdef DEP
	printf("/!\\ ft_lstdel() requires ft_lstdelone.  /!\\\n");
# endif
	test_lstdel();
#endif
#ifdef TEST_LSTMAP
# ifdef DEP
	printf("/!\\ ft_lstmap() requires ft_memalloc(). /!\\\n");
# endif
	test_lstmap();
#endif
#ifdef TEST_LSTITER
# ifdef DEP
# endif
	test_lstmap();
#endif
#ifdef TEST_MEMALLOC
	test_memalloc();
#endif
#ifdef TEST_MEMDEL
	test_memdel();
#endif
#ifdef TEST_MEMCPY
	test_memcpy();
#endif
#ifdef TEST_MEMCCPY
	test_memccpy();
#endif
#ifdef TEST_MEMCHR
	test_memchr();
#endif	
#ifdef TEST_MEMCMP
	test_memcmp();
#endif
	return (0);
}
Esempio n. 6
0
int		main(void)
{
	printf("\n");

	printf ("\033[31m1 = Oui / 0 = Non\n\n\033[0m");
	
	printf("\033[33m=== FT_BZERO   ===\n\033[0m");

		test_bzero();
		printf("\n");
	
	printf("\033[33m=== FT_STRCAT  ===\n\033[0m");	
	
		test_strcat();
		printf("\n");

	printf("\033[33m=== FT_ISALPHA ===\n\033[0m");
	
		test_isalpha();
		printf("\n");

	printf("\033[33m=== FT_ISDIGIT ===\n\033[0m");
	
		test_isdigit();
		printf("\n");

	printf("\033[33m=== FT_ISALNUM ===\n\033[0m");
	
		test_isalnum();
		printf("\n");

	printf("\033[33m=== FT_ISASCII ===\n\033[0m");
	
		test_isascii();
		printf("\n");

	printf("\033[33m=== FT_ISPRINT ===\n\033[0m");

		test_isprint();
		printf("\n");
	printf("\033[33m=== FT_TOUPPER ===\n\033[0m");

		test_toupper();
		printf("\n");

	printf("\033[33m=== FT_TOLOWER ===\n\033[0m");

		test_tolower();
		printf("\n");

	printf("\033[33m=== FT_PUTS ===\n\033[0m");

		test_puts();
		printf("\n");

	printf("\033[33m=== FT_STRLEN ===\n\033[0m");

		test_strlen();
		printf("\n");

	printf("\033[33m=== FT_MEMSET ===\n\033[0m");	

		test_memset();
		printf("\n");

	printf("\033[33m=== FT_STRDUP ===\n\033[0m");

		test_strdup();
		printf("\n");

	printf("\033[33m=== FT_MEMCPY ===\n\033[0m");

		test_memcpy();
		printf("\n");
	
	printf("\033[33m=== FT_CAT ===\n\033[0m");

		test_cat();
		printf("\n");
	return (0);
}