Fix global variable declaration in custom sort test