m8pple / arch2-2019-cw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error codes -20 & -21 with respect to no binary input

seb-fenton opened this issue · comments

We are confused about the specifics of error codes -20 and -21, specifically with regard to the case in which no binary is passed as an argument to the simulator.

-20 is defined in the spec as an 'unknown error', i.e. something that is the simulator's fault such as not supporting a particular opcode. -21, meanwhile, is defined as an i/o error, i.e. something that is not the simulator's fault such as an environmental error.

Our confusion is due to the fact that, if no binary file is passed as a command line argument, this is neither the fault of the simulator, nor of the i/o, as it is both:

  • a valid input to the simulator from the i/o point of view
  • a unique case that throws an error in the simulator, but this is due to an i/o input as opposed to an internal simulator error

Our assumption given this information is that the exit code would either be 0, as nothing technically was wrong, or -20, as the i/o input is valid and thus the fault is technically in the simulator, but I am not entirely certain and would thus like clarification - especially if it is the case that one of the automated tests expects a certain response to no binary file input.

commented

I would classify this as an I/O error. It's certainly not an internal error (the simulator itself is not at fault), but is related to I/O (an error that occurs when reading from something that doesn't exist).