/////////////////////////////////////////////////////////////////// // // // qlpage1.cpp - qualification test #1 // // // // make_list process // // // /////////////////////////////////////////////////////////////////// // // // Process Description: // // Make_list process is reused software which builds a list // // of tokens for the extract_tokens process. This process // // is responsible for all memory management in list building // // process. // // // /////////////////////////////////////////////////////////////////// // // // A-Specification Requirements: - none // // // // B-Specification Requirement - 3.2.2.a.1: // // The make_list process shall accept tokens, one for each // // file to be paginated and copy into list by value. // // B-Specification Requirement - 3.2.2.a.2 // // Make_list process shall allocate memory for each token // // inserted on token list. // // B-Specification Requirement - 3.2.2.a.3: // // The make_list process shall provide the capability to // // index through list and return token values on demand. // // // /////////////////////////////////////////////////////////////////// // // // Test Description: // // The attached test driver demonstrates that part of the // // LISTS module interface needed for PAGE processing. It // // creates a list object, append tokens on list, shows that // // memory is allocated for each token appended, and shows // // all elements of the list can be retrieved by indexing. // // // /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // // // Test Procedure - test // // - Test driver creates a list object and tokens "one", "two", // // and "three" and appends them on the list. // // - Test demonstrates list process allocates memory for tokens // // by monitoring allocated memory for each appending. // // - Test indexes through list showing list tokens returned are // // the values "one", "two", and "three". // // // // Expected test results: // // 1. list tokens consume heap memory when appended and return // // appended values when indexed. // // // /////////////////////////////////////////////////////////////////// // // // Signature: Date: // // ---------------------------- ------------- // // // /////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////// // // // qlpage1.cpp - qualification test #1 // // // // make_list process // // // /////////////////////////////////////////////////////////////////// #define TEST_LISTS #include "lists.hpp" void main() { list testList; cout << "\n\nQualification Test #2 - make_list process:\n\n"; char* token1 = "one"; cout << " appending 1st token: " << token1 << endl; testList.append(token1); cout << " " << list::showHeap() << endl; char* token2 = "two"; cout << " appending 2nd token: " << token2 << endl; testList.append(token2); cout << " " << list::showHeap() << endl; char* token3 = "three"; cout << " appending 3rd token: " << token3 << endl; testList.append(token3); cout << " " << list::showHeap() << endl; cout << " List is: "; int i, max = testList.listLength(); for(i=0; i