-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex06.c
35 lines (26 loc) · 925 Bytes
/
ex06.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <unistd.h>
#include <stdio.h>
#include "../ex06/ft_str_is_printable.c"
int ft_str_is_printable(char *str);
int main(void) {
char stringPrintable[] = {'A','z','0','9','~'};
char stringNonPrintable[] = {0x07,0x01,0x37};
char empty[] = "";
printf("\nstringPrintable = %s \n\n",stringPrintable);
printf("Calling ft_str_is_printable(stringPrintable);\n");
if (ft_str_is_printable(stringPrintable))
printf("PASS Printable String Test (1)\n");
else
printf("FAIL Printable String Test (0)\n");
printf("\nCalling ft_str_is_printable(stringNonPrintable);\n");
if (ft_str_is_printable(stringNonPrintable))
printf("FAIL Non Printable String Test (1)\n");
else
printf("PASS Non Printable String Test (0)\n");
printf("\nCalling ft_str_is_printable(empty);\n");
if (ft_str_is_printable(empty))
printf("PASS Empty Strirg Test (1)\n");
else
printf("FAIL Empty String Test (0)\n");
return (0);
}