aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Guantao Liu <guantaol@users.noreply.github.com>2018-10-03 16:15:01 -0700
committerGravatar GitHub <noreply@github.com>2018-10-03 16:15:01 -0700
commit04b78efb45ad93106f84a9293b1d21d8896ae526 (patch)
tree3db0d1acec06ac992fc895313e629c7b264d235b /test/core
parent2e43da886c9a44b3d0f60feede9f511453425c8a (diff)
parente6824674f428362ba8a8011ce34ca5e83abb0fe5 (diff)
Merge pull request #16768 from guantaol/resolve_address_test
Fix the unknown argument issue in resolve_address_test.cc.
Diffstat (limited to 'test/core')
-rw-r--r--test/core/iomgr/resolve_address_test.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/core/iomgr/resolve_address_test.cc b/test/core/iomgr/resolve_address_test.cc
index 52e4840c7c..8d69bab5b1 100644
--- a/test/core/iomgr/resolve_address_test.cc
+++ b/test/core/iomgr/resolve_address_test.cc
@@ -251,7 +251,10 @@ int main(int argc, char** argv) {
gpr_cmdline* cl = gpr_cmdline_create("resolve address test");
gpr_cmdline_add_string(cl, "resolver", "Resolver type (ares or native)",
&resolver_type);
- gpr_cmdline_parse(cl, argc, argv);
+ // In case that there are more than one argument on the command line,
+ // --resolver will always be the first one, so only parse the first argument
+ // (other arguments may be unknown to cl)
+ gpr_cmdline_parse(cl, argc > 2 ? 2 : argc, argv);
const char* cur_resolver = gpr_getenv("GRPC_DNS_RESOLVER");
if (cur_resolver != nullptr && strlen(cur_resolver) != 0) {
gpr_log(GPR_INFO, "Warning: overriding resolver setting of %s",