#!/usr/bin/expect -f ######################################################################### # # # ELEC2041 Experiment 3 Checkpoint 7 (Positional Division v1) # # # ######################################################################### # Author: John Zaitseff # Date: 26th June, 2003 # Version: 2.2 # This script automatically checks the program for ELEC2041 Experiment 3 # Checkpoint 7. The default executable filename is posn-div-v1.elf. # # Usage: # checkit-exp3-7 [executable_filename] ######################################################################### # Global variables set default_executable "posn-div-v1.elf" set use_simulator 1 # Specify the checks that are to be made on the executable file proc run_checks {} { # This procedure defines the checks that are to be run on the # debugger. It is called once the program (executable file) has been # loaded into memory and has been run as far as the "_start" label. do_p "Calling posndiv( 10, 0) " \ {p posndiv(10,0)} "-1" do_p "Calling posndiv( 10, -1) " \ {p posndiv(10,-1)} "-1" do_p "Calling posndiv( -10, 1) " \ {p posndiv(-10,1)} "-1" do_p "Calling posndiv( 0, 3) " \ {p posndiv(0,3)} "0" do_p "Calling posndiv( 42, 1) " \ {p posndiv(42,1)} "42" do_p "Calling posndiv( 42, 4) " \ {p posndiv(42,4)} "10" do_p "Calling posndiv( 42, 420) " \ {p posndiv(42,420)} "0" do_p "Calling posndiv( 6552, 156) " \ {p posndiv(6552,156)} "42" do_p "Calling posndiv( 2147483647, 43690) " \ {p posndiv(2147483647,43690)} "49152" do_p "Calling posndiv( 2147483647, 21845) " \ {p posndiv(2147483647,21845)} "98305" do_p "Calling posndiv( 2147483647, 524287) " \ {p posndiv(2147483647,524287)} "4096" do_p "Calling posndiv( 1073741823, 1) " \ {p posndiv(1073741823,1)} "1073741823" do_p "Calling posndiv( 1073741823, 255) " \ {p posndiv(1073741823,255)} "4210752" } # Invoke the CheckIt system library script (which must be in the same # directory as this script) source [file join [file dirname $argv0] "checkit-library"] exit 1