void testMove() { Move move = new MoveInfo(5, 3); assert(move->getCoins() == 5 && move->getPile() == 3); cout << "testMove succeeded.\n"; }
Note that the test code is collected into a procedure.