fix intention of loop in test_copyto_permut