jgigault / 42FileChecker

42FileChecker is a tiny bash script developed at 42 school for testing and checking files according to the rules of the subjects
Apache License 2.0
306 stars 56 forks source link

[NEW TEST LIBFT]Find untested case #122

Closed AbcSxyZ closed 5 years ago

AbcSxyZ commented 6 years ago

I found errors due to lack of tests, moulinette and 42 file checker seem to doesn't test it. First for ft_strtrim whith a single character, like ft_strtrim("W"), 1 error found on someone's code.

Secondly, for the function ft_lstnew, a wrong allocation of content won't be shown by 42 FC (and moulinette), the problem is an allocation like that lst->content = malloc(sizeof(content_size)) instead of lst->content = malloc(content_size)

Edit: new bug found, on ft_strsplit, someone did a trim on the beginning of the first string and at the end of the last string of his array. Better comparaison or more test should be done.

+ Optionnaly : for a ft_lstiter, function was applied from the end to start of the list. It's not clear if it's really a mistake, but you could add test for it if you want

jgigault commented 5 years ago

Hello @AbcSxyZ and sorry for having not responded earlier.

You should create issues on repositories where tests are stored (42FC is not testing libft itself):

And what about create a pull request on those repositories in order to improve them?