clang-format

reviewable/pr8532/r1
Craig Tiller 8 years ago
parent 5b676a6b1a
commit 28b72428a8
  1. 3
      include/grpc++/impl/codegen/core_codegen_interface.h
  2. 2
      src/core/ext/census/grpc_filter.c
  3. 2
      src/core/ext/client_channel/http_connect_handshaker.c
  4. 9
      src/core/ext/transport/chttp2/transport/bin_encoder.c
  5. 3
      src/core/ext/transport/chttp2/transport/bin_encoder.h
  6. 2
      src/core/ext/transport/chttp2/transport/frame.h
  7. 2
      src/core/ext/transport/chttp2/transport/frame_goaway.h
  8. 2
      src/core/ext/transport/chttp2/transport/frame_settings.h
  9. 4
      src/core/ext/transport/chttp2/transport/frame_window_update.h
  10. 3
      src/core/ext/transport/chttp2/transport/hpack_encoder.c
  11. 2
      src/core/ext/transport/chttp2/transport/hpack_encoder.h
  12. 4
      src/core/ext/transport/chttp2/transport/hpack_parser.c
  13. 2
      src/core/ext/transport/chttp2/transport/hpack_table.h
  14. 3
      src/core/ext/transport/chttp2/transport/internal.h
  15. 8
      src/core/ext/transport/chttp2/transport/parsing.c
  16. 2
      src/core/ext/transport/cronet/transport/cronet_transport.c
  17. 2
      src/core/lib/channel/compress_filter.c
  18. 2
      src/core/lib/channel/connected_channel.c
  19. 4
      src/core/lib/channel/handshaker.c
  20. 5
      src/core/lib/http/format_request.c
  21. 2
      src/core/lib/http/parser.h
  22. 2
      src/core/lib/iomgr/tcp_client_windows.c
  23. 2
      src/core/lib/iomgr/tcp_windows.c
  24. 2
      src/core/lib/security/transport/handshake.c
  25. 2
      src/core/lib/security/transport/security_connector.c
  26. 2
      src/core/lib/slice/slice.c
  27. 8
      src/core/lib/slice/slice_buffer.c
  28. 3
      src/core/lib/surface/byte_buffer.c
  29. 2
      src/core/lib/surface/byte_buffer_reader.c
  30. 2
      src/core/lib/transport/metadata_batch.h
  31. 2
      src/cpp/client/channel_cc.cc
  32. 11
      src/cpp/common/core_codegen.cc
  33. 8
      test/core/compression/message_compress_test.c
  34. 3
      test/core/end2end/cq_verifier.c
  35. 3
      test/core/end2end/invalid_call_argument_test.c
  36. 6
      test/core/end2end/tests/binary_metadata.c
  37. 9
      test/core/end2end/tests/call_creds.c
  38. 6
      test/core/end2end/tests/cancel_after_accept.c
  39. 6
      test/core/end2end/tests/cancel_after_client_done.c
  40. 3
      test/core/end2end/tests/cancel_after_invoke.c
  41. 3
      test/core/end2end/tests/cancel_before_invoke.c
  42. 3
      test/core/end2end/tests/compressed_payload.c
  43. 3
      test/core/end2end/tests/filter_call_init_fails.c
  44. 3
      test/core/end2end/tests/filter_causes_close.c
  45. 3
      test/core/end2end/tests/large_metadata.c
  46. 3
      test/core/end2end/tests/load_reporting_hook.c
  47. 3
      test/core/end2end/tests/max_message_length.c
  48. 3
      test/core/end2end/tests/network_status_change.c
  49. 3
      test/core/end2end/tests/payload.c
  50. 6
      test/core/end2end/tests/ping_pong_streaming.c
  51. 3
      test/core/end2end/tests/request_with_flags.c
  52. 3
      test/core/end2end/tests/request_with_payload.c
  53. 3
      test/core/end2end/tests/resource_quota_server.c
  54. 6
      test/core/end2end/tests/simple_cacheable_request.c
  55. 6
      test/core/end2end/tests/simple_metadata.c
  56. 6
      test/core/end2end/tests/trailing_metadata.c
  57. 2
      test/core/iomgr/endpoint_tests.c
  58. 2
      test/core/iomgr/load_file_test.c
  59. 2
      test/core/security/b64_test.c
  60. 2
      test/core/security/create_jwt.c
  61. 3
      test/core/security/credentials_test.c
  62. 2
      test/core/security/fetch_oauth2.c
  63. 2
      test/core/security/json_token_test.c
  64. 6
      test/core/security/jwt_verifier_test.c
  65. 2
      test/core/security/oauth2_utils.c
  66. 2
      test/core/security/print_google_default_creds_token.c
  67. 2
      test/core/security/verify_jwt.c
  68. 2
      test/core/slice/slice_buffer_test.c
  69. 11
      test/core/slice/slice_test.c
  70. 2
      test/core/transport/chttp2/hpack_parser_test.c
  71. 5
      test/core/transport/chttp2/varint_test.c
  72. 3
      test/core/util/mock_endpoint.h
  73. 3
      test/core/util/one_corpus_entry_fuzzer.c
  74. 3
      test/cpp/grpclb/grpclb_test.cc
  75. 2
      test/cpp/util/cli_call.cc

@ -96,7 +96,8 @@ class CoreCodegenInterface {
virtual grpc_slice grpc_slice_malloc(size_t length) = 0;
virtual void grpc_slice_unref(grpc_slice slice) = 0;
virtual grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) = 0;
virtual void grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice slice) = 0;
virtual void grpc_slice_buffer_add(grpc_slice_buffer* sb,
grpc_slice slice) = 0;
virtual void grpc_slice_buffer_pop(grpc_slice_buffer* sb) = 0;
virtual void grpc_metadata_array_init(grpc_metadata_array* array) = 0;

@ -37,9 +37,9 @@
#include <string.h>
#include <grpc/census.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/time.h>
#include "src/core/ext/census/census_interface.h"

@ -35,9 +35,9 @@
#include <string.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/client_channel/uri_parser.h"

@ -114,13 +114,15 @@ grpc_slice grpc_chttp2_huffman_compress(grpc_slice input) {
uint32_t temp_length = 0;
nbits = 0;
for (in = GRPC_SLICE_START_PTR(input); in != GRPC_SLICE_END_PTR(input); ++in) {
for (in = GRPC_SLICE_START_PTR(input); in != GRPC_SLICE_END_PTR(input);
++in) {
nbits += grpc_chttp2_huffsyms[*in].length;
}
output = grpc_slice_malloc(nbits / 8 + (nbits % 8 != 0));
out = GRPC_SLICE_START_PTR(output);
for (in = GRPC_SLICE_START_PTR(input); in != GRPC_SLICE_END_PTR(input); ++in) {
for (in = GRPC_SLICE_START_PTR(input); in != GRPC_SLICE_END_PTR(input);
++in) {
int sym = *in;
temp <<= grpc_chttp2_huffsyms[sym].length;
temp |= grpc_chttp2_huffsyms[sym].bits;
@ -175,7 +177,8 @@ static void enc_add1(huff_out *out, uint8_t a) {
enc_flush_some(out);
}
grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(grpc_slice input) {
grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(
grpc_slice input) {
size_t input_length = GRPC_SLICE_LENGTH(input);
size_t input_triplets = input_length / 3;
size_t tail_case = input_length % 3;

@ -49,6 +49,7 @@ grpc_slice grpc_chttp2_huffman_compress(grpc_slice input);
grpc_slice y = grpc_chttp2_huffman_compress(x);
grpc_slice_unref(x);
return y; */
grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(grpc_slice input);
grpc_slice grpc_chttp2_base64_encode_and_huffman_compress_impl(
grpc_slice input);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */

@ -34,8 +34,8 @@
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/error.h"

@ -34,9 +34,9 @@
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/iomgr/exec_ctx.h"

@ -34,8 +34,8 @@
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/iomgr/exec_ctx.h"

@ -45,8 +45,8 @@ typedef struct {
uint32_t amount;
} grpc_chttp2_window_update_parser;
grpc_slice grpc_chttp2_window_update_create(uint32_t id, uint32_t window_delta,
grpc_transport_one_way_stats *stats);
grpc_slice grpc_chttp2_window_update_create(
uint32_t id, uint32_t window_delta, grpc_transport_one_way_stats *stats);
grpc_error *grpc_chttp2_window_update_parser_begin_frame(
grpc_chttp2_window_update_parser *parser, uint32_t length, uint8_t flags);

@ -269,7 +269,8 @@ static void emit_indexed(grpc_chttp2_hpack_compressor *c, uint32_t elem_index,
}
static grpc_slice get_wire_value(grpc_mdelem *elem, uint8_t *huffman_prefix) {
if (grpc_is_binary_header((const char *)GRPC_SLICE_START_PTR(elem->key->slice),
if (grpc_is_binary_header(
(const char *)GRPC_SLICE_START_PTR(elem->key->slice),
GRPC_SLICE_LENGTH(elem->key->slice))) {
*huffman_prefix = 0x80;
return grpc_mdstr_as_base64_encoded_and_huffman_compressed(elem->value);

@ -34,9 +34,9 @@
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/transport/metadata_batch.h"

@ -1501,8 +1501,8 @@ static grpc_error *is_binary_indexed_header(grpc_chttp2_hpack_parser *p,
GRPC_ERROR_INT_INDEX, (intptr_t)p->index),
GRPC_ERROR_INT_SIZE, (intptr_t)p->table.num_ents);
}
*is =
grpc_is_binary_header((const char *)GRPC_SLICE_START_PTR(elem->key->slice),
*is = grpc_is_binary_header(
(const char *)GRPC_SLICE_START_PTR(elem->key->slice),
GRPC_SLICE_LENGTH(elem->key->slice));
return GRPC_ERROR_NONE;
}

@ -34,8 +34,8 @@
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/transport/metadata.h"

@ -466,7 +466,8 @@ void grpc_chttp2_end_write(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
/** Process one slice of incoming data; return 1 if the connection is still
viable after reading, or 0 if the connection should be torn down */
grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t, grpc_slice slice);
grpc_chttp2_transport *t,
grpc_slice slice);
bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport *t,
grpc_chttp2_stream *s);

@ -229,8 +229,8 @@ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
case GRPC_DTS_FRAME:
GPR_ASSERT(cur < end);
if ((uint32_t)(end - cur) == t->incoming_frame_size) {
err = parse_frame_slice(exec_ctx, t,
grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
err = parse_frame_slice(
exec_ctx, t, grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
(size_t)(end - beg)),
1);
if (err != GRPC_ERROR_NONE) {
@ -253,8 +253,8 @@ grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
t->incoming_stream = NULL;
goto dts_fh_0; /* loop */
} else {
err = parse_frame_slice(exec_ctx, t,
grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
err = parse_frame_slice(
exec_ctx, t, grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
(size_t)(end - beg)),
0);
if (err != GRPC_ERROR_NONE) {

@ -34,10 +34,10 @@
#include <string.h>
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>

@ -35,9 +35,9 @@
#include <string.h>
#include <grpc/compression.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice_buffer.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/compress_filter.h"

@ -38,9 +38,9 @@
#include <string.h>
#include <grpc/byte_buffer.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice_buffer.h>
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/support/string.h"
#include "src/core/lib/transport/transport.h"

@ -146,8 +146,8 @@ void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx,
static void call_next_handshaker(grpc_exec_ctx* exec_ctx,
grpc_endpoint* endpoint,
grpc_channel_args* args,
grpc_slice_buffer* read_buffer, void* user_data,
grpc_error* error) {
grpc_slice_buffer* read_buffer,
void* user_data, grpc_error* error) {
grpc_handshake_manager* mgr = user_data;
GPR_ASSERT(mgr->state != NULL);
GPR_ASSERT(mgr->state->index < mgr->count);

@ -37,8 +37,8 @@
#include <stdio.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/support/string.h"
@ -65,7 +65,8 @@ static void fill_common_header(const grpc_httpcli_request *request,
}
}
grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request) {
grpc_slice grpc_httpcli_format_get_request(
const grpc_httpcli_request *request) {
gpr_strvec out;
char *flat;
size_t flat_len;

@ -34,8 +34,8 @@
#ifndef GRPC_CORE_LIB_HTTP_PARSER_H
#define GRPC_CORE_LIB_HTTP_PARSER_H
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/error.h"
/* Maximum length of a header string of the form 'Key: Value\r\n' */

@ -37,10 +37,10 @@
#include "src/core/lib/iomgr/sockaddr_windows.h"
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/useful.h>
#include "src/core/lib/iomgr/iocp_windows.h"

@ -40,10 +40,10 @@
#include "src/core/lib/iomgr/network_status_tracker.h"
#include "src/core/lib/iomgr/sockaddr_windows.h"
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>

@ -36,9 +36,9 @@
#include <stdbool.h>
#include <string.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice_buffer.h>
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/transport/secure_endpoint.h"

@ -36,10 +36,10 @@
#include <stdbool.h>
#include <string.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/transport/chttp2/alpn/alpn.h"

@ -31,9 +31,9 @@
*
*/
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <string.h>

@ -31,8 +31,8 @@
*
*/
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/port_platform.h>
#include <string.h>
@ -112,7 +112,8 @@ void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice s) {
writes */
if (!s.refcount && n) {
grpc_slice *back = &sb->slices[n - 1];
if (!back->refcount && back->data.inlined.length < GRPC_SLICE_INLINED_SIZE) {
if (!back->refcount &&
back->data.inlined.length < GRPC_SLICE_INLINED_SIZE) {
if (s.data.inlined.length + back->data.inlined.length <=
GRPC_SLICE_INLINED_SIZE) {
memcpy(back->data.inlined.bytes + back->data.inlined.length,
@ -193,7 +194,8 @@ void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b) {
}
}
void grpc_slice_buffer_move_into(grpc_slice_buffer *src, grpc_slice_buffer *dst) {
void grpc_slice_buffer_move_into(grpc_slice_buffer *src,
grpc_slice_buffer *dst) {
/* anything to move? */
if (src->count == 0) {
return;

@ -42,7 +42,8 @@ grpc_byte_buffer *grpc_raw_byte_buffer_create(grpc_slice *slices,
}
grpc_byte_buffer *grpc_raw_compressed_byte_buffer_create(
grpc_slice *slices, size_t nslices, grpc_compression_algorithm compression) {
grpc_slice *slices, size_t nslices,
grpc_compression_algorithm compression) {
size_t i;
grpc_byte_buffer *bb = gpr_malloc(sizeof(grpc_byte_buffer));
bb->type = GRPC_BB_RAW;

@ -37,9 +37,9 @@
#include <grpc/byte_buffer.h>
#include <grpc/compression.h>
#include <grpc/grpc.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice_buffer.h>
#include "src/core/lib/compression/message_compress.h"

@ -37,8 +37,8 @@
#include <stdbool.h>
#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
#include "src/core/lib/transport/metadata.h"

@ -47,8 +47,8 @@
#include <grpc++/support/status.h>
#include <grpc++/support/time.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include "src/core/lib/profiling/timers.h"
namespace grpc {

@ -39,11 +39,11 @@
#include <grpc/byte_buffer.h>
#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/sync.h>
#include "src/core/lib/profiling/timers.h"
@ -115,13 +115,16 @@ grpc_slice CoreCodegen::grpc_slice_malloc(size_t length) {
return ::grpc_slice_malloc(length);
}
void CoreCodegen::grpc_slice_unref(grpc_slice slice) { ::grpc_slice_unref(slice); }
void CoreCodegen::grpc_slice_unref(grpc_slice slice) {
::grpc_slice_unref(slice);
}
grpc_slice CoreCodegen::grpc_slice_split_tail(grpc_slice* s, size_t split) {
return ::grpc_slice_split_tail(s, split);
}
void CoreCodegen::grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice slice) {
void CoreCodegen::grpc_slice_buffer_add(grpc_slice_buffer* sb,
grpc_slice slice) {
::grpc_slice_buffer_add(sb, slice);
}

@ -70,8 +70,8 @@ static void assert_passthrough(grpc_slice value,
GPR_INFO, "assert_passthrough: value_length=%" PRIuPTR
" value_hash=0x%08x "
"algorithm='%s' uncompressed_split='%s' compressed_split='%s'",
GRPC_SLICE_LENGTH(value),
gpr_murmur_hash3(GRPC_SLICE_START_PTR(value), GRPC_SLICE_LENGTH(value), 0),
GRPC_SLICE_LENGTH(value), gpr_murmur_hash3(GRPC_SLICE_START_PTR(value),
GRPC_SLICE_LENGTH(value), 0),
algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode),
grpc_slice_split_mode_name(compressed_split_mode));
@ -237,8 +237,8 @@ static void test_bad_compression_algorithm(void) {
grpc_slice_buffer_init(&input);
grpc_slice_buffer_init(&output);
grpc_slice_buffer_add(&input,
grpc_slice_from_copied_string("Never gonna give you up"));
grpc_slice_buffer_add(
&input, grpc_slice_from_copied_string("Never gonna give you up"));
was_compressed =
grpc_msg_compress(GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output);
GPR_ASSERT(0 == was_compressed);

@ -119,7 +119,8 @@ static grpc_slice merge_slices(grpc_slice *slices, size_t nslices) {
cursor = GRPC_SLICE_START_PTR(out);
for (i = 0; i < nslices; i++) {
memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]), GRPC_SLICE_LENGTH(slices[i]));
memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]),
GRPC_SLICE_LENGTH(slices[i]));
cursor += GRPC_SLICE_LENGTH(slices[i]);
}

@ -251,7 +251,8 @@ static void test_send_messages_at_the_same_time() {
gpr_log(GPR_INFO, "test_send_messages_at_the_same_time");
grpc_op *op;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
prepare_test(1);

@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload(
grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice =
grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =

@ -135,8 +135,10 @@ static void request_response_with_payload_and_call_creds(
override_mode mode) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice =
grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
@ -389,7 +391,8 @@ static void test_request_with_server_rejecting_client_creds(
char *details = NULL;
size_t details_capacity = 0;
grpc_byte_buffer *response_payload_recv = NULL;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_call_credentials *creds;

@ -118,8 +118,10 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
size_t details_capacity = 0;
grpc_byte_buffer *request_payload_recv = NULL;
grpc_byte_buffer *response_payload_recv = NULL;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice =
grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =

@ -117,8 +117,10 @@ static void test_cancel_after_accept_and_writes_closed(
size_t details_capacity = 0;
grpc_byte_buffer *request_payload_recv = NULL;
grpc_byte_buffer *response_payload_recv = NULL;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice =
grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =

@ -116,7 +116,8 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
char *details = NULL;
size_t details_capacity = 0;
grpc_byte_buffer *response_payload_recv = NULL;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);

@ -114,7 +114,8 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config,
char *details = NULL;
size_t details_capacity = 0;
grpc_byte_buffer *response_payload_recv = NULL;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);

@ -308,7 +308,8 @@ static void request_with_payload_template(
response_str[1023] = '\0';
request_payload_slice = grpc_slice_from_copied_string(request_str);
grpc_slice response_payload_slice = grpc_slice_from_copied_string(response_str);
grpc_slice response_payload_slice =
grpc_slice_from_copied_string(response_str);
client_args = grpc_channel_args_set_compression_algorithm(
NULL, default_client_channel_compression_algorithm);

@ -108,7 +108,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_request(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();

@ -104,7 +104,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_request(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();

@ -99,7 +99,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_request_with_large_metadata(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();

@ -128,7 +128,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f,
grpc_metadata *initial_lr_metadata,
grpc_metadata *trailing_lr_metadata) {
grpc_slice request_payload_slice = grpc_slice_from_static_string(request_msg);
grpc_slice response_payload_slice = grpc_slice_from_static_string(response_msg);
grpc_slice response_payload_slice =
grpc_slice_from_static_string(response_msg);
grpc_call *c;
grpc_call *s;
grpc_byte_buffer *request_payload =

@ -116,7 +116,8 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config,
cq_verifier *cqv;
grpc_op ops[6];
grpc_op *op;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *recv_payload = NULL;

@ -102,7 +102,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_invoke_network_status_change(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();

@ -95,7 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy(f->cq);
}
/* Creates and returns a grpc_slice containing random alphanumeric characters. */
/* Creates and returns a grpc_slice containing random alphanumeric characters.
*/
static grpc_slice generate_random_slice() {
size_t i;
static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";

@ -120,8 +120,10 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
grpc_byte_buffer *response_payload;
grpc_byte_buffer *response_payload_recv;
int i;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice =
grpc_slice_from_copied_string("hello you");
c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
"/foo", "foo.test.google.fr:1234", deadline,

@ -100,7 +100,8 @@ static void test_invoke_request_with_flags(
grpc_end2end_test_config config, uint32_t *flags_for_op,
grpc_call_error call_start_batch_expected_result) {
grpc_call *c;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();

@ -99,7 +99,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();

@ -95,7 +95,8 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy(f->cq);
}
/* Creates and returns a grpc_slice containing random alphanumeric characters. */
/* Creates and returns a grpc_slice containing random alphanumeric characters.
*/
static grpc_slice generate_random_slice() {
size_t i;
static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";

@ -102,8 +102,10 @@ static void test_cacheable_request_response_with_metadata_and_payload(
grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice =
grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =

@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload(
grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice =
grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =

@ -100,8 +100,10 @@ static void test_request_response_with_metadata_and_payload(
grpc_end2end_test_config config) {
grpc_call *c;
grpc_call *s;
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_slice response_payload_slice =
grpc_slice_from_copied_string("hello you");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =

@ -36,9 +36,9 @@
#include <stdbool.h>
#include <sys/types.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "test/core/util/test_config.h"

@ -34,9 +34,9 @@
#include <stdio.h>
#include <string.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/support/string.h"

@ -35,9 +35,9 @@
#include <string.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include "test/core/util/test_config.h"
static int buffers_are_equal(const unsigned char *buf1,

@ -37,10 +37,10 @@
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/cmdline.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
void create_jwt(const char *json_key_file_path, const char *service_url,
const char *scope) {

@ -243,7 +243,8 @@ static void test_oauth2_token_fetcher_creds_parsing_ok(void) {
GPR_ASSERT(token_lifetime.tv_sec == 3599);
GPR_ASSERT(token_lifetime.tv_nsec == 0);
GPR_ASSERT(token_md->num_entries == 1);
GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].key, "authorization") == 0);
GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].key, "authorization") ==
0);
GPR_ASSERT(grpc_slice_str_cmp(token_md->entries[0].value,
"Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") ==
0);

@ -36,10 +36,10 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/cmdline.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/sync.h>
#include "src/core/lib/iomgr/load_file.h"

@ -37,9 +37,9 @@
#include <string.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include "src/core/lib/json/json.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"

@ -37,9 +37,9 @@
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/http/httpcli.h"
@ -487,8 +487,8 @@ static void corrupt_jwt_sig(char *jwt) {
GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(sig));
sig_bytes = GRPC_SLICE_START_PTR(sig);
(*sig_bytes)++; /* Corrupt first byte. */
bad_b64_sig =
grpc_base64_encode(GRPC_SLICE_START_PTR(sig), GRPC_SLICE_LENGTH(sig), 1, 0);
bad_b64_sig = grpc_base64_encode(GRPC_SLICE_START_PTR(sig),
GRPC_SLICE_LENGTH(sig), 1, 0);
memcpy(last_dot + 1, bad_b64_sig, strlen(bad_b64_sig));
gpr_free(bad_b64_sig);
grpc_slice_unref(sig);

@ -37,9 +37,9 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/sync.h>
#include "src/core/lib/security/credentials/credentials.h"

@ -36,10 +36,10 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/cmdline.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/sync.h>
#include "src/core/lib/security/credentials/composite/composite_credentials.h"

@ -36,10 +36,10 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/cmdline.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/sync.h>
#include "src/core/lib/security/credentials/jwt/jwt_verifier.h"

@ -31,8 +31,8 @@
*
*/
#include <grpc/support/log.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/log.h>
#include "test/core/util/test_config.h"
void test_slice_buffer_add() {

@ -170,11 +170,12 @@ static void test_slice_sub_works(unsigned length) {
grpc_slice_unref(slice);
}
static void check_head_tail(grpc_slice slice, grpc_slice head, grpc_slice tail) {
static void check_head_tail(grpc_slice slice, grpc_slice head,
grpc_slice tail) {
GPR_ASSERT(GRPC_SLICE_LENGTH(slice) ==
GRPC_SLICE_LENGTH(head) + GRPC_SLICE_LENGTH(tail));
GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice), GRPC_SLICE_START_PTR(head),
GRPC_SLICE_LENGTH(head)));
GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice),
GRPC_SLICE_START_PTR(head), GRPC_SLICE_LENGTH(head)));
GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(head),
GRPC_SLICE_START_PTR(tail), GRPC_SLICE_LENGTH(tail)));
}
@ -243,8 +244,8 @@ static void test_slice_from_copied_string_works(void) {
slice = grpc_slice_from_copied_string(text);
GPR_ASSERT(strlen(text) == GRPC_SLICE_LENGTH(slice));
GPR_ASSERT(0 ==
memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice)));
GPR_ASSERT(
0 == memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice)));
grpc_slice_unref(slice);
}

@ -36,9 +36,9 @@
#include <stdarg.h>
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include "test/core/util/parse_hexstring.h"
#include "test/core/util/slice_splitter.h"
#include "test/core/util/test_config.h"

@ -33,15 +33,16 @@
#include "src/core/ext/transport/chttp2/transport/varint.h"
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include "test/core/util/test_config.h"
static void test_varint(uint32_t value, uint32_t prefix_bits, uint8_t prefix_or,
const char *expect_bytes, size_t expect_length) {
uint32_t nbytes = GRPC_CHTTP2_VARINT_LENGTH(value, prefix_bits);
grpc_slice expect = grpc_slice_from_copied_buffer(expect_bytes, expect_length);
grpc_slice expect =
grpc_slice_from_copied_buffer(expect_bytes, expect_length);
grpc_slice slice;
gpr_log(GPR_DEBUG, "Test: 0x%08x", value);
GPR_ASSERT(nbytes == expect_length);

@ -39,6 +39,7 @@
grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
grpc_resource_quota *resource_quota);
void grpc_mock_endpoint_put_read(grpc_exec_ctx *exec_ctx,
grpc_endpoint *mock_endpoint, grpc_slice slice);
grpc_endpoint *mock_endpoint,
grpc_slice slice);
#endif

@ -47,7 +47,8 @@ int main(int argc, char **argv) {
leak_check = false;
GPR_ASSERT(
GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer)));
LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer), GRPC_SLICE_LENGTH(buffer));
LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer),
GRPC_SLICE_LENGTH(buffer));
grpc_slice_unref(buffer);
return 0;
}

@ -456,7 +456,8 @@ static void perform_request(client_fixture *cf) {
int i;
memset(ops, 0, sizeof(ops));
grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world");
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
c = grpc_channel_create_call(cf->client, NULL, GRPC_PROPAGATE_DEFAULTS,
cf->cq, "/foo", "foo.test.google.fr:1234",

@ -41,8 +41,8 @@
#include <grpc++/generic/generic_stub.h>
#include <grpc++/support/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
namespace grpc {
namespace testing {

Loading…
Cancel
Save