Testing isprint()
This commit is contained in:
parent
61486dac3a
commit
26fe85d7ac
3 changed files with 29 additions and 4 deletions
8
Makefile
8
Makefile
|
|
@ -6,7 +6,7 @@
|
||||||
# By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ #
|
# By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2025/10/03 18:03:12 by lalgarra #+# #+# #
|
# Created: 2025/10/03 18:03:12 by lalgarra #+# #+# #
|
||||||
# Updated: 2025/10/03 18:10:11 by lalgarra ### ########.fr #
|
# Updated: 2025/10/03 18:33:44 by lalgarra ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
|
|
@ -16,14 +16,14 @@ LIBDIR = ../repo_libft_algarra
|
||||||
|
|
||||||
CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) -L$(LIBDIR) -lft
|
CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) -L$(LIBDIR) -lft
|
||||||
|
|
||||||
TESTS:= isalpha_test isdigit_test isalnum_test isascii_test
|
TESTS:= isalpha_test isdigit_test isalnum_test isascii_test \
|
||||||
|
isprint_test
|
||||||
|
|
||||||
%_actual.output : %_test
|
%_actual.output : %_test
|
||||||
@./$*_test > ./$*_actual.output ;
|
@./$*_test > ./$*_actual.output ;
|
||||||
|
|
||||||
%_report : %_test %_actual.output
|
%_report : %_test %_actual.output
|
||||||
-(diff -a $*_expected.output $*_actual.output && \
|
-(diff -a $*_expected.output $*_actual.output && echo "Test OK") > $*_report
|
||||||
echo "Test OK") > $*_report
|
|
||||||
|
|
||||||
EXES = $(TESTS)
|
EXES = $(TESTS)
|
||||||
|
|
||||||
|
|
|
||||||
BIN
isprint_expected.output
Normal file
BIN
isprint_expected.output
Normal file
Binary file not shown.
25
isprint_test.c
Normal file
25
isprint_test.c
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* isprint_test.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/10/03 18:27:44 by lalgarra #+# #+# */
|
||||||
|
/* Updated: 2025/10/03 18:39:12 by lalgarra ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "libft.h"
|
||||||
|
#include<stdio.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int p1;
|
||||||
|
|
||||||
|
for (p1 = 0; p1 < 256; p1++)
|
||||||
|
{
|
||||||
|
printf("'%c' (%i); isprint(c)!=0: %i\r\n", p1, p1, isprint(p1)!=0);
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue