remzi-arpacidusseau / ostep-projects

Projects for an undergraduate OS course
4.2k stars 1.2k forks source link

Missing 6.in file in wcat utilities tests directory #38

Closed javieracevedo closed 2 years ago

javieracevedo commented 2 years ago

Hello, I ran the test-wcat.sh shell script and it returned the following output:

test 1: passed
test 2: passed
test 3: passed
test 4: passed
test 5: passed
test 6: 6.out incorrect
  what results should be found in file: tests/6.out
  what results produced by your program: tests-out/6.out
  compare the two using diff, cmp, or related tools to debug, e.g.:
  prompt> diff tests/6.out tests-out/6.out
  See tests/6.run for what is being run

I ran wcat myself and passed tests/6.out as an argument and saw that it did return the right output. So, I opened tests/6.run to see what is being run and noticed that it calls wcat with tests/6.in as argument, but I don't see that file there, I do see .in files for the other tests, but not for test 6. Am I missing something?.

Thanks!

erictt commented 2 years ago

if you check 6.desc, you should know that the test for 6 is to test non-exist file. So 6.in is supposed to not exist, and you should make sure your code can deal with this situation.

javieracevedo commented 2 years ago

Oh I see. I was using perror() to display the error message, which concatenates more information to the output string, so it was not matching with the expected string I think.

Thanks!