Exemplo n.º 1
0
Arquivo: main.c Projeto: 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);
}
Exemplo 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);
}