// Name: Dana Steil // Written: 3/5/2002 // Description: Tests the Sorted List Class Template #include"SortedList.h" #include"TestType.h" #include #include using std::ofstream; using std::ifstream; using std::cin; using std::cout; void AddItem(CSortedList& TestList) { CTest Test; try { cin >> Test; TestList.Insert(Test); } catch (char* Exception) { cout << Exception << endl; } } void DeleteItem(CSortedList& TestList) { try { TestList.Delete(5); } catch (char* Exception) { cout << Exception << endl; } } void main() { CSortedList TestList; AddItem(TestList); AddItem(TestList); AddItem(TestList); AddItem(TestList); DeleteItem(TestList); cout << TestList; ////////////////Test writing to a file ofstream fout; fout.open("Junk.txt"); fout << TestList; fout.close(); ////////////////Test reading from file /* ifstream fin; fin.open("Junk.txt"); cin >> TestList; cout << TestList; fin.close(); */ }