Convert to c++
Test class