Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please do this for C language. Thank you for your help! In this homework problem, you are to write 7 unit test vectors that will
Please do this for C language. Thank you for your help!
In this homework problem, you are to write 7 unit test vectors that will test 5 of the required functions from project 1: print_board(), check_step(), check_jump(), is-jumper(), and jump_exists(). The expected output files, test1.out - test7.out, are given to you (look on ELMS in the "files" link under "Homework \#2"). You are to write the 7 driver functions, test1-driver.c - test7-driver.c, that will produce the given expected output. You will not need to write any input files; all test vector inputs will come from your driver code. Your driver code should contain a "main" function that first initializes the checker board with some pieces to setup the test. Then, it should call print_board() to display the initialized checker board. Next, it should call the function under test using some test arguments, and capture the return value. Finally, it should print the tested function, the arguments used to test the function, and the captured return value(s). When developing each driver module, you should look at the corresponding output file to determine how to intialize the checker board, what function to test, and what input arguments to use during the tests. For example, here is the test1.out file: For this test, your driver code (test1-driver.c) should intialize the board with a single normal red piece at (2,3), and call check step() 8 times with the arguments shown above, and then print the 8 TRUE or FALSE return values from each call to the function. In the test1.out example shown above, all the tests are performed on a single configuration of the checker board. In some tests, you will need to change the number and/or location of pieces on the checker board in between function tests. After each new checker board configuration, you should call print_board() so that the new configuration is printed to the test output. For example, test5.out is such a multi-configuration test. To facilitate writing your test vectors, we have provided the required functions.o object file, containing the 5 functions under test compiled from our solution source code. This object file only contains the 5 required functions; it does not contain the checker board declaration nor does it contain a main function. These should be provided by your driver code. (Your driver code should also \#include the original checkers.h file to get all the constant definitions and forward declarations associated with project 1). Once you have written your driver code, you can create an executable by compiling your driver source code along with our object file. For example, the following will compile the first test vectorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started