replace a useless test with a useful one