The first calloc test in libft-unit-test tester timeouts on my laptop but not in school.
I looked at the test, and I think that the problem is in the test rather than in my code. In all other calloc tester functions the pointer to the tested function is casted to typeof(calloc)* like this but in test_ft_calloc_free it is casted to void *(*)(size_t) like this. Later it is called with one param. But that's UB because ft_calloc has 2 params.
The first calloc test in libft-unit-test tester timeouts on my laptop but not in school.
I looked at the test, and I think that the problem is in the test rather than in my code. In all other calloc tester functions the pointer to the tested function is casted to
typeof(calloc)*
like this but intest_ft_calloc_free
it is casted tovoid *(*)(size_t)
like this. Later it is called with one param. But that's UB becauseft_calloc
has 2 params.I suggest replacing
with
or whatever value of the second parameter makes sense.
First reported here by @Oktosha https://github.com/xicodomingues/francinette/issues/15