

Unit Test Statically Typed Programs - 16s

I've helped some younger guys (who use Python and Ruby almost exclusively) write some C++ code. They do lots of unit testing on their Ruby/Python code. They complain that I don't unit test C++.<p>My C++ code is small and works as expected. It's compiled with all the compiler checks enabled (-Wall -Wextra -Weffc++) so any slight error is caught and fixed at compile time. I don't do any casting and I use a const wherever I can and all the data structures are STL.<p>So my question to HN... do you guys unit check C and C++ code? In my mind, the compiler (written by a lot of super smart guys) is my unit tester and the only reason the young guys need to do this sort of thing is because they're using dynamically typed (thus more error prone) languages.<p>I wanted to do a sanity check with HN though. What do you guys think?
======
stonemetal
Unit testing is a good idea in any language. If you look at their tests, I
doubt many of them look like type checks. I bet most of them are logic tests.
The compiler would not negate the usefulness of such tests.

------
hector_ka
You could use CppTest <http://cpptest.sourceforge.net/> which is a unit test
framework for C++

------
ExpiredLink
int gimme42() { return 41; }

"all the compiler checks enabled"

