fix test cases and use autod