-- Assignment : inClass program to test stack package -- Programmer : entire class -- Course : CS 240 -- Date : Sept. 21th, 2006 -- Compiler : gcc with gnat -- Professor : Elizabeth Adams -- Filename : stackTest.adb -- Executable : -- Version : 0.1 -- Purpose: test all of the methods in the stack package to see if they -- work as desired -- Input : integers to be pushed onto the stack -- Output -- messages telling what procedure/function is being tested (labels) -- data values being pushed onto and popped from stack -- data values at top of stack -- status of stack -- Modifications: -- -- Version 0.1 : WITH ada.text_io; WITH ada.integer_text_io; WITH stack; PROCEDURE stackTest is status: boolean; testStack : stack.stackType; -- the following two lines do not belong in THIS program and should be removed type fruit is (apple, berry, cherry, banana); myfruit : fruit; -- the following line is an instantiation for an enumerated type which allows us to read and -- write values of that type package boolean_io is new Ada.Text_io.Enumeration_io (boolean); -- the following line desn't belong in THIS program : it should be removed package fruit_io is new Ada.Text_io.Enumeration_io (fruit); BEGIN -- test the status of the stack to see if is empty ada.text_io.put ( " testing the status of the stack - expect it to be empty output should be TRUE "); -- call function status := stack.isEmpty (testStack); boolean_io.put (status); ada.text_io.new_line(1); -- the following lines desn't belong in THIS program : it should be removed myfruit := apple; fruit_io.put (myfruit); END stackTest;