I want to implement some very simple C/C++ unit tests for a function that is supposed to compress or decompress some data.
Mainly the input is a binary block and the output is also a binary block. The binary blocks should be less than 50 bytes, probably having 5-6 pairs.
I am looking for a solution that would preferably not require third party libraries. If it would require this one should be very small/simple.
"I am looking for a solution that would not require third party libraries."
Just write the unit-test function, it's easy: Create a function which will call the to-be-testet-function with different arguments and compare the result with the expected outputs. Add a function-pointer to that testing-function to a global function-pointer-array in which you store all testing-functions so that you can run all of them on demand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With