Check50 works by running your program with specific inputs, then checking that your program produces some specific output, and/or returns a specific value. It will display the values given to your program as input, and the values your program returned as output.
Check50 will do this multiple times with different inputs to check that your program works correctly under various conditions.
Take the first error as an example (it looks different here because it's text, but its essentially the same output you get from check50).
0 Running... clang -o vigenere vigenere.c -lcs50 -lm. ✔
1 Expecting an exit code of 0. ✔
2 Running... ./vigenere a. ✔
3 Takes in standard input of a.
... but received the following on standard out instead — Your plaintext:
Going through it line by line:
0 Running... clang -o vigenere vigenere.c -lcs50 -lm. ✔
This means your program compiled, which is the correct behaviour.
1 Expecting an exit code of 0. ✔
This means your program ran, and returned 0
from a return
function somewhere. This is what check50 was expecting for this test so it correct.
2 Running... ./vigenere a. ✔
This is telling you that check50 ran your program vigenere
, passing the argument a
. This is exactly the same as if you had typed the command to run the program.
3 Takes in standard input of a.
... but received the following on standard out instead — Your plaintext:
This means your program was also given the value a
as input. At this point check50 is expecting your program to "take in standard input" the value of a
. However instead of just taking the input, your program instead outputted Your plaintext:
.
From this you could infer that your program should not output any prompt, but instead just wait for input using a function like getString()
.
Looking at the remaining errors, three others are reporting the same problem, just under different conditions. The final three errors are for a different reason, for example:
Expecting any sort of standard out. ... but received an exit code of 0
Here check50 is telling you that it's expecting your program to output some message, but the program is instead returning before outputting anything.