Skip to content
Snippets Groups Projects
Commit a8c7c201 authored by Nicolas Noble's avatar Nicolas Noble
Browse files

Merge pull request #1139 from vjpai/fix_tests_4_4

Fix most c++ tests for gcc 4.4
parents 10dd2a16 6130809a
No related branches found
No related tags found
No related merge requests found
...@@ -532,15 +532,19 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) { ...@@ -532,15 +532,19 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) {
send_request.set_message("Hello"); send_request.set_message("Hello");
std::pair<grpc::string, grpc::string> meta1("key1", "val1"); std::pair<grpc::string, grpc::string> meta1("key1", "val1");
std::pair<grpc::string, grpc::string> meta2( std::pair<grpc::string, grpc::string> meta2(
"key2-bin", {"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc", 13}); "key2-bin",
grpc::string("\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc",
13));
std::pair<grpc::string, grpc::string> meta3("key3", "val3"); std::pair<grpc::string, grpc::string> meta3("key3", "val3");
std::pair<grpc::string, grpc::string> meta6( std::pair<grpc::string, grpc::string> meta6(
"key4-bin", "key4-bin",
{"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d", 14}); grpc::string("\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d",
14));
std::pair<grpc::string, grpc::string> meta5("key5", "val5"); std::pair<grpc::string, grpc::string> meta5("key5", "val5");
std::pair<grpc::string, grpc::string> meta4( std::pair<grpc::string, grpc::string> meta4(
"key6-bin", "key6-bin",
{"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee", 15}); grpc::string("\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee",
15));
cli_ctx.AddMetadata(meta1.first, meta1.second); cli_ctx.AddMetadata(meta1.first, meta1.second);
cli_ctx.AddMetadata(meta2.first, meta2.second); cli_ctx.AddMetadata(meta2.first, meta2.second);
......
...@@ -213,8 +213,11 @@ void RunServer() { ...@@ -213,8 +213,11 @@ void RunServer() {
builder.RegisterService(&service); builder.RegisterService(&service);
std::shared_ptr<ServerCredentials> creds = grpc::InsecureServerCredentials(); std::shared_ptr<ServerCredentials> creds = grpc::InsecureServerCredentials();
if (FLAGS_enable_ssl) { if (FLAGS_enable_ssl) {
SslServerCredentialsOptions ssl_opts = { SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key,
"", {{test_server1_key, test_server1_cert}}}; test_server1_cert};
SslServerCredentialsOptions ssl_opts;
ssl_opts.pem_root_certs = "";
ssl_opts.pem_key_cert_pairs.push_back(pkcp);
creds = grpc::SslServerCredentials(ssl_opts); creds = grpc::SslServerCredentials(ssl_opts);
} }
builder.AddListeningPort(server_address.str(), creds); builder.AddListeningPort(server_address.str(), creds);
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include <grpc++/config.h>
Timer::Timer() : start_(Sample()) {} Timer::Timer() : start_(Sample()) {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment