alelievr / libft-unit-test

457 stars 88 forks source link

Some test that PASS on Unix FAIL on linux. #38

Closed Gabriel-Em closed 6 years ago

Gabriel-Em commented 6 years ago

I've run your tests on loads of libfts, mine as well while being at 42 using their computers, and everything seems to be okay, as in, tests pass, libfts are all green. Now, the problem is that when running the same tests on linux (after installing the packages, adding the so rule, installing whatever is still missing) some tests that PASS on Unix will FAIL on linux. Tests such as ft_isalpha, ft_isdigit, ft_isalnum (from any libft ever, be it mine, yours or others) and such which are really simple functions that are obviously correct. Since the code compares the results those functions return to the results some functions that you used return, and they fail ONLY on linux with the exact same libft that passed everything on Unix, wouldn't the problem be linux libraries related or something?

alelievr commented 6 years ago

Hello,

These results are totally normal, there are some differences in the implementation of these functions on mac and linux and as the man says, the return value is 0 if the condition matches else it's non-zero. On mac non-zero means 1 but not on linux so my comparisons are biased. This is fixed in the latest commit: 30e544a34878423544ce99ff53c201ea7e909da7

Gabriel-Em commented 6 years ago

Aight, I see, as I believed. Thanks for answering, I will close the issue.