From 35684b699b19fb68dc59a676d3913eeb531a9aa3 Mon Sep 17 00:00:00 2001 From: Felix Jankowski Date: Thu, 17 Jan 2019 23:27:01 -0800 Subject: [PATCH] Merge Pull Request #1 --- README.md | 3 +-- config_d05.pl | 2 ++ config_d07.pl | 10 +++++++++- config_d11.pl | 36 ++++++++---------------------------- 4 files changed, 20 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index fdf762a..882a4f0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## 42 Test-monial +## 42 Test-Monial An easy-to-use test suit for most of 42 Piscine C problems. @@ -11,4 +11,3 @@ Suppose you're checking Day 06 answers: - Clone a student's work repo to a folder named d06 - Enter this project's folder: `cd 42-testimonial` - Run `./run 06` - diff --git a/config_d05.pl b/config_d05.pl index 9940389..e081db9 100644 --- a/config_d05.pl +++ b/config_d05.pl @@ -160,6 +160,8 @@ main -m ==== char str[] = "salut, comment tu vas ? 42mots quarante-deux; cinquante+et+un"; printf("%s", ft_strcapitalize(str)); +char str2[] = "asdf-qWeRtY ZXCV 100TIS"; +printf("%s", ft_strcapitalize(str2)); ==== check -e ==== $expected = 'Salut, Comment Tu Vas ? 42mots Quarante-Deux; Cinquante+Et+Un'; ==== diff --git a/config_d07.pl b/config_d07.pl index fee6dd7..0289de3 100644 --- a/config_d07.pl +++ b/config_d07.pl @@ -20,6 +20,8 @@ ex01 int* ft_range(int min, int max) main -m ==== +#include +#include int* res; int i; res = ft_range(5, 10); @@ -38,7 +40,7 @@ printf("\n"); res = ft_range(10, 5); -printf("%x\n", (unsigned int)res); +printf("%" PRIxPTR "\n", (uintptr_t) res); ==== check -e ==== $expected = '5,6,7,8,9, -20,-19,-18,-17,-16, @@ -57,6 +59,7 @@ size = ft_ultimate_range(&res, 5, 10); printf("is_null? %d\n", res == NULL); +printf("size is %i\n", size); for (i = 0; i < 5; i++) printf("%d,", res[i]); printf("\n"); @@ -64,6 +67,7 @@ res = NULL; size = ft_ultimate_range(&res, -20, -17); printf("is_null? %d\n", res == NULL); +printf("size is %i\n", size); for (i = 0; i < 3; i++) printf("%d,", res[i]); printf("\n"); @@ -71,12 +75,16 @@ res = (int*)1; size = ft_ultimate_range(&res, 10, 5); printf("is_null? %d\n", res == NULL); +printf("size is %i\n", size); ==== check -e ==== $expected = 'is_null? 0 +size is 5 5,6,7,8,9, is_null? 0 +size is 3 -20,-19,-18, is_null? 1 +size is 0 '; ==== diff --git a/config_d11.pl b/config_d11.pl index 007da42..b528a5a 100644 --- a/config_d11.pl +++ b/config_d11.pl @@ -229,13 +229,13 @@ } ==== check -t ==== %tests = ( - "$program" => "\n", - "$program asdf" => "asdf,\n", - "$program asdf qwer" => "qwer,asdf,\n", - "$program asdf qwer zxcv" => "zxcv,qwer,asdf,\n", - "$program ''" => ",\n", - "$program 15 '' 25" => "25,,15,\n", - "$program wat" => "wat,\n", + "$program" => "$program,\n", + "$program asdf" => "asdf,$program,\n", + "$program asdf qwer" => "qwer,asdf,$program,\n", + "$program asdf qwer zxcv" => "zxcv,qwer,asdf,$program,\n", + "$program ''" => ",$program,\n", + "$program 15 '' 25" => "25,,15,$program,\n", + "$program wat" => "wat,$program,\n", ); ==== @@ -278,7 +278,7 @@ l->next->next = CE("zxcv"); t_list* addresses[] = {l, l->next, l->next->next}; qsort(addresses, 3, sizeof(t_list*), (int(*)(const void*, const void*))compare_ints); - + ft_list_clear(&l); // verify that this is set to a null pointer now printf("is null? %p\n", l); @@ -948,23 +948,3 @@ "$program zxcv doop qwer asdf uiop hjkl vbnm" => "vbnm,hjkl,uiop,asdf,qwer,doop,zxcv,\n", ); ==== - - - - - - - - - - - - - - - - - - - -