1.1 KiB
1.1 KiB
Homegrown Testing Framework
Fibonacci
- Look at "tests.cc" to see the assert statement options.
- Look at "fibonacci_test.cc" to see how these assert statements are used.
- make and run the unittests
./unittests
to see how successful these tests were in finding errors! - No need to fix these errors. The point is to understand how test cases are created and used to develop a suite of tests.
Robot
- Look at "robot.h" and robot.cc".
- In the file "robot_test.cc" notice there are no tests written. Remedy this by writing a test that tests the DEFAULT constructor. This would be composed of the instantiation of a robot, then a series of the provided assert statements (e.g. ExpectEqual()) to check that the values for the radius and the position are as expected. The tests in "fibonacci_test.cc" provide a guide on how to create these.
- Write a test for the other constructor.
- Look at Robot::CheckOverlap(). Identify some scenarios that would be good to test.
- For each scenario, write a collection of assert statements to confirm the results.