On 28/09/18 22:50, rob wrote:
> I have about 30 lines of code which I need to test. However, just
> leaving the code in situ is not easy as getting the previous code to
> meet all the possible initial conditions would increase the SNR
> enormously. Is there any way I should make myself aware of to do this
> other than to turn the code into a function and wrap a test harness
> around it.
Breaking code down into smaller, testable parts is always a good idea.
There are plenty of mature unit test frameworks such is googletest to
help you on your way.
--
Ian.