Open tobyhw opened 5 years ago
Hello @tobyhw
Sorry for my (very) late answer.
Could you provide me a working example of the observed behavior? I am not in capacity to reproduce a differing behavior between moulitest "standalone" and moulitest "within 42FC"
I am getting different results running moulitest directly and running it through the 42FileChecker. I found that this is because in moulitest, they test
get_next_line(1, NULL)
line 10 in 05_test_error_handling.spec.cHowever, since 42FileChecker redirects the stdout (1) when it calls moulitest (
make "$1" -C "${MOULITEST_DIR}" 1> .mymoulitest 2>&1
in external_repository_moulitest.sh) the read in this test will always fail, so checking the NULL pointer protection does not work.To test that this is indeed the problem, I changed line 10 in moulitest to run
get_next_line(0, NULL)
instead and got the desired result, though it was slower because it waited for standard input that never came.I do not know if there is a way you could manage this from within 42FileChecker without changing moulitest, but if not, it may be worth implementing a test for a NULL pointer in your own tests. In my opinion, the ideal thing would be to test the NULL pointer with an fd that does exist and would otherwise return correctly.