What are the best methods that you have found or devised to create and use unit tests? My initial idea was to have a testing class that handles assertions and other test method, and testable classes derive from it to inherit the testing functions, which are disabled with a preprocessor macro definition. Then, there'd be a test method that would run all of the tests that were written for it. All of the tests were within the implementation files, and they'd output diagnostics in an easily readable format on their status.
I do realize that parts of this design is a little foolish; having the tests in the module's implementation feels a little foolish, and having a test all function seems strange. Originally, I had a novel idea of calling a test all function on the highest component, which would call the test all functions on its children, but this seems like it has little use.
I would like to use this methodology for Test Driven Development in the future; I haven't started applying this concept yet, as I'm porting and refactoring old code from C to C++ and writing tests for the old code, but I plan to write new modules using TDD strategies, as they seem to speak to me in the likelihood of helping me find bugs, have confidence in code working properly, and ensuring that refactors don't break old code.