aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-07-20 16:39:31 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-07-20 16:39:31 -0700
commit9cb9445155804fb65af100b9747d467254fb7ca6 (patch)
treec3d331053b687a1714f624d114520cb21d6433a1 /test
parentc68640f05cea2cf79bf2703d83da6b76fa6dc5e6 (diff)
Addressed review comments
Diffstat (limited to 'test')
-rw-r--r--test/cpp/util/grpc_cli.cc13
-rw-r--r--test/cpp/util/proto_file_parser.cc2
-rw-r--r--test/cpp/util/proto_reflection_descriptor_database.cc4
3 files changed, 10 insertions, 9 deletions
diff --git a/test/cpp/util/grpc_cli.cc b/test/cpp/util/grpc_cli.cc
index fdb1a7c2a0..53529da782 100644
--- a/test/cpp/util/grpc_cli.cc
+++ b/test/cpp/util/grpc_cli.cc
@@ -35,14 +35,14 @@
A command line tool to talk to a grpc server.
Example of talking to grpc interop server:
grpc_cli call localhost:50051 UnaryCall "response_size:10" \
- --proto_file=src/proto/grpc/testing/test.proto --enable_ssl=false
+ --protofiles=src/proto/grpc/testing/test.proto --enable_ssl=false
Options:
- 1. --proto_file, use this flag to provide a proto file if the server does
+ 1. --protofiles, use this flag to provide a proto file if the server does
does not have the reflection service.
2. --proto_path, if your proto file is not under current working directory,
use this flag to provide a search root. It should work similar to the
- counterpart in protoc. This option is valid only when proto_file is
+ counterpart in protoc. This option is valid only when protofiles is
provided.
3. --metadata specifies metadata to be sent to the server, such as:
--metadata="MyHeaderKey1:Value1:MyHeaderKey2:Value2"
@@ -90,7 +90,8 @@ DEFINE_string(output_binary_file, "",
DEFINE_string(metadata, "",
"Metadata to send to server, in the form of key1:val1:key2:val2");
DEFINE_string(proto_path, ".", "Path to look for the proto file.");
-DEFINE_string(proto_file, "", "Name of the proto file.");
+// TODO(zyc): support a list of input proto files
+DEFINE_string(protofiles, "", "Name of the proto file.");
void ParseMetadataFlag(
std::multimap<grpc::string, grpc::string>* client_metadata) {
@@ -173,9 +174,9 @@ int main(int argc, char** argv) {
}
if (!request_text.empty()) {
- if (!FLAGS_proto_file.empty()) {
+ if (!FLAGS_protofiles.empty()) {
parser.reset(new grpc::testing::ProtoFileParser(
- FLAGS_proto_path, FLAGS_proto_file, method_name));
+ FLAGS_proto_path, FLAGS_protofiles, method_name));
} else {
parser.reset(new grpc::testing::ProtoFileParser(channel, method_name));
}
diff --git a/test/cpp/util/proto_file_parser.cc b/test/cpp/util/proto_file_parser.cc
index b1bf0471e1..5b0d925e1c 100644
--- a/test/cpp/util/proto_file_parser.cc
+++ b/test/cpp/util/proto_file_parser.cc
@@ -112,7 +112,7 @@ ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
LogError(
"Failed to get services from the server, "
"it may not have the reflection service.\n"
- "Please try to use the --proto_file option to provide a proto file.");
+ "Please try to use the --protofiles option to provide a proto file.");
}
if (has_error_) {
return;
diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc
index 48998551a5..2d847012a2 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.cc
+++ b/test/cpp/util/proto_reflection_descriptor_database.cc
@@ -54,8 +54,8 @@ ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase(
: stub_(ServerReflection::NewStub(channel)) {}
ProtoReflectionDescriptorDatabase::~ProtoReflectionDescriptorDatabase() {
- if (!stream_) {
- GetStream()->WritesDone();
+ if (stream_) {
+ stream_->WritesDone();
Status status = stream_->Finish();
if (!status.ok()) {
gpr_log(GPR_ERROR,