/* Goal: Provide an interactive tester for the linked lists and associated functions all ready implemented * * Tester allows lists to be manipulated by selecting choices from a menu. All implemented functionality * of the lists can be used through the tester * * Functions used in the tester are: * int testAdd(list *dataList) * int testMoveCursor(list *dataList) * int testConcatenateList(list *dataList1) * int testReadFile(list *dataList) * int testFileOutput(list *dataList) * Full descriptions of these functions are given below * * Author: Nathan Corvino * * Created 2/9/00 * First fully working version 2/19/99 * Code cleaned up and additional comments added 2/23/99 * */ #include #include "list.c" /******************************** * List Tester Functions * ******************************** */ /***************************************************************************************************** * Purpose: to provide an interface with which to test the various add functions of the linked lists * * Parameters: the list on which to test the add functions * * Postconditions: an element was added to dataList as indicated by the user * * Returns: the return of the add function tested * *****************************************************************************************************/ int testAdd(list *dataList); /***************************************************************************************************** * Purpose: to test the cursor movement functions of the linked lists. Distance and direction can be * * specified * * Parameters: list *dataList: the list on which to test the cursor movement functions * * Postconditions: the cusror of dataList was moved as indicated by the user * * Returns: the return of the move function tested * *****************************************************************************************************/ int testMoveCursor(list *dataList); /***************************************************************************************************** * Purpose: to test the concatenateLists function of the linked lists. The second list is read from * * a file * * Parameters: list *dataList1: the list to which the list read from a file should be added * * Postconditions: dataList has the elements read from a file added to it * * Returns: 0 following successful operation * *****************************************************************************************************/ int testConcatenateList(list *dataList1); /***************************************************************************************************** * Purpose: to test the list reading function. If list given is empty, a list is automatically read * * from file. Otherwise, user can choose to append to list or cancel read * * Parameters: list *dataList: the list on which to test read list function * * Postconditions: the list is read is indicated by the usre (see above) * * Returns: 0 following successful operation * *****************************************************************************************************/ int testReadFile(list *dataList); /***************************************************************************************************** * Purpose: to test the file writing function implemented with linked lists. * * Parameters: list *dataList: the list to be written to file * * Postconditions: "listout.txt" contains the contents of dataList * * Returns: 0 following successful operation * *****************************************************************************************************/ int testFileOutput(list *dataList);