Snow Leopard: Factor out general test code from unit test code into header test.h