Skip to content

Commit

Permalink
Merge Pull Request #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Jankowski committed Jan 18, 2019
1 parent ba3869d commit 35684b6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 42 Test-monial
## 42 Test-Monial

An easy-to-use test suit for most of 42 Piscine C problems.

Expand All @@ -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`

2 changes: 2 additions & 0 deletions config_d05.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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';
====
Expand Down
10 changes: 9 additions & 1 deletion config_d07.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
ex01
int* ft_range(int min, int max)
main -m ====
#include <stdint.h>
#include <inttypes.h>
int* res;
int i;
res = ft_range(5, 10);
Expand All @@ -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,
Expand All @@ -57,26 +59,32 @@

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");

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");

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
';
====

Expand Down
36 changes: 8 additions & 28 deletions config_d11.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
====

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -948,23 +948,3 @@
"$program zxcv doop qwer asdf uiop hjkl vbnm" => "vbnm,hjkl,uiop,asdf,qwer,doop,zxcv,\n",
);
====




















0 comments on commit 35684b6

Please sign in to comment.