improve d_do_test