C++ class test code