aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2015-03-26 10:33:23 -0700
committerGravatar Vijay Pai <vpai@google.com>2015-03-26 10:33:23 -0700
commit96d3b8af32e2ffcca0d18bc5df7b0bf452131d4e (patch)
tree70d75f7b9b7251af54a59cc7c704eaf5309d40ba /test
parent6266b9341ce5f88ff4c888a87d682bc1b9ac706e (diff)
parent9032adcbef6797c5d0b6c5321de684e6b1f32a2d (diff)
Merge branch 'vjpai-qps-stream' into qps-stream
Diffstat (limited to 'test')
-rw-r--r--test/core/tsi/transport_security_test.c10
-rw-r--r--test/cpp/end2end/async_end2end_test.cc1
-rw-r--r--test/cpp/end2end/end2end_test.cc1
-rw-r--r--test/cpp/end2end/generic_end2end_test.cc5
-rw-r--r--test/cpp/qps/client_async.cc11
-rw-r--r--test/cpp/qps/driver.cc44
-rw-r--r--test/cpp/qps/server_async.cc4
-rw-r--r--test/cpp/qps/stats.h4
8 files changed, 44 insertions, 36 deletions
diff --git a/test/core/tsi/transport_security_test.c b/test/core/tsi/transport_security_test.c
index c5882af966..d591e43faa 100644
--- a/test/core/tsi/transport_security_test.c
+++ b/test/core/tsi/transport_security_test.c
@@ -39,10 +39,15 @@
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
+#include <openssl/crypto.h>
+
#include "src/core/support/string.h"
#include "src/core/tsi/ssl_transport_security.h"
#include "test/core/util/test_config.h"
+/* Currently points to 1.0.2a. */
+#define GRPC_MIN_OPENSSL_VERSION_NUMBER 0x1000201fL
+
typedef struct {
/* 1 if success, 0 if failure. */
int expected;
@@ -296,8 +301,13 @@ static void test_peer_matches_name(void) {
}
}
+static void test_openssl_version(void) {
+ GPR_ASSERT(OPENSSL_VERSION_NUMBER >= GRPC_MIN_OPENSSL_VERSION_NUMBER);
+}
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
test_peer_matches_name();
+ test_openssl_version();
return 0;
}
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 4c71831dec..233c5b13a7 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -595,6 +595,5 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
int result = RUN_ALL_TESTS();
grpc_shutdown();
- google::protobuf::ShutdownProtobufLibrary();
return result;
}
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 41c2669533..e2649c2826 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -432,6 +432,5 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
int result = RUN_ALL_TESTS();
grpc_shutdown();
- google::protobuf::ShutdownProtobufLibrary();
return result;
}
diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc
index 711f1b9540..4692188721 100644
--- a/test/cpp/end2end/generic_end2end_test.cc
+++ b/test/cpp/end2end/generic_end2end_test.cc
@@ -83,8 +83,8 @@ bool ParseFromByteBuffer(ByteBuffer* buffer, grpc::protobuf::Message* message) {
buffer->Dump(&slices);
grpc::string buf;
buf.reserve(buffer->Length());
- for (const Slice& s : slices) {
- buf.append(reinterpret_cast<const char*>(s.begin()), s.size());
+ for (auto s = slices.begin(); s != slices.end(); s++) {
+ buf.append(reinterpret_cast<const char*>(s->begin()), s->size());
}
return message->ParseFromString(buf);
}
@@ -265,6 +265,5 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
int result = RUN_ALL_TESTS();
grpc_shutdown();
- google::protobuf::ShutdownProtobufLibrary();
return result;
}
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index 3fd9628bd9..e4e7e73762 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -148,7 +148,8 @@ class AsyncUnaryClient GRPC_FINAL : public Client {
int t = 0;
for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) {
- for (auto& channel : channels_) {
+ for (auto channel = channels_.begin(); channel != channels_.end();
+ channel++) {
auto* cq = cli_cqs_[t].get();
t = (t + 1) % cli_cqs_.size();
auto start_req = [cq](TestService::Stub* stub, grpc::ClientContext* ctx,
@@ -156,7 +157,7 @@ class AsyncUnaryClient GRPC_FINAL : public Client {
return stub->AsyncUnaryCall(ctx, request, cq, tag);
};
- TestService::Stub* stub = channel.get_stub();
+ TestService::Stub* stub = channel->get_stub();
const SimpleRequest& request = request_;
new ClientRpcContextUnaryImpl<SimpleRequest, SimpleResponse>(
stub, request, start_req, check_done);
@@ -169,11 +170,11 @@ class AsyncUnaryClient GRPC_FINAL : public Client {
~AsyncUnaryClient() GRPC_OVERRIDE {
EndThreads();
- for (auto& cq : cli_cqs_) {
- cq->Shutdown();
+ for (auto cq = cli_cqs_.begin(); cq != cli_cqs_.end(); cq++) {
+ (*cq)->Shutdown();
void* got_tag;
bool ok;
- while (cq->Next(&got_tag, &ok)) {
+ while ((*cq)->Next(&got_tag, &ok)) {
delete ClientRpcContext::detag(got_tag);
}
}
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index d29ca1de94..64a53496ae 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -154,19 +154,19 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config,
server_mark.mutable_mark();
ClientArgs client_mark;
client_mark.mutable_mark();
- for (auto& server : servers) {
- GPR_ASSERT(server.stream->Write(server_mark));
+ for (auto server = servers.begin(); server != servers.end(); server++) {
+ GPR_ASSERT(server->stream->Write(server_mark));
}
- for (auto& client : clients) {
- GPR_ASSERT(client.stream->Write(client_mark));
+ for (auto client = clients.begin(); client != clients.end(); client++) {
+ GPR_ASSERT(client->stream->Write(client_mark));
}
ServerStatus server_status;
ClientStatus client_status;
- for (auto& server : servers) {
- GPR_ASSERT(server.stream->Read(&server_status));
+ for (auto server = servers.begin(); server != servers.end(); server++) {
+ GPR_ASSERT(server->stream->Read(&server_status));
}
- for (auto& client : clients) {
- GPR_ASSERT(client.stream->Read(&client_status));
+ for (auto client = clients.begin(); client != clients.end(); client++) {
+ GPR_ASSERT(client->stream->Read(&client_status));
}
// Wait some time
@@ -176,33 +176,33 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config,
// Finish a run
ScenarioResult result;
gpr_log(GPR_INFO, "Finishing");
- for (auto& server : servers) {
- GPR_ASSERT(server.stream->Write(server_mark));
+ for (auto server = servers.begin(); server != servers.end(); server++) {
+ GPR_ASSERT(server->stream->Write(server_mark));
}
- for (auto& client : clients) {
- GPR_ASSERT(client.stream->Write(client_mark));
+ for (auto client = clients.begin(); client != clients.end(); client++) {
+ GPR_ASSERT(client->stream->Write(client_mark));
}
- for (auto& server : servers) {
- GPR_ASSERT(server.stream->Read(&server_status));
+ for (auto server = servers.begin(); server != servers.end(); server++) {
+ GPR_ASSERT(server->stream->Read(&server_status));
const auto& stats = server_status.stats();
result.server_resources.push_back(ResourceUsage{
stats.time_elapsed(), stats.time_user(), stats.time_system()});
}
- for (auto& client : clients) {
- GPR_ASSERT(client.stream->Read(&client_status));
+ for (auto client = clients.begin(); client != clients.end(); client++) {
+ GPR_ASSERT(client->stream->Read(&client_status));
const auto& stats = client_status.stats();
result.latencies.MergeProto(stats.latencies());
result.client_resources.push_back(ResourceUsage{
stats.time_elapsed(), stats.time_user(), stats.time_system()});
}
- for (auto& client : clients) {
- GPR_ASSERT(client.stream->WritesDone());
- GPR_ASSERT(client.stream->Finish().IsOk());
+ for (auto client = clients.begin(); client != clients.end(); client++) {
+ GPR_ASSERT(client->stream->WritesDone());
+ GPR_ASSERT(client->stream->Finish().IsOk());
}
- for (auto& server : servers) {
- GPR_ASSERT(server.stream->WritesDone());
- GPR_ASSERT(server.stream->Finish().IsOk());
+ for (auto server = servers.begin(); server != servers.end(); server++) {
+ GPR_ASSERT(server->stream->WritesDone());
+ GPR_ASSERT(server->stream->Finish().IsOk());
}
return result;
}
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index 1ec1928ab7..83bb08cd49 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -119,8 +119,8 @@ class AsyncQpsServerTest : public Server {
shutdown_ = true;
srv_cq_.Shutdown();
}
- for (auto& thr : threads_) {
- thr.join();
+ for (auto thr = threads_.begin(); thr != threads_.end(); thr++) {
+ thr->join();
}
while (!contexts_.empty()) {
delete contexts_.front();
diff --git a/test/cpp/qps/stats.h b/test/cpp/qps/stats.h
index ca59390ad7..82dc03e3da 100644
--- a/test/cpp/qps/stats.h
+++ b/test/cpp/qps/stats.h
@@ -43,8 +43,8 @@ namespace testing {
template <class T, class F>
double sum(const T& container, F functor) {
double r = 0;
- for (auto v : container) {
- r += functor(v);
+ for (auto v = container.begin(); v != container.end(); v++) {
+ r += functor(*v);
}
return r;
}