/////////////////////////////////////////////////////////////////// // // // qlpage1.txt - qualification test #4a // // // // page_control process // // // /////////////////////////////////////////////////////////////////// // // // Process Description: // // The page_control process is responsible for sequencing // // through a list of tokens provided by parse_commandline // // process, interpreting each token as a command or filename. // // It sends commands to set_params to save one or more new // // parameter values. It attempts to open each named file // // and send file information to format_page to generate a // // page sequence. // // // /////////////////////////////////////////////////////////////////// // // // Requirements: // // // // A-Specification Requirement - 3.1 // // The PAGE program shall accept for processing, in the // // order cited, filenames and parameter settings from the // // command line. // // // // B-Specification Requirement - 3.1.a.1: // // PAGE shall process tokens from the command line in the // // order cited. // // B-Specification Requirement - 3.1.a.2: // // PAGE shall identify tokens from the command line as com- // // mands or filenames. // // B-Specification Requirement - 3.1.a.3: // // For each command PAGE shall set pagination attributes to // // the values specified by the command. // // // // A-Specification Requirement - 3.5 // // PAGE shall accept filenames delimited by spaces and // // attempt to open each named file. // // // // B-Specification Requirement - 3.1.a.4: // // PAGE shall attempt to open for pagination each file cited // // on the command line. // // // /////////////////////////////////////////////////////////////////// // // // Test Description: // // Invoke page with an interleaved series of commands and // // filenames to test processing order. Commands are chosen // // to clearly show changes in pagination attributes. This // // is supported by citing a single test file with text // // designed to make pagination attributes obvious. // // // /////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////// // // // Preconditions: // // - run from DOS command line // // - test file qlpage1.tst must be in default directory // // // /////////////////////////////////////////////////////////////////// // // // Test Procedure - demonstration // // // // 1. alternate valid commands and file patterns to demonstrate // // order of processing // // // // page qlpage1.tst -m20w55 qlpage1.tst -l40 qlpage1.tst // // // // Expected test results: // // // // 1. qlpage1.tst printed with default margin of 5 chars, width // // of 70 chars, and length of 55 lines/page // // // // 2. qlpage1.tst printed with margin of 20 chars, width of 55 // // chars, and length of 55 lines/page // // // // 3. qlpage1.tst printed with margin of 20 chars, width of 55 // // chars, and length of 40 lines/page // // // /////////////////////////////////////////////////////////////////// // // // Signature: Date: // // ---------------------------- ------------- // // // /////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////// // // // qlpage1.txt - qualification test #4b // // // // page_control process, extract_token process // // // /////////////////////////////////////////////////////////////////// // // // Process Description: // // The page_control process is responsible for sequencing // // through a list of tokens provided by parse_commandline // // process, interpreting each token as command or filename. // // It sends commands to set_params to save one or more new // // parameter values. It attempts to open each named file // // and send file information to format_page to generate a // // page sequence. // // // /////////////////////////////////////////////////////////////////// // // // Requirements: // // // // A-Specification Requirement - 3.10 // // If no filenames are cited on the comand line an error // // message indicating that condition shall be sent to non- // // redirectable output. If a filename is given but fails to // // open from default directory an error message indicating // // that condition shall be sent to non-redirectable output. // // // // B-Specification Requirement - 3.1.a.5: // // PAGE shall print an error message if an attempt to open // // a file fails. // // // // B-Specification Requirement - 3.2.1.a.5: // // If command line is empty PAGE shall send error message // // to non-redirectable output. // // // /////////////////////////////////////////////////////////////////// // // // Test Description: // // - Invoke page with filename having no matching file in the // // default directory and observe resulting error message. // // - Invoke page with empty command line and observe resulting // // error message. // // // /////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////// // // // Preconditions: // // - run from DOS command line // // - no file matching foo is found in default directory // // // /////////////////////////////////////////////////////////////////// // // // Test Procedure - demonstration // // // // 1. invoke page with one file specifier which does not match // // any file in default directory // // // // page qlpage1.tst -m20w55 foo // // // // 2. invoke page with an empty command line // // // // page // // // // Expected test results: // // // // 1. error message displayed indicating failure to open // // file foo // // // // 2. error message displayed indicating omitted arguments // // // /////////////////////////////////////////////////////////////////// // // // Signature: Date: // // ---------------------------- ------------- // // // /////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////// // // // qlpage1.txt - qualification test #4c // // // // extract_token process // // // /////////////////////////////////////////////////////////////////// // // // Process Description: // // The extract_token process reads tokens from the command // // line, expands wildcards in filenames, and builds a list // // of tokens to be used by page_control process. // // // /////////////////////////////////////////////////////////////////// // // // Requirements: // // // // A-Specification Requirement - 3.1 // // PAGE program shall accept for processing, in order cited, // // filenames and parameter settings from the command line. // // // // B-Specification Requirement - 3.2.1.a.1: // // PAGE shall read tokens from the command line. // // B-Specification Requirement - 3.2.1.a.2 // // PAGE shall place commands [tokens with prefix "-"] on // // token list without further interpretation. // // // // A-Specification Requirement - 3.6 // // Filenames may contain DOS wildcards * and ?. Wildcards // // shall be processed using semantics equivalent to the Bor- // // land C run time library functions findfirst and findnext. // // // // B-Specification Requirement - 3.2.1.a.3: // // PAGE shall interpret all other tokens as filenames and // // attempt to expand any wildcards using processing equiva- // // lent to the find_first and find_next functions in the // // Borland C run time library. // // B-Specification Requirement - 3.2.1.a.4: // // PAGE shall place each matching filename on token list // // // /////////////////////////////////////////////////////////////////// // // // Test Description: // // - Inspect CMDLINE module source code to verify that each of // // the specified operations is implemented in that code. // // // /////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////// // // // Test Procedure - inspection // // // // - Requirement 3.2.1.a.1: // // PAGE shall read tokens from the command line. // // // // Inspect code in main function of CMDLINE module. // // // // Immediately following the comment "insert fileItem stats // // into file list" the command line token argv[argProcessed] // // is passed to the get_file_info function for processing. // // // // - Requirement 3.2.1.a.2: // // Page shall place commands on token list without further // // interpretation. // // // // Inspect code in main function of CMDLINE module. // // // // Immediately following first while instruction if block // // tests for commands (tokens with hypen prefix) and if // // found loads command argument into the cmdBuff buffer, // // pointed to by fi.cmd, a pointer in fileItem structure, // // fi. This structure is declared at the beginning of the // // header file CMDLINE.HPP // // // // The fi structure is then copied into the fileList, synon- // // ymous with list. (CMDLINE.HPP). // // // // - Requirement - 3.2.1.a.3: // // PAGE shall interpret all other tokens as filenames and // // attempt to expand wildcards using processing equivalent // // to the find_first and find_next functions in the Borland // // C run time library. // // // // Inspect code in main function of CMDLINE module. // // // // This function processes each command line token in turn. // // It extracts commands in first if block and treats all // // other tokens as filenames in else part of the if block. // // This is done by using the (filename) token to build a // // fileItem stucture and sending it to the get_file_info // // function. That function calls find_first and find_next // // to expand wildcards. // // // // - Requirement - 3.2.1.a.4: // // PAGE shall place each matching filename on token list. // // // // Inspect code in main function of CMDLINE module. // // // // The last while block in the main function of the CMDLINE // // module appends a file item to the token list for each // // filename which is found by get_file_info function. // // // /////////////////////////////////////////////////////////////////// // // // Signature: Date: // // ---------------------------- ------------- // // // ///////////////////////////////////////////////////////////////////