Friday, May 6, 2022

Creating a unit test from the ground up!

 This week I got to venture into creating unit tests, but instead of modifying an exist test, I had to create the test itself! My task for this week involved finishing an old custom data structure called factory (scoped in as gtl::factory) 


The first section of the unit test checking for the default state of a factory

The data structure was pretty simple, though the iterator class was the only part of the factory that was left unfinished. I did have some struggle getting the pointers to cooperate, as the Data array internally was not in the scope of the iterator. This was solved by making the constructor for the iterator take in the data array, and creating a function for the end user to create an iterator simply by calling the ".iterator()" function.

This week was a pretty simple week of studying up on a data structure. Next week I intend to implement the rest of the unit tests, and add the factory to the GBlitter class for optimizations!

No comments:

Post a Comment