Fix compiler warnings in cmake tests