• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ grpc_end2end_test_config类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中grpc_end2end_test_config的典型用法代码示例。如果您正苦于以下问题:C++ grpc_end2end_test_config类的具体用法?C++ grpc_end2end_test_config怎么用?C++ grpc_end2end_test_config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了grpc_end2end_test_config类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: begin_test

static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
                                            const char *test_name,
                                            grpc_channel_args *client_args,
                                            grpc_channel_args *server_args) {
  grpc_end2end_test_fixture f;
  gpr_log(GPR_INFO, "%s/%s", test_name, config.name);
  f = config.create_fixture(client_args, server_args);
  config.init_server(&f, server_args);
  config.init_client(&f, client_args);
  return f;
}
开发者ID:alfatraining,项目名称:grpc,代码行数:11,代码来源:simple_request.c


示例2: begin_test

static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
                                            const char *test_name,
                                            grpc_channel_args *client_args,
                                            grpc_channel_args *server_args,
                                            bool request_status_early) {
  grpc_end2end_test_fixture f;
  gpr_log(GPR_INFO, "%s/%s/request_status_early=%s", test_name, config.name,
          request_status_early ? "true" : "false");
  f = config.create_fixture(client_args, server_args);
  config.init_server(&f, server_args);
  config.init_client(&f, client_args);
  return f;
}
开发者ID:wuyunhao,项目名称:grpc,代码行数:13,代码来源:streaming_error_response.c


示例3: begin_test

static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
                                            const char *test_name,
                                            grpc_channel_args *client_args,
                                            grpc_channel_args *server_args) {
  grpc_end2end_test_fixture f;
  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
  // We intentionally do not pass the client and server args to
  // create_fixture(), since we don't want the limit enforced on the
  // proxy, only on the backend server.
  f = config.create_fixture(NULL, NULL);
  config.init_server(&f, server_args);
  config.init_client(&f, client_args);
  return f;
}
开发者ID:yugui,项目名称:grpc,代码行数:14,代码来源:max_message_length.c


示例4: test_ping

static void test_ping(grpc_end2end_test_config config) {
  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
  cq_verifier *cqv = cq_verifier_create(f.cq);
  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
  int i;

  config.init_client(&f, NULL, NULL);
  config.init_server(&f, NULL);

  grpc_channel_ping(f.client, f.cq, tag(0), NULL);
  CQ_EXPECT_COMPLETION(cqv, tag(0), 0);

  /* check that we're still in idle, and start connecting */
  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) ==
             GRPC_CHANNEL_IDLE);
  /* we'll go through some set of transitions (some might be missed), until
     READY is reached */
  while (state != GRPC_CHANNEL_READY) {
    grpc_channel_watch_connectivity_state(
        f.client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(99));
    CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
    cq_verify(cqv);
    state = grpc_channel_check_connectivity_state(f.client, 0);
    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
               state == GRPC_CHANNEL_CONNECTING ||
               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
  }

  for (i = 1; i <= 5; i++) {
    grpc_channel_ping(f.client, f.cq, tag(i), NULL);
    CQ_EXPECT_COMPLETION(cqv, tag(i), 1);
    cq_verify(cqv);
  }

  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
  cq_verify(cqv);

  /* cleanup server */
  grpc_server_destroy(f.server);

  grpc_channel_destroy(f.client);
  grpc_completion_queue_shutdown(f.cq);
  grpc_completion_queue_destroy(f.cq);
  config.tear_down_data(&f);

  cq_verifier_destroy(cqv);
}
开发者ID:gnirodi,项目名称:grpc,代码行数:48,代码来源:ping.c


示例5: test_max_age_forcibly_close

static void test_max_age_forcibly_close(grpc_end2end_test_config config) {
  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
  cq_verifier *cqv = cq_verifier_create(f.cq);
  grpc_arg server_a[] = {{.type = GRPC_ARG_INTEGER,
                          .key = GRPC_ARG_MAX_CONNECTION_AGE_MS,
                          .value.integer = MAX_CONNECTION_AGE_MS},
                         {.type = GRPC_ARG_INTEGER,
开发者ID:makdharma,项目名称:grpc,代码行数:7,代码来源:max_connection_age.c


示例6: 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);
}
开发者ID:Abioy,项目名称:kythe,代码行数:9,代码来源:request_response_with_payload.c


示例7: 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);
}
开发者ID:aaronjheng,项目名称:grpc,代码行数:32,代码来源:hpack_size.c


示例8: 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);
}
开发者ID:Indifer,项目名称:grpc,代码行数:29,代码来源:shutdown_finishes_tags.c


示例9: 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);
}
开发者ID:ELMERzark,项目名称:grpc,代码行数:28,代码来源:census_simple_request.c


示例10: test_invoke_10_simple_requests

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);
}
开发者ID:alfatraining,项目名称:grpc,代码行数:26,代码来源:high_initial_seqno.c


示例11: 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);
}
开发者ID:Alex-duzhichao,项目名称:grpc,代码行数:8,代码来源:idempotent_request.c


示例12: 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);
}
开发者ID:alfatraining,项目名称:grpc,代码行数:8,代码来源:empty_batch.c


示例13: 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);
}
开发者ID:larsonmpdx,项目名称:grpc,代码行数:10,代码来源:registered_call.c


示例14: begin_test

static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
                                            const char *test_name,
                                            int fail_server_auth_check) {
  grpc_end2end_test_fixture f;
  gpr_log(GPR_INFO, "%s/%s", test_name, config.name);
  f = config.create_fixture(NULL, NULL);
  config.init_client(&f, NULL);
  if (fail_server_auth_check) {
    grpc_arg fail_auth_arg = {
        GRPC_ARG_STRING, FAIL_AUTH_CHECK_SERVER_ARG_NAME, {NULL}};
    grpc_channel_args args;
    args.num_args= 1;
    args.args = &fail_auth_arg;
    config.init_server(&f, &args);
  } else {
    config.init_server(&f, NULL);
  }
  return f;
}
开发者ID:ELMERzark,项目名称:grpc,代码行数:19,代码来源:request_response_with_payload_and_call_creds.c


示例15: test_invoke_10_request_response_with_payload

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);
}
开发者ID:Abioy,项目名称:kythe,代码行数:10,代码来源:request_response_with_payload.c


示例16: test_invoke_10_simple_requests

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);
}
开发者ID:Alex-duzhichao,项目名称:grpc,代码行数:11,代码来源:idempotent_request.c


示例17: disappearing_server_test

static void disappearing_server_test(grpc_end2end_test_config config) {
  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
  cq_verifier *cqv = cq_verifier_create(f.cq);

  gpr_log(GPR_INFO, "%s/%s", "disappearing_server_test", config.name);

  config.init_client(&f, NULL);
  config.init_server(&f, NULL);

  do_request_and_shutdown_server(&f, cqv);

  /* now destroy and recreate the server */
  config.init_server(&f, NULL);

  do_request_and_shutdown_server(&f, cqv);

  cq_verifier_destroy(cqv);

  end_test(&f);
  config.tear_down_data(&f);
}
开发者ID:201528013359030,项目名称:grpc,代码行数:21,代码来源:disappearing_server.c


示例18: 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);
}
开发者ID:Abioy,项目名称:kythe,代码行数:54,代码来源:cancel_after_accept_and_writes_closed_legacy.c


示例19: 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);
}
开发者ID:Abioy,项目名称:kythe,代码行数:53,代码来源:graceful_server_shutdown_legacy.c


示例20: test_invoke_10_simple_requests

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);
}
开发者ID:larsonmpdx,项目名称:grpc,代码行数:14,代码来源:registered_call.c



注:本文中的grpc_end2end_test_config类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ gtString类代码示例发布时间:2022-05-31
下一篇:
C++ group类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap