test cpp for override new operator and check memory leak