King races to ton before retiring hurt in trial match