/* 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); }
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); }
bool torture_local_replace(struct torture_context *ctx) { bool ret = true; ret &= test_ftruncate(); ret &= test_strlcpy(); ret &= test_strlcat(); ret &= test_mktime(); ret &= test_initgroups(); ret &= test_memmove(); ret &= test_strdup(); ret &= test_setlinebuf(); ret &= test_vsyslog(); ret &= test_timegm(); ret &= test_setenv(); ret &= test_strndup(); ret &= test_strnlen(); ret &= test_waitpid(); ret &= test_seteuid(); ret &= test_setegid(); ret &= test_asprintf(); ret &= test_snprintf(); ret &= test_vasprintf(); ret &= test_vsnprintf(); ret &= test_opendir(); ret &= test_readdir(); ret &= test_telldir(); ret &= test_seekdir(); ret &= test_dlopen(); ret &= test_chroot(); ret &= test_bzero(); ret &= test_strerror(); ret &= test_errno(); ret &= test_mkdtemp(); ret &= test_mkstemp(); ret &= test_pread(); ret &= test_pwrite(); ret &= test_getpass(); ret &= test_inet_ntoa(); ret &= test_strtoll(); ret &= test_strtoull(); ret &= test_va_copy(); ret &= test_FUNCTION(); ret &= test_MIN(); ret &= test_MAX(); ret &= test_socketpair(); ret &= test_strptime(); ret &= test_getifaddrs(); ret &= test_utime(); ret &= test_utimes(); ret &= test_memmem(); return ret; }
int main(void) { ft_puts("\033[33m\n/!\\Change test_is last value from '0' to '1'\ndirectly in main if you want to see tests details./!\\\n\033[00m"); test_is(isdigit, ft_isdigit, "isdigit", 0); test_is(isalnum, ft_isalnum, "isalnum", 0); test_is(isalpha, ft_isalpha, "isalpha", 0); test_is(isascii, ft_isascii, "isascii", 0); test_is(toupper, ft_toupper, "toupper", 0); test_is(tolower, ft_tolower, "tolower", 0); test_bzero(ft_bzero, "bzero", 10); test_strcat(ft_strcat, "strcat"); test_puts(ft_puts, "ft_puts"); test_strlen(ft_strlen, "strlen", 26); test_memset(ft_memset, "memset", 10); test_memcpy("memcpy", 26); test_strdup("strdup", 10); ft_puts(""); return (0); }
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(); }
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); }
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); }