update ap test code