Question: verifyMIPSInstruction: The main function in the test driver (disUtilDriver.c) currently reads lines in from a file until reaching the end of the file. If the


verifyMIPSInstruction: The main function in the test driver (disUtilDriver.c) currently reads lines in from a file until reaching the end of the file. If the line ends with a newline, the program strips the newline from the string by replacing it with a null byte. The code that is missing should call verifyMIPSInstruction to verify that the format contains a MIPS instruction in the proper format or print an error if it does not. If the instruction is valid, main should call binToDec several times, with various parameters, to test it effectively and print the results. (Until you have completed the missing code in binToDec, a single call will be a sufficient test.) The verifyMIPSInstruction function should verify that the string provided to it is 32 characters long and that the characters in the string are all O's or 1's (character '0' or character '1'). If the instruction is valid, verifyMIPSInstruction should return 1. Otherwise, it should print an error message indicating the error and the line on which it occurred before returning 0. Test your modifications before going further by adding appropriate data to the existing test file or by creating new data files. Be sure to include tests cases that exercise every path through your code as well as all appropriate boundary conditions (e.g., empty lines, too-long lines, invalid data in the first/ last positions, etc.) verifyMIPSInstruction: The main function in the test driver (disUtilDriver.c) currently reads lines in from a file until reaching the end of the file. If the line ends with a newline, the program strips the newline from the string by replacing it with a null byte. The code that is missing should call verifyMIPSInstruction to verify that the format contains a MIPS instruction in the proper format or print an error if it does not. If the instruction is valid, main should call binToDec several times, with various parameters, to test it effectively and print the results. (Until you have completed the missing code in binToDec, a single call will be a sufficient test.) The verifyMIPSInstruction function should verify that the string provided to it is 32 characters long and that the characters in the string are all O's or 1's (character '0' or character '1'). If the instruction is valid, verifyMIPSInstruction should return 1. Otherwise, it should print an error message indicating the error and the line on which it occurred before returning 0. Test your modifications before going further by adding appropriate data to the existing test file or by creating new data files. Be sure to include tests cases that exercise every path through your code as well as all appropriate boundary conditions (e.g., empty lines, too-long lines, invalid data in the first/ last positions, etc.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
