Various test codes in C++