As it stands, we have some complex vector classes in the utilities/ directory. To ensure correctness, we want to write some tests and make sure that they work as expected. However, to do so, we need a testing framework, which is why we need Google Test.
What to do
- Integrate Google Test as a submodule to our repository.
- Write tests to test all the arithmetic operations supplied by the
vec4 and vec3 classes. The tests should go inside a tests directory inside utilities.
a. The CMakeLists.txt inside utilities should also be updated to properly build Google Test, and expose the headers to Rendera source files.
b. Test the vector addition and subtraction by testing with some trivial values, and also write some randomized tests, which will randomly generate values and check the answers for correctness.
c. Test the scalar multiplication code, using the same technique.
d. Test the cross and dot products. This will be a little bit more tricky to test.
As it stands, we have some complex vector classes in the
utilities/directory. To ensure correctness, we want to write some tests and make sure that they work as expected. However, to do so, we need a testing framework, which is why we need Google Test.What to do
vec4andvec3classes. The tests should go inside atestsdirectory insideutilities.a. The
CMakeLists.txtinsideutilitiesshould also be updated to properly build Google Test, and expose the headers to Rendera source files.b. Test the vector addition and subtraction by testing with some trivial values, and also write some randomized tests, which will randomly generate values and check the answers for correctness.
c. Test the scalar multiplication code, using the same technique.
d. Test the cross and dot products. This will be a little bit more tricky to test.