Fix test cases when under testnet compile.