diff options
author | Vijay Pai <vpai@google.com> | 2015-08-19 09:30:23 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-08-19 09:30:23 -0700 |
commit | 6d8d0144c8aaceae86603ba155c7f56942c3eeaa (patch) | |
tree | d50d535d9a15c0b447e5ed39d9b336996f13bdf0 /test/cpp/interop | |
parent | 5bcc557258b50b805c17f9991a0959467116adb9 (diff) | |
parent | 2a6427ffdbdd8620e71b9b471b7334d3456d247f (diff) |
Merge pull request #2975 from dgquintas/no_foreach_44
removed foreach loops for gcc 4.4
Diffstat (limited to 'test/cpp/interop')
-rw-r--r-- | test/cpp/interop/interop_client.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 9e738b6d3b..5ed14d556a 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -41,6 +41,7 @@ #include <grpc/grpc.h> #include <grpc/support/log.h> #include <grpc/support/string_util.h> +#include <grpc/support/useful.h> #include <grpc++/channel_interface.h> #include <grpc++/client_context.h> #include <grpc++/credentials.h> @@ -271,18 +272,18 @@ void InteropClient::DoLargeUnary() { void InteropClient::DoLargeCompressedUnary() { const CompressionType compression_types[] = {NONE, GZIP, DEFLATE}; const PayloadType payload_types[] = {COMPRESSABLE, UNCOMPRESSABLE, RANDOM}; - for (const auto payload_type : payload_types) { - for (const auto compression_type : compression_types) { + for (size_t i = 0; i < GPR_ARRAY_SIZE(payload_types); i++) { + for (size_t j = 0; j < GPR_ARRAY_SIZE(compression_types); j++) { char* log_suffix; gpr_asprintf(&log_suffix, "(compression=%s; payload=%s)", - CompressionType_Name(compression_type).c_str(), - PayloadType_Name(payload_type).c_str()); + CompressionType_Name(compression_types[j]).c_str(), + PayloadType_Name(payload_types[i]).c_str()); gpr_log(GPR_INFO, "Sending a large compressed unary rpc %s.", log_suffix); SimpleRequest request; SimpleResponse response; - request.set_response_type(payload_type); - request.set_response_compression(compression_type); + request.set_response_type(payload_types[i]); + request.set_response_compression(compression_types[j]); PerformLargeUnary(&request, &response); gpr_log(GPR_INFO, "Large compressed unary done %s.", log_suffix); gpr_free(log_suffix); @@ -347,21 +348,21 @@ void InteropClient::DoResponseCompressedStreaming() { const CompressionType compression_types[] = {NONE, GZIP, DEFLATE}; const PayloadType payload_types[] = {COMPRESSABLE, UNCOMPRESSABLE, RANDOM}; - for (const auto payload_type : payload_types) { - for (const auto compression_type : compression_types) { + for (size_t i = 0; i < GPR_ARRAY_SIZE(payload_types); i++) { + for (size_t j = 0; j < GPR_ARRAY_SIZE(compression_types); j++) { ClientContext context; InteropClientContextInspector inspector(context); StreamingOutputCallRequest request; char* log_suffix; gpr_asprintf(&log_suffix, "(compression=%s; payload=%s)", - CompressionType_Name(compression_type).c_str(), - PayloadType_Name(payload_type).c_str()); + CompressionType_Name(compression_types[j]).c_str(), + PayloadType_Name(payload_types[i]).c_str()); gpr_log(GPR_INFO, "Receiving response steaming rpc %s.", log_suffix); - request.set_response_type(payload_type); - request.set_response_compression(compression_type); + request.set_response_type(payload_types[i]); + request.set_response_compression(compression_types[j]); for (unsigned int i = 0; i < response_stream_sizes.size(); ++i) { ResponseParameters* response_parameter = |