R. Clayton (rclayton@clayton.cs.monmouth.edu)
Wed, 17 Jan 2001 19:01:09 -0500 (EST)
I finally managed to get a clean test run for assignment 6, but I still have to
grade the results. I will tell you when your grades are ready; do not bother
me for your grades before I tell you they are ready.
One person's code passed all the tests; another couple of people probably
passed all the tests once I get a chance to see why their code didn't work.
For those of you that are interested, what follows is an annotated script of
the test and the results of a perfect run. The script itself is indented two
spaces; comments are flush left.
--Your program should always handle the empty case properly, which usually means either printing an error message or generating code that handles no commands. It does not mean core-dumping or producing code that doesn't compile.
$ gen-cmds < /dev/null > cmds.cc
$ g++ -c cmds.cc
A test to see if the empty input string was handled properly. The output should be "red", "white", and "blue".
$ echo red white blue | gen-cmds > cmds.cc
$ g++ -c cmds.cc
$ g++ -o test-cmds ../../empty.cc cmds.o
A test to crash the code of people who've been ignoring my semester-long advice to not use char * strings.
$ echo 8192-character command | gen-cmds > cmds.cc
$ g++ -c cmds.cc
A test to crash the code of people who use fixed-length arrays and then don't bother to check to see when they're running off the end of the array.
$ echo 8192 commands | gen-cmds > cmds.cc -rw------- 1 rclayton faculty 81475 Apr 17 11:40 cmds.cc
$ g++ -c cmds.cc
A test to see how case-insensitive input was handled. The output should be a one of the five alphas, because duplicates should have been eliminated (if you did it that way; a few people printed an error message and exited, which was ok).
$ echo Alpha aLpha alPha alpHa alphA | gen-cmds > cmds.cc
$ g++ -o test-cmds ../../empty.cc cmds.cc
$ test-cmds
$ echo alpha | test-cmds
Same test as before, except without case conversions; the output should be one alpha.
$ echo alpha alpha alpha alpha alpha | gen-cmds > cmds.cc
$ g++ -o test-cmds ../../empty.cc cmds.cc
A test to see how well prefix matching was implemented. Each input should produce one less output than the test before; the first test should produce all commands.
$ echo ! !@ !@# !@#$ !@#$% | gen-cmds > cmds.cc
$ g++ -o test-cmds ../../empty.cc cmds.cc
$ echo ! | test-cmds $ echo !@ | test-cmds $ echo !@# | test-cmds $ echo !@#$ | test-cmds $ echo !@#$% | test-cmds $ echo !@#$%^ | test-cmds
A test to see if people used extra files or not.
$ ulimit -n 0 -f 0 ; test-cmds
A test to see if code managed memory properly.
$ echo 1000 256-character commands | gen-cmds > cmds.cc -rw------- 1 rclayton faculty 265555 Apr 17 11:41 cmds.cc
$ g++ -o exhaust-cmds ../../exhaust.cc cmds.cc
$ exhaust-cmds
This archive was generated by hypermail 2.0b3 on Thu May 17 2001 - 12:00:05 EDT