prosyslab-classroom / cs348-information-security

60 stars 10 forks source link

[Question][Hw1] Testing Procedure Details #260

Closed anisrashidov closed 1 year ago

anisrashidov commented 1 year ago

Name: Anis Rashidov

Could you explain me how make test works?? I don't get the comparison it makes and it's output is a little confusing.

KAIST-JongchanPark commented 1 year ago

How make test works:

  1. run your implementation for each testcases
  2. save each stdout result into output files. (@@@.output)
  3. get a diff between output and expected result (diff @@@.output @@@.expected)
anisrashidov commented 1 year ago

Could you be more specific please? So what I do is I run make test command and then I run individual commands for each functions like: ./aes enc test/key.txt test/iv.txt test/helloworld.txt. But I don't get it either

KAIST-JongchanPark commented 1 year ago

Only executing command make test does automatically comparing diff between your output and expected result.

If you want to check each test case, following step would be better.

  1. run build command make
  2. run testcase command ./aes enc test/key.txt test/iv.txt test/helloworld.txt 2.1 if you want to save your stdout, use redirection. (i.e., ./aes enc test/key.txt test/iv.txt test/helloworld.txt > test/helloworld.output
  3. compare your output with expected result. diff helloworld.output helloworld.expected 3.1. if you want to know exact byte value, use external tool like xxd
KAIST-JongchanPark commented 1 year ago

and please make your title with brief information about your question. It would be helpful for other students :D

KihongHeo commented 1 year ago

Please open if you have more questions.