Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
18348a3b
Commit
18348a3b
authored
8 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Fix C++ test compilation
parent
8ea2f8e1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/cpp/grpclb/grpclb_test.cc
+14
-10
14 additions, 10 deletions
test/cpp/grpclb/grpclb_test.cc
with
14 additions
and
10 deletions
test/cpp/grpclb/grpclb_test.cc
+
14
−
10
View file @
18348a3b
...
...
@@ -288,7 +288,8 @@ static void start_lb_server(server_fixture *sf, int *ports, size_t nports,
op
->
op
=
GRPC_OP_SEND_STATUS_FROM_SERVER
;
op
->
data
.
send_status_from_server
.
trailing_metadata_count
=
0
;
op
->
data
.
send_status_from_server
.
status
=
GRPC_STATUS_OK
;
op
->
data
.
send_status_from_server
.
status_details
=
"xyz"
;
grpc_slice
status_details
=
grpc_slice_from_static_string
(
"xyz"
);
op
->
data
.
send_status_from_server
.
status_details
=
&
status_details
;
op
->
flags
=
0
;
op
->
reserved
=
NULL
;
op
++
;
...
...
@@ -345,8 +346,9 @@ static void start_backend_server(server_fixture *sf) {
}
GPR_ASSERT
(
ev
.
type
==
GRPC_OP_COMPLETE
);
const
string
expected_token
=
strlen
(
sf
->
lb_token_prefix
)
==
0
?
""
:
sf
->
lb_token_prefix
+
std
::
to_string
(
sf
->
port
);
strlen
(
sf
->
lb_token_prefix
)
==
0
?
""
:
sf
->
lb_token_prefix
+
std
::
to_string
(
sf
->
port
);
GPR_ASSERT
(
contains_metadata
(
&
request_metadata_recv
,
"lb-token"
,
expected_token
.
c_str
()));
...
...
@@ -433,7 +435,9 @@ static void start_backend_server(server_fixture *sf) {
op
->
op
=
GRPC_OP_SEND_STATUS_FROM_SERVER
;
op
->
data
.
send_status_from_server
.
trailing_metadata_count
=
0
;
op
->
data
.
send_status_from_server
.
status
=
GRPC_STATUS_OK
;
op
->
data
.
send_status_from_server
.
status_details
=
"Backend server out a-ok"
;
grpc_slice
status_details
=
grpc_slice_from_static_string
(
"Backend server out a-ok"
);
op
->
data
.
send_status_from_server
.
status_details
=
&
status_details
;
op
->
flags
=
0
;
op
->
reserved
=
NULL
;
op
++
;
...
...
@@ -462,8 +466,7 @@ static void perform_request(client_fixture *cf) {
grpc_metadata_array
trailing_metadata_recv
;
grpc_status_code
status
;
grpc_call_error
error
;
char
*
details
=
NULL
;
size_t
details_capacity
=
0
;
grpc_slice
details
;
grpc_byte_buffer
*
request_payload
;
grpc_byte_buffer
*
response_payload_recv
;
int
i
;
...
...
@@ -472,9 +475,11 @@ static void perform_request(client_fixture *cf) {
grpc_slice
request_payload_slice
=
grpc_slice_from_copied_string
(
"hello world"
);
grpc_slice
host
=
grpc_slice_from_static_string
(
"foo.test.google.fr:1234"
);
c
=
grpc_channel_create_call
(
cf
->
client
,
NULL
,
GRPC_PROPAGATE_DEFAULTS
,
cf
->
cq
,
"/foo"
,
"foo.test.google.fr:1234"
,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE
(
5
),
NULL
);
cf
->
cq
,
grpc_slice_from_static_string
(
"/foo"
),
&
host
,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE
(
5
),
NULL
);
gpr_log
(
GPR_INFO
,
"Call 0x%"
PRIxPTR
" created"
,
(
intptr_t
)
c
);
GPR_ASSERT
(
c
);
char
*
peer
;
...
...
@@ -497,7 +502,6 @@ static void perform_request(client_fixture *cf) {
op
->
data
.
recv_status_on_client
.
trailing_metadata
=
&
trailing_metadata_recv
;
op
->
data
.
recv_status_on_client
.
status
=
&
status
;
op
->
data
.
recv_status_on_client
.
status_details
=
&
details
;
op
->
data
.
recv_status_on_client
.
status_details_capacity
=
&
details_capacity
;
op
->
flags
=
0
;
op
->
reserved
=
NULL
;
op
++
;
...
...
@@ -553,7 +557,7 @@ static void perform_request(client_fixture *cf) {
grpc_metadata_array_destroy
(
&
initial_metadata_recv
);
grpc_metadata_array_destroy
(
&
trailing_metadata_recv
);
g
pr_free
(
details
);
g
rpc_slice_unref
(
details
);
gpr_log
(
GPR_INFO
,
"Client call (peer %s) DESTROYED."
,
peer
);
gpr_free
(
peer
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment