mardi 27 octobre 2015

unit testing C++11 closures

Is there any precedence for doing unit testing on C++ closures?

Functions that I write usually start out as closures defined near their point of use, and then (maybe) graduate to full functions later. This is nice for keeping interfaces clean and makes it easier to read the code in a linear fashion, but it undermines writing unit tests.

Are there any tricks or C++ unit testing frameworks that can handle, say, some little function for computing some geometry that is defined as a closure within my main()?

Aucun commentaire:

Enregistrer un commentaire