本文整理汇总了C++中grpc_end2end_test_config::tear_down_data方法的典型用法代码示例。如果您正苦于以下问题:C++ grpc_end2end_test_config::tear_down_data方法的具体用法?C++ grpc_end2end_test_config::tear_down_data怎么用?C++ grpc_end2end_test_config::tear_down_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grpc_end2end_test_config
的用法示例。
在下文中一共展示了grpc_end2end_test_config::tear_down_data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void test_invoke_10_simple_requests(grpc_end2end_test_config config,
int initial_sequence_number) {
int i;
grpc_end2end_test_fixture f;
grpc_arg client_arg;
grpc_channel_args client_args;
char *name;
client_arg.type = GRPC_ARG_INTEGER;
client_arg.key = GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER;
client_arg.value.integer = initial_sequence_number;
client_args.num_args = 1;
client_args.args = &client_arg;
gpr_asprintf(&name, "test_invoke_requests first_seqno=%d",
initial_sequence_number);
f = begin_test(config, name, &client_args, NULL);
for (i = 0; i < 10; i++) {
simple_request_body(f);
gpr_log(GPR_INFO, "Passed simple request %d", i);
}
end_test(&f);
config.tear_down_data(&f);
gpr_free(name);
}
示例2: test_invoke_request_response_with_payload
/* Client sends a request with payload, server reads then returns a response
payload and status. */
static void test_invoke_request_response_with_payload(
grpc_end2end_test_config config) {
grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL);
request_response_with_payload(f);
end_test(&f);
config.tear_down_data(&f);
}
示例3: test_size
static void test_size(grpc_end2end_test_config config, int encode_size,
int decode_size) {
size_t i;
grpc_end2end_test_fixture f;
grpc_arg server_arg;
grpc_channel_args server_args;
grpc_arg client_arg;
grpc_channel_args client_args;
char *name;
server_arg.type = GRPC_ARG_INTEGER;
server_arg.key = GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER;
server_arg.value.integer = decode_size;
server_args.num_args = 1;
server_args.args = &server_arg;
client_arg.type = GRPC_ARG_INTEGER;
client_arg.key = GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER;
client_arg.value.integer = encode_size;
client_args.num_args = 1;
client_args.args = &client_arg;
gpr_asprintf(&name, "test_size:e=%d:d=%d", encode_size, decode_size);
f = begin_test(config, name, encode_size != 4096 ? &client_args : NULL,
decode_size != 4096 ? &server_args : NULL);
for (i = 0; i < 4 * GPR_ARRAY_SIZE(hobbits); i++) {
simple_request_body(config, f, i);
}
end_test(&f);
config.tear_down_data(&f);
gpr_free(name);
}
示例4: test_invoke_request_with_census
static void test_invoke_request_with_census(
grpc_end2end_test_config config, const char *name,
void (*body)(grpc_end2end_test_fixture f)) {
char *fullname;
grpc_end2end_test_fixture f;
grpc_arg client_arg, server_arg;
grpc_channel_args client_args, server_args;
client_arg.type = GRPC_ARG_INTEGER;
client_arg.key = GRPC_ARG_ENABLE_CENSUS;
client_arg.value.integer = 1;
client_args.num_args = 1;
client_args.args = &client_arg;
server_arg.type = GRPC_ARG_INTEGER;
server_arg.key = GRPC_ARG_ENABLE_CENSUS;
server_arg.value.integer = 1;
server_args.num_args = 1;
server_args.args = &server_arg;
gpr_asprintf(&fullname, "%s/%s", "test_invoke_request_with_census", name);
f = begin_test(config, fullname, &client_args, &server_args);
body(f);
end_test(&f);
config.tear_down_data(&f);
gpr_free(fullname);
}
示例5: test_early_server_shutdown_finishes_tags
static void test_early_server_shutdown_finishes_tags(
grpc_end2end_test_config config) {
grpc_end2end_test_fixture f = begin_test(
config, "test_early_server_shutdown_finishes_tags", NULL, NULL);
cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_call *s = (void *)1;
grpc_call_details call_details;
grpc_metadata_array request_metadata_recv;
grpc_metadata_array_init(&request_metadata_recv);
grpc_call_details_init(&call_details);
/* upon shutdown, the server should finish all requested calls indicating
no new call */
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
f.server, &s, &call_details,
&request_metadata_recv, f.cq, f.cq, tag(101)));
grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000));
CQ_EXPECT_COMPLETION(cqv, tag(101), 0);
CQ_EXPECT_COMPLETION(cqv, tag(1000), 1);
cq_verify(cqv);
GPR_ASSERT(s == NULL);
grpc_server_destroy(f.server);
end_test(&f);
config.tear_down_data(&f);
cq_verifier_destroy(cqv);
}
示例6: test_invoke_simple_request
static void test_invoke_simple_request(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f;
f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
simple_request_body(f);
end_test(&f);
config.tear_down_data(&f);
}
示例7: test_invoke_empty_body
static void test_invoke_empty_body(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f;
f = begin_test(config, "test_invoke_empty_body", NULL, NULL);
empty_batch_body(f);
end_test(&f);
config.tear_down_data(&f);
}
示例8: test_simple_delayed_request_short
static void test_simple_delayed_request_short(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f;
gpr_log(GPR_INFO, "%s/%s", "test_simple_delayed_request_short", config.name);
f = config.create_fixture(NULL, NULL);
simple_delayed_request_body(config, &f, NULL, NULL, 100000);
end_test(&f);
config.tear_down_data(&f);
}
示例9: test_simple_delayed_request_long
static void test_simple_delayed_request_long(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f;
gpr_log(GPR_INFO, "%s/%s", "test_simple_delayed_request_long", config.name);
f = config.create_fixture(NULL, NULL);
/* This timeout should be longer than a single retry */
simple_delayed_request_body(config, &f, NULL, NULL, 1500000);
end_test(&f);
config.tear_down_data(&f);
}
示例10: test_invoke_simple_request
static void test_invoke_simple_request(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f =
begin_test(config, "test_invoke_simple_request", NULL, NULL);
void *rc = grpc_channel_register_call(f.client, "/foo",
"foo.test.google.fr:1234", NULL);
simple_request_body(f, rc);
end_test(&f);
config.tear_down_data(&f);
}
示例11:
static void test_invoke_10_request_response_with_payload(
grpc_end2end_test_config config) {
int i;
grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL);
for (i = 0; i < 10; i++) {
request_response_with_payload(f);
}
end_test(&f);
config.tear_down_data(&f);
}
示例12:
static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
int i;
grpc_end2end_test_fixture f =
begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
for (i = 0; i < 10; i++) {
simple_request_body(f);
gpr_log(GPR_INFO, "Passed simple request %d", i);
}
end_test(&f);
config.tear_down_data(&f);
}
示例13: test_early_server_shutdown_finishes_inflight_calls
static void test_early_server_shutdown_finishes_inflight_calls(
grpc_end2end_test_config config) {
grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL);
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.fr",
deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_invoke_old(c, f.client_cq, tag(2), tag(3), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_writes_done_old(c, tag(4)));
cq_expect_finish_accepted(v_client, tag(4), GRPC_OP_OK);
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.fr",
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_accept_old(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata_old(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);
/* shutdown the server */
grpc_server_shutdown_and_notify(f.server, tag(0xdead));
cq_verify_empty(v_server);
grpc_call_start_write_status_old(s, GRPC_STATUS_OK, NULL, tag(103));
grpc_call_destroy(s);
cq_expect_finish_accepted(v_server, tag(103), GRPC_OP_OK);
cq_expect_finished(v_server, tag(102), NULL);
cq_expect_server_shutdown(v_server, tag(0xdead));
cq_verify(v_server);
cq_expect_finished_with_status(v_client, tag(3), GRPC_STATUS_OK, NULL, NULL);
cq_verify(v_client);
grpc_call_destroy(c);
cq_verifier_destroy(v_client);
cq_verifier_destroy(v_server);
end_test(&f);
config.tear_down_data(&f);
}
示例14: test_cancel_after_accept_and_writes_closed
/* Cancel after accept with a writes closed, no payload */
static void test_cancel_after_accept_and_writes_closed(
grpc_end2end_test_config config, cancellation_mode mode) {
grpc_call *c;
grpc_call *s;
grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL);
gpr_timespec deadline = five_seconds_time();
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.fr",
deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_invoke_old(c, f.client_cq, tag(2), tag(3), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.fr",
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_accept_old(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata_old(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_writes_done_old(c, tag(4)));
cq_expect_finish_accepted(v_client, tag(4), GRPC_OP_OK);
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_read_old(s, tag(101)));
cq_expect_empty_read(v_server, tag(101));
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c));
cq_expect_finished_with_status(v_client, tag(3), mode.expect_status,
mode.expect_details, NULL);
cq_verify(v_client);
cq_expect_finished_with_status(v_server, tag(102), GRPC_STATUS_CANCELLED,
NULL, NULL);
cq_verify(v_server);
grpc_call_destroy(c);
grpc_call_destroy(s);
cq_verifier_destroy(v_client);
cq_verifier_destroy(v_server);
end_test(&f);
config.tear_down_data(&f);
}
示例15:
static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
int i;
grpc_end2end_test_fixture f =
begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
void *rc = grpc_channel_register_call(f.client, "/foo",
"foo.test.google.fr:1234", NULL);
for (i = 0; i < 10; i++) {
simple_request_body(f, rc);
gpr_log(GPR_INFO, "Passed simple request %d", i);
}
end_test(&f);
config.tear_down_data(&f);
}