From 33d02b57f42499bbdca76a48a9ed2cea3a843f31 Mon Sep 17 00:00:00 2001 From: Sabine linguanotto Date: Wed, 26 Feb 2020 13:45:53 +0100 Subject: [PATCH] avancement mise en forme tests exhaustifs --- main.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index 36aaf5c..01beaa9 100644 --- a/main.c +++ b/main.c @@ -121,7 +121,7 @@ int ft_printf_test(char *string, ...) /* ** this is the main function of tests, with a loooooot of tests, enjoy ;) -** if you call the executable without arguments, it will print the rules +** if you call the executable without arguments, it will print the usage ** otherwise you can add one of three keywords : ** "man" for the very beginner tests ** "test" for the debug tests while building the programm @@ -141,6 +141,17 @@ int main(int ac, char **av) /* PREMISES TESTS WITH AV_ARG BASED ON MAN EXEMPLE */ /* ////////////////////////////////////////////////////////////////// */ + if (ac == 1) + { + printf("USAGE:\n"); + printf("call ./ft_printf with arguments to launch tests\n"); + printf("./ft_printf man [launch the tests found in the man page]\n"); + printf("./ft_printf test [launch the tests used to debug]\n"); + printf("./ft_printf all [launch the exhaustive tests]\n"); + printf("./ft_printf all basic [launch the basic part of exhaustive tests]\n"); + printf("./ft_printf all basic [launch the basic part of exhaustive tests]\n"); + } + if (ac == 2 && !strcmp(av[1], "man")) { char *str = "diuxXcsefg"; @@ -231,14 +242,11 @@ int main(int ac, char **av) i = 6; printf("-----------------------------------------------\n"); - printf("- BASICS -\n"); - printf("- -\n"); - printf("- %%[flag][width][.precision][length]specifier -\n"); - printf("- -\n"); - printf("- conversions : cspdiuxX%% -\n"); - printf("- flags : -,0,.,* -\n"); - printf("- taille de champ minimale -\n"); - printf("- -\n"); + printf("BASICS\n\n"); + printf("%%[flag][width][.precision][length]specifier\n"); + printf("conversions : cspdiuxX%%\n"); + printf(" flags : -,0,.,*\n"); + printf("taille de champ minimale\n"); printf("-----------------------------------------------\n"); printf("-----------------------------------------------\n"); printf("- conversions : cspdiuxX%% -\n");