aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
Diffstat (limited to 'test/core')
-rw-r--r--test/core/bad_client/tests/large_metadata.c2
-rw-r--r--test/core/bad_ssl/servers/cert.c4
-rw-r--r--test/core/compression/message_compress_test.c12
-rw-r--r--test/core/end2end/cq_verifier.c14
-rw-r--r--test/core/end2end/fixtures/http_proxy.c16
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.c2
-rw-r--r--test/core/end2end/tests/invoke_large_request.c2
-rw-r--r--test/core/handshake/client_ssl.c6
-rw-r--r--test/core/handshake/server_ssl.c6
-rw-r--r--test/core/iomgr/endpoint_tests.c12
-rw-r--r--test/core/iomgr/load_file_test.c20
-rw-r--r--test/core/iomgr/tcp_posix_test.c12
-rw-r--r--test/core/security/b64_test.c28
-rw-r--r--test/core/security/create_jwt.c2
-rw-r--r--test/core/security/fetch_oauth2.c2
-rw-r--r--test/core/security/json_token_test.c18
-rw-r--r--test/core/security/jwt_verifier_test.c14
-rw-r--r--test/core/security/oauth2_utils.c8
-rw-r--r--test/core/security/secure_endpoint_test.c4
-rw-r--r--test/core/security/security_connector_test.c2
-rw-r--r--test/core/slice/slice_test.c38
-rw-r--r--test/core/surface/byte_buffer_reader_test.c42
-rw-r--r--test/core/transport/chttp2/hpack_parser_test.c4
-rw-r--r--test/core/transport/chttp2/varint_test.c2
-rw-r--r--test/core/transport/metadata_test.c2
-rw-r--r--test/core/util/one_corpus_entry_fuzzer.c2
-rw-r--r--test/core/util/parse_hexstring.c2
-rw-r--r--test/core/util/slice_splitter.c24
28 files changed, 151 insertions, 151 deletions
diff --git a/test/core/bad_client/tests/large_metadata.c b/test/core/bad_client/tests/large_metadata.c
index 124035c070..9c804e78c1 100644
--- a/test/core/bad_client/tests/large_metadata.c
+++ b/test/core/bad_client/tests/large_metadata.c
@@ -192,7 +192,7 @@ static void client_validator(grpc_slice_buffer *incoming) {
grpc_slice last_frame = last_frame_buffer.slices[0];
// Construct expected frame.
grpc_slice expected = grpc_slice_malloc(13);
- uint8_t *p = GPR_SLICE_START_PTR(expected);
+ uint8_t *p = GRPC_SLICE_START_PTR(expected);
// Length.
*p++ = 0;
*p++ = 0;
diff --git a/test/core/bad_ssl/servers/cert.c b/test/core/bad_ssl/servers/cert.c
index 52922f5d6b..9aadf452e2 100644
--- a/test/core/bad_ssl/servers/cert.c
+++ b/test/core/bad_ssl/servers/cert.c
@@ -61,8 +61,8 @@ int main(int argc, char **argv) {
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"load_file", grpc_load_file("src/core/lib/tsi/test_creds/badserver.key",
1, &key_slice)));
- pem_key_cert_pair.private_key = (const char *)GPR_SLICE_START_PTR(key_slice);
- pem_key_cert_pair.cert_chain = (const char *)GPR_SLICE_START_PTR(cert_slice);
+ pem_key_cert_pair.private_key = (const char *)GRPC_SLICE_START_PTR(key_slice);
+ pem_key_cert_pair.cert_chain = (const char *)GRPC_SLICE_START_PTR(cert_slice);
ssl_creds =
grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL);
diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c
index c6963df85d..680850af33 100644
--- a/test/core/compression/message_compress_test.c
+++ b/test/core/compression/message_compress_test.c
@@ -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'",
- GPR_SLICE_LENGTH(value),
- gpr_murmur_hash3(GPR_SLICE_START_PTR(value), GPR_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));
@@ -114,7 +114,7 @@ static void assert_passthrough(grpc_slice value,
static grpc_slice repeated(char c, size_t length) {
grpc_slice out = grpc_slice_malloc(length);
- memset(GPR_SLICE_START_PTR(out), c, length);
+ memset(GRPC_SLICE_START_PTR(out), c, length);
return out;
}
@@ -184,9 +184,9 @@ static void test_bad_decompression_data_crc(void) {
grpc_msg_compress(GRPC_COMPRESS_GZIP, &input, &corrupted);
/* corrupt the output by smashing the CRC */
GPR_ASSERT(corrupted.count > 1);
- GPR_ASSERT(GPR_SLICE_LENGTH(corrupted.slices[1]) > 8);
- idx = GPR_SLICE_LENGTH(corrupted.slices[1]) - 8;
- memcpy(GPR_SLICE_START_PTR(corrupted.slices[1]) + idx, &bad, 4);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(corrupted.slices[1]) > 8);
+ idx = GRPC_SLICE_LENGTH(corrupted.slices[1]) - 8;
+ memcpy(GRPC_SLICE_START_PTR(corrupted.slices[1]) + idx, &bad, 4);
/* try (and fail) to decompress the corrupted compresed buffer */
GPR_ASSERT(0 == grpc_msg_decompress(GRPC_COMPRESS_GZIP, &corrupted, &output));
diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c
index 3b9aa24368..4fb89eb96e 100644
--- a/test/core/end2end/cq_verifier.c
+++ b/test/core/end2end/cq_verifier.c
@@ -112,15 +112,15 @@ static grpc_slice merge_slices(grpc_slice *slices, size_t nslices) {
grpc_slice out;
for (i = 0; i < nslices; i++) {
- len += GPR_SLICE_LENGTH(slices[i]);
+ len += GRPC_SLICE_LENGTH(slices[i]);
}
out = grpc_slice_malloc(len);
- cursor = GPR_SLICE_START_PTR(out);
+ cursor = GRPC_SLICE_START_PTR(out);
for (i = 0; i < nslices; i++) {
- memcpy(cursor, GPR_SLICE_START_PTR(slices[i]), GPR_SLICE_LENGTH(slices[i]));
- cursor += GPR_SLICE_LENGTH(slices[i]);
+ memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]), GRPC_SLICE_LENGTH(slices[i]));
+ cursor += GRPC_SLICE_LENGTH(slices[i]);
}
return out;
@@ -134,9 +134,9 @@ int raw_byte_buffer_eq_slice(grpc_byte_buffer *rbb, grpc_slice b) {
a = merge_slices(rbb->data.raw.slice_buffer.slices,
rbb->data.raw.slice_buffer.count);
- ok = GPR_SLICE_LENGTH(a) == GPR_SLICE_LENGTH(b) &&
- 0 == memcmp(GPR_SLICE_START_PTR(a), GPR_SLICE_START_PTR(b),
- GPR_SLICE_LENGTH(a));
+ ok = GRPC_SLICE_LENGTH(a) == GRPC_SLICE_LENGTH(b) &&
+ 0 == memcmp(GRPC_SLICE_START_PTR(a), GRPC_SLICE_START_PTR(b),
+ GRPC_SLICE_LENGTH(a));
grpc_slice_unref(a);
grpc_slice_unref(b);
return ok;
diff --git a/test/core/end2end/fixtures/http_proxy.c b/test/core/end2end/fixtures/http_proxy.c
index 80b9677577..57fc4a38f8 100644
--- a/test/core/end2end/fixtures/http_proxy.c
+++ b/test/core/end2end/fixtures/http_proxy.c
@@ -37,11 +37,11 @@
#include <string.h>
+#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.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/sync.h>
#include <grpc/support/thd.h>
@@ -151,7 +151,7 @@ static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg,
// write that data now.
if (conn->client_deferred_write_buffer.length > 0) {
grpc_slice_buffer_move_into(&conn->client_deferred_write_buffer,
- &conn->client_write_buffer);
+ &conn->client_write_buffer);
grpc_endpoint_write(exec_ctx, conn->client_endpoint,
&conn->client_write_buffer,
&conn->on_client_write_done);
@@ -176,7 +176,7 @@ static void on_server_write_done(grpc_exec_ctx* exec_ctx, void* arg,
// write that data now.
if (conn->server_deferred_write_buffer.length > 0) {
grpc_slice_buffer_move_into(&conn->server_deferred_write_buffer,
- &conn->server_write_buffer);
+ &conn->server_write_buffer);
grpc_endpoint_write(exec_ctx, conn->server_endpoint,
&conn->server_write_buffer,
&conn->on_server_write_done);
@@ -204,10 +204,10 @@ static void on_client_read_done(grpc_exec_ctx* exec_ctx, void* arg,
// Otherwise, move the read data into the write buffer and write it.
if (conn->server_write_buffer.length > 0) {
grpc_slice_buffer_move_into(&conn->client_read_buffer,
- &conn->server_deferred_write_buffer);
+ &conn->server_deferred_write_buffer);
} else {
grpc_slice_buffer_move_into(&conn->client_read_buffer,
- &conn->server_write_buffer);
+ &conn->server_write_buffer);
gpr_ref(&conn->refcount);
grpc_endpoint_write(exec_ctx, conn->server_endpoint,
&conn->server_write_buffer,
@@ -236,10 +236,10 @@ static void on_server_read_done(grpc_exec_ctx* exec_ctx, void* arg,
// Otherwise, move the read data into the write buffer and write it.
if (conn->client_write_buffer.length > 0) {
grpc_slice_buffer_move_into(&conn->server_read_buffer,
- &conn->client_deferred_write_buffer);
+ &conn->client_deferred_write_buffer);
} else {
grpc_slice_buffer_move_into(&conn->server_read_buffer,
- &conn->client_write_buffer);
+ &conn->client_write_buffer);
gpr_ref(&conn->refcount);
grpc_endpoint_write(exec_ctx, conn->client_endpoint,
&conn->client_write_buffer,
@@ -313,7 +313,7 @@ static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg,
}
// Read request and feed it to the parser.
for (size_t i = 0; i < conn->client_read_buffer.count; ++i) {
- if (GPR_SLICE_LENGTH(conn->client_read_buffer.slices[i]) > 0) {
+ if (GRPC_SLICE_LENGTH(conn->client_read_buffer.slices[i]) > 0) {
error = grpc_http_parser_parse(&conn->http_parser,
conn->client_read_buffer.slices[i], NULL);
if (error != GRPC_ERROR_NONE) {
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c
index 6834922299..4c8aafd8b3 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.c
+++ b/test/core/end2end/fuzzers/api_fuzzer.c
@@ -138,7 +138,7 @@ static uint32_t read_uint32(input_stream *inp) {
static grpc_byte_buffer *read_message(input_stream *inp) {
grpc_slice slice = grpc_slice_malloc(read_uint22(inp));
- memset(GPR_SLICE_START_PTR(slice), 0, GPR_SLICE_LENGTH(slice));
+ memset(GRPC_SLICE_START_PTR(slice), 0, GRPC_SLICE_LENGTH(slice));
grpc_byte_buffer *out = grpc_raw_byte_buffer_create(&slice, 1);
grpc_slice_unref(slice);
return out;
diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c
index 0a4d87c2fb..41d5627b59 100644
--- a/test/core/end2end/tests/invoke_large_request.c
+++ b/test/core/end2end/tests/invoke_large_request.c
@@ -96,7 +96,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
static grpc_slice large_slice(void) {
grpc_slice slice = grpc_slice_malloc(1000000);
- memset(GPR_SLICE_START_PTR(slice), 'x', GPR_SLICE_LENGTH(slice));
+ memset(GRPC_SLICE_START_PTR(slice), 'x', GRPC_SLICE_LENGTH(slice));
return slice;
}
diff --git a/test/core/handshake/client_ssl.c b/test/core/handshake/client_ssl.c
index fdece99720..44efe4dbac 100644
--- a/test/core/handshake/client_ssl.c
+++ b/test/core/handshake/client_ssl.c
@@ -238,9 +238,9 @@ static bool client_ssl_test(char *server_alpn_preferred) {
grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
grpc_load_file(SSL_KEY_PATH, 1, &key_slice)));
- const char *ca_cert = (const char *)GPR_SLICE_START_PTR(ca_slice);
- pem_key_cert_pair.private_key = (const char *)GPR_SLICE_START_PTR(key_slice);
- pem_key_cert_pair.cert_chain = (const char *)GPR_SLICE_START_PTR(cert_slice);
+ const char *ca_cert = (const char *)GRPC_SLICE_START_PTR(ca_slice);
+ pem_key_cert_pair.private_key = (const char *)GRPC_SLICE_START_PTR(key_slice);
+ pem_key_cert_pair.cert_chain = (const char *)GRPC_SLICE_START_PTR(cert_slice);
grpc_channel_credentials *ssl_creds =
grpc_ssl_credentials_create(ca_cert, &pem_key_cert_pair, NULL);
diff --git a/test/core/handshake/server_ssl.c b/test/core/handshake/server_ssl.c
index f49f98ad9a..f39b0040a6 100644
--- a/test/core/handshake/server_ssl.c
+++ b/test/core/handshake/server_ssl.c
@@ -91,9 +91,9 @@ static void server_thread(void *arg) {
grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
grpc_load_file(SSL_KEY_PATH, 1, &key_slice)));
- const char *ca_cert = (const char *)GPR_SLICE_START_PTR(ca_slice);
- pem_key_cert_pair.private_key = (const char *)GPR_SLICE_START_PTR(key_slice);
- pem_key_cert_pair.cert_chain = (const char *)GPR_SLICE_START_PTR(cert_slice);
+ const char *ca_cert = (const char *)GRPC_SLICE_START_PTR(ca_slice);
+ pem_key_cert_pair.private_key = (const char *)GRPC_SLICE_START_PTR(key_slice);
+ pem_key_cert_pair.cert_chain = (const char *)GRPC_SLICE_START_PTR(cert_slice);
grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(
ca_cert, &pem_key_cert_pair, 1, 0, NULL);
diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c
index 86afdfba72..8a1699608e 100644
--- a/test/core/iomgr/endpoint_tests.c
+++ b/test/core/iomgr/endpoint_tests.c
@@ -68,12 +68,12 @@ size_t count_slices(grpc_slice *slices, size_t nslices, int *current_data) {
size_t j;
unsigned char *buf;
for (i = 0; i < nslices; ++i) {
- buf = GPR_SLICE_START_PTR(slices[i]);
- for (j = 0; j < GPR_SLICE_LENGTH(slices[i]); ++j) {
+ buf = GRPC_SLICE_START_PTR(slices[i]);
+ for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
GPR_ASSERT(buf[j] == *current_data);
*current_data = (*current_data + 1) % 256;
}
- num_bytes += GPR_SLICE_LENGTH(slices[i]);
+ num_bytes += GRPC_SLICE_LENGTH(slices[i]);
}
return num_bytes;
}
@@ -100,9 +100,9 @@ static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
for (i = 0; i < nslices; ++i) {
slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
: slice_size);
- num_bytes_left -= GPR_SLICE_LENGTH(slices[i]);
- buf = GPR_SLICE_START_PTR(slices[i]);
- for (j = 0; j < GPR_SLICE_LENGTH(slices[i]); ++j) {
+ num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]);
+ buf = GRPC_SLICE_START_PTR(slices[i]);
+ for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
buf[j] = *current_data;
(*current_data)++;
}
diff --git a/test/core/iomgr/load_file_test.c b/test/core/iomgr/load_file_test.c
index b4e1b52d05..af822466d7 100644
--- a/test/core/iomgr/load_file_test.c
+++ b/test/core/iomgr/load_file_test.c
@@ -63,12 +63,12 @@ static void test_load_empty_file(void) {
error = grpc_load_file(tmp_name, 0, &slice);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 0);
error = grpc_load_file(tmp_name, 1, &slice_with_null_term);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice_with_null_term) == 1);
- GPR_ASSERT(GPR_SLICE_START_PTR(slice_with_null_term)[0] == 0);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice_with_null_term) == 1);
+ GPR_ASSERT(GRPC_SLICE_START_PTR(slice_with_null_term)[0] == 0);
remove(tmp_name);
gpr_free(tmp_name);
@@ -93,7 +93,7 @@ static void test_load_failure(void) {
error = grpc_load_file(tmp_name, 0, &slice);
GPR_ASSERT(error != GRPC_ERROR_NONE);
GRPC_ERROR_UNREF(error);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 0);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 0);
gpr_free(tmp_name);
grpc_slice_unref(slice);
}
@@ -116,13 +116,13 @@ static void test_load_small_file(void) {
error = grpc_load_file(tmp_name, 0, &slice);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice) == strlen(blah));
- GPR_ASSERT(!memcmp(GPR_SLICE_START_PTR(slice), blah, strlen(blah)));
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == strlen(blah));
+ GPR_ASSERT(!memcmp(GRPC_SLICE_START_PTR(slice), blah, strlen(blah)));
error = grpc_load_file(tmp_name, 1, &slice_with_null_term);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice_with_null_term) == (strlen(blah) + 1));
- GPR_ASSERT(strcmp((const char *)GPR_SLICE_START_PTR(slice_with_null_term),
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice_with_null_term) == (strlen(blah) + 1));
+ GPR_ASSERT(strcmp((const char *)GRPC_SLICE_START_PTR(slice_with_null_term),
blah) == 0);
remove(tmp_name);
@@ -153,8 +153,8 @@ static void test_load_big_file(void) {
error = grpc_load_file(tmp_name, 0, &slice);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice) == buffer_size);
- current = GPR_SLICE_START_PTR(slice);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == buffer_size);
+ current = GRPC_SLICE_START_PTR(slice);
for (i = 0; i < buffer_size; i++) {
GPR_ASSERT(current[i] == 42);
}
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c
index f23e23f03e..bba1900987 100644
--- a/test/core/iomgr/tcp_posix_test.c
+++ b/test/core/iomgr/tcp_posix_test.c
@@ -134,12 +134,12 @@ static size_t count_slices(grpc_slice *slices, size_t nslices,
unsigned i, j;
unsigned char *buf;
for (i = 0; i < nslices; ++i) {
- buf = GPR_SLICE_START_PTR(slices[i]);
- for (j = 0; j < GPR_SLICE_LENGTH(slices[i]); ++j) {
+ buf = GRPC_SLICE_START_PTR(slices[i]);
+ for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
GPR_ASSERT(buf[j] == *current_data);
*current_data = (*current_data + 1) % 256;
}
- num_bytes += GPR_SLICE_LENGTH(slices[i]);
+ num_bytes += GRPC_SLICE_LENGTH(slices[i]);
}
return num_bytes;
}
@@ -285,9 +285,9 @@ static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
for (i = 0; i < nslices; ++i) {
slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
: slice_size);
- num_bytes_left -= GPR_SLICE_LENGTH(slices[i]);
- buf = GPR_SLICE_START_PTR(slices[i]);
- for (j = 0; j < GPR_SLICE_LENGTH(slices[i]); ++j) {
+ num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]);
+ buf = GRPC_SLICE_START_PTR(slices[i]);
+ for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
buf[j] = *current_data;
(*current_data)++;
}
diff --git a/test/core/security/b64_test.c b/test/core/security/b64_test.c
index b5c123b4b8..dea0f56266 100644
--- a/test/core/security/b64_test.c
+++ b/test/core/security/b64_test.c
@@ -58,9 +58,9 @@ static void test_simple_encode_decode_b64(int url_safe, int multiline) {
char *hello_b64 =
grpc_base64_encode(hello, strlen(hello), url_safe, multiline);
grpc_slice hello_slice = grpc_base64_decode(hello_b64, url_safe);
- GPR_ASSERT(GPR_SLICE_LENGTH(hello_slice) == strlen(hello));
- GPR_ASSERT(strncmp((const char *)GPR_SLICE_START_PTR(hello_slice), hello,
- GPR_SLICE_LENGTH(hello_slice)) == 0);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(hello_slice) == strlen(hello));
+ GPR_ASSERT(strncmp((const char *)GRPC_SLICE_START_PTR(hello_slice), hello,
+ GRPC_SLICE_LENGTH(hello_slice)) == 0);
grpc_slice_unref(hello_slice);
gpr_free(hello_b64);
@@ -77,8 +77,8 @@ static void test_full_range_encode_decode_b64(int url_safe, int multiline) {
for (i = 0; i < 3; i++) {
b64 = grpc_base64_encode(orig, sizeof(orig) - i, url_safe, multiline);
orig_decoded = grpc_base64_decode(b64, url_safe);
- GPR_ASSERT(GPR_SLICE_LENGTH(orig_decoded) == (sizeof(orig) - i));
- GPR_ASSERT(buffers_are_equal(orig, GPR_SLICE_START_PTR(orig_decoded),
+ GPR_ASSERT(GRPC_SLICE_LENGTH(orig_decoded) == (sizeof(orig) - i));
+ GPR_ASSERT(buffers_are_equal(orig, GRPC_SLICE_START_PTR(orig_decoded),
sizeof(orig) - i));
grpc_slice_unref(orig_decoded);
gpr_free(b64);
@@ -127,13 +127,13 @@ static void test_url_safe_unsafe_mismtach_failure(void) {
b64 = grpc_base64_encode(orig, sizeof(orig), url_safe, 0);
orig_decoded = grpc_base64_decode(b64, !url_safe);
- GPR_ASSERT(GPR_SLICE_IS_EMPTY(orig_decoded));
+ GPR_ASSERT(GRPC_SLICE_IS_EMPTY(orig_decoded));
gpr_free(b64);
grpc_slice_unref(orig_decoded);
b64 = grpc_base64_encode(orig, sizeof(orig), !url_safe, 0);
orig_decoded = grpc_base64_decode(b64, url_safe);
- GPR_ASSERT(GPR_SLICE_IS_EMPTY(orig_decoded));
+ GPR_ASSERT(GRPC_SLICE_IS_EMPTY(orig_decoded));
gpr_free(b64);
grpc_slice_unref(orig_decoded);
}
@@ -174,37 +174,37 @@ static void test_unpadded_decode(void) {
grpc_slice decoded;
decoded = grpc_base64_decode("Zm9vYmFy", 0);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
GPR_ASSERT(grpc_slice_str_cmp(decoded, "foobar") == 0);
grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zm9vYmE", 0);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
GPR_ASSERT(grpc_slice_str_cmp(decoded, "fooba") == 0);
grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zm9vYg", 0);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
GPR_ASSERT(grpc_slice_str_cmp(decoded, "foob") == 0);
grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zm9v", 0);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
GPR_ASSERT(grpc_slice_str_cmp(decoded, "foo") == 0);
grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zm8", 0);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
GPR_ASSERT(grpc_slice_str_cmp(decoded, "fo") == 0);
grpc_slice_unref(decoded);
decoded = grpc_base64_decode("Zg", 0);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
GPR_ASSERT(grpc_slice_str_cmp(decoded, "f") == 0);
grpc_slice_unref(decoded);
decoded = grpc_base64_decode("", 0);
- GPR_ASSERT(GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(GRPC_SLICE_IS_EMPTY(decoded));
}
int main(int argc, char **argv) {
diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c
index 157e78092d..0303b791ae 100644
--- a/test/core/security/create_jwt.c
+++ b/test/core/security/create_jwt.c
@@ -50,7 +50,7 @@ void create_jwt(const char *json_key_file_path, const char *service_url,
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"load_file", grpc_load_file(json_key_file_path, 1, &json_key_data)));
key = grpc_auth_json_key_create_from_string(
- (const char *)GPR_SLICE_START_PTR(json_key_data));
+ (const char *)GRPC_SLICE_START_PTR(json_key_data));
grpc_slice_unref(json_key_data);
if (!grpc_auth_json_key_is_valid(&key)) {
fprintf(stderr, "Could not parse json key.\n");
diff --git a/test/core/security/fetch_oauth2.c b/test/core/security/fetch_oauth2.c
index 95706a5b81..ca093095c3 100644
--- a/test/core/security/fetch_oauth2.c
+++ b/test/core/security/fetch_oauth2.c
@@ -53,7 +53,7 @@ static grpc_call_credentials *create_refresh_token_creds(
"load_file",
grpc_load_file(json_refresh_token_file_path, 1, &refresh_token)));
return grpc_google_refresh_token_credentials_create(
- (const char *)GPR_SLICE_START_PTR(refresh_token), NULL);
+ (const char *)GRPC_SLICE_START_PTR(refresh_token), NULL);
}
int main(int argc, char **argv) {
diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c
index c5b0ae9425..593b79855f 100644
--- a/test/core/security/json_token_test.c
+++ b/test/core/security/json_token_test.c
@@ -228,11 +228,11 @@ static grpc_json *parse_json_part_from_jwt(const char *str, size_t len,
strncpy(b64, str, len);
b64[len] = '\0';
slice = grpc_base64_decode(b64, 1);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(slice));
- decoded = gpr_malloc(GPR_SLICE_LENGTH(slice) + 1);
- strncpy(decoded, (const char *)GPR_SLICE_START_PTR(slice),
- GPR_SLICE_LENGTH(slice));
- decoded[GPR_SLICE_LENGTH(slice)] = '\0';
+ GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(slice));
+ decoded = gpr_malloc(GRPC_SLICE_LENGTH(slice) + 1);
+ strncpy(decoded, (const char *)GRPC_SLICE_START_PTR(slice),
+ GRPC_SLICE_LENGTH(slice));
+ decoded[GRPC_SLICE_LENGTH(slice)] = '\0';
json = grpc_json_parse_string(decoded);
gpr_free(b64);
*scratchpad = decoded;
@@ -342,8 +342,8 @@ static void check_jwt_signature(const char *b64_signature, RSA *rsa_key,
EVP_PKEY *key = EVP_PKEY_new();
grpc_slice sig = grpc_base64_decode(b64_signature, 1);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(sig));
- GPR_ASSERT(GPR_SLICE_LENGTH(sig) == 128);
+ GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(sig));
+ GPR_ASSERT(GRPC_SLICE_LENGTH(sig) == 128);
GPR_ASSERT(md_ctx != NULL);
GPR_ASSERT(key != NULL);
@@ -352,8 +352,8 @@ static void check_jwt_signature(const char *b64_signature, RSA *rsa_key,
GPR_ASSERT(EVP_DigestVerifyInit(md_ctx, NULL, EVP_sha256(), NULL, key) == 1);
GPR_ASSERT(EVP_DigestVerifyUpdate(md_ctx, signed_data, signed_data_size) ==
1);
- GPR_ASSERT(EVP_DigestVerifyFinal(md_ctx, GPR_SLICE_START_PTR(sig),
- GPR_SLICE_LENGTH(sig)) == 1);
+ GPR_ASSERT(EVP_DigestVerifyFinal(md_ctx, GRPC_SLICE_START_PTR(sig),
+ GRPC_SLICE_LENGTH(sig)) == 1);
grpc_slice_unref(sig);
if (key != NULL) EVP_PKEY_free(key);
diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c
index 5c716235cd..01fe436f27 100644
--- a/test/core/security/jwt_verifier_test.c
+++ b/test/core/security/jwt_verifier_test.c
@@ -183,7 +183,7 @@ static void test_claims_success(void) {
grpc_jwt_claims *claims;
grpc_slice s = grpc_slice_from_copied_string(claims_without_time_constraint);
grpc_json *json = grpc_json_parse_string_with_len(
- (char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
+ (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
GPR_ASSERT(json != NULL);
claims = grpc_jwt_claims_from_json(json, s);
GPR_ASSERT(claims != NULL);
@@ -201,7 +201,7 @@ static void test_expired_claims_failure(void) {
grpc_jwt_claims *claims;
grpc_slice s = grpc_slice_from_copied_string(expired_claims);
grpc_json *json = grpc_json_parse_string_with_len(
- (char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
+ (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
gpr_timespec exp_iat = {100, 0, GPR_CLOCK_REALTIME};
gpr_timespec exp_exp = {120, 0, GPR_CLOCK_REALTIME};
gpr_timespec exp_nbf = {60, 0, GPR_CLOCK_REALTIME};
@@ -225,7 +225,7 @@ static void test_expired_claims_failure(void) {
static void test_invalid_claims_failure(void) {
grpc_slice s = grpc_slice_from_copied_string(invalid_claims);
grpc_json *json = grpc_json_parse_string_with_len(
- (char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
+ (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
GPR_ASSERT(grpc_jwt_claims_from_json(json, s) == NULL);
}
@@ -233,7 +233,7 @@ static void test_bad_audience_claims_failure(void) {
grpc_jwt_claims *claims;
grpc_slice s = grpc_slice_from_copied_string(claims_without_time_constraint);
grpc_json *json = grpc_json_parse_string_with_len(
- (char *)GPR_SLICE_START_PTR(s), GPR_SLICE_LENGTH(s));
+ (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
GPR_ASSERT(json != NULL);
claims = grpc_jwt_claims_from_json(json, s);
GPR_ASSERT(claims != NULL);
@@ -484,11 +484,11 @@ static void corrupt_jwt_sig(char *jwt) {
char *last_dot = strrchr(jwt, '.');
GPR_ASSERT(last_dot != NULL);
sig = grpc_base64_decode(last_dot + 1, 1);
- GPR_ASSERT(!GPR_SLICE_IS_EMPTY(sig));
- sig_bytes = GPR_SLICE_START_PTR(sig);
+ 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(GPR_SLICE_START_PTR(sig), GPR_SLICE_LENGTH(sig), 1, 0);
+ 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);
diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c
index 92059bf270..22dbf0428d 100644
--- a/test/core/security/oauth2_utils.c
+++ b/test/core/security/oauth2_utils.c
@@ -63,10 +63,10 @@ static void on_oauth2_response(grpc_exec_ctx *exec_ctx, void *user_data,
} else {
GPR_ASSERT(num_md == 1);
token_slice = md_elems[0].value;
- token = gpr_malloc(GPR_SLICE_LENGTH(token_slice) + 1);
- memcpy(token, GPR_SLICE_START_PTR(token_slice),
- GPR_SLICE_LENGTH(token_slice));
- token[GPR_SLICE_LENGTH(token_slice)] = '\0';
+ token = gpr_malloc(GRPC_SLICE_LENGTH(token_slice) + 1);
+ memcpy(token, GRPC_SLICE_START_PTR(token_slice),
+ GRPC_SLICE_LENGTH(token_slice));
+ token[GRPC_SLICE_LENGTH(token_slice)] = '\0';
}
gpr_mu_lock(request->mu);
request->is_done = 1;
diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c
index e12ca48c2f..b5d95004fe 100644
--- a/test/core/security/secure_endpoint_test.c
+++ b/test/core/security/secure_endpoint_test.c
@@ -77,8 +77,8 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
grpc_slice encrypted_leftover;
for (i = 0; i < leftover_nslices; i++) {
grpc_slice plain = leftover_slices[i];
- uint8_t *message_bytes = GPR_SLICE_START_PTR(plain);
- size_t message_size = GPR_SLICE_LENGTH(plain);
+ uint8_t *message_bytes = GRPC_SLICE_START_PTR(plain);
+ size_t message_size = GRPC_SLICE_LENGTH(plain);
while (message_size > 0) {
size_t protected_buffer_size_to_send = buffer_size;
size_t processed_message_size = message_size;
diff --git a/test/core/security/security_connector_test.c b/test/core/security/security_connector_test.c
index 898aeb6f42..8872cbe278 100644
--- a/test/core/security/security_connector_test.c
+++ b/test/core/security/security_connector_test.c
@@ -397,7 +397,7 @@ static void test_default_ssl_roots(void) {
an empty slice. */
grpc_set_ssl_roots_override_callback(override_roots_permanent_failure);
roots = grpc_get_default_ssl_roots_for_testing();
- GPR_ASSERT(GPR_SLICE_IS_EMPTY(roots));
+ GPR_ASSERT(GRPC_SLICE_IS_EMPTY(roots));
/* Cleanup. */
remove(roots_env_var_file_path);
diff --git a/test/core/slice/slice_test.c b/test/core/slice/slice_test.c
index 19c4657cde..e6d29e7459 100644
--- a/test/core/slice/slice_test.c
+++ b/test/core/slice/slice_test.c
@@ -55,10 +55,10 @@ static void test_slice_malloc_returns_something_sensible(void) {
/* If there is a length, slice.data must be non-NULL. If length is zero
we don't care. */
if (length) {
- GPR_ASSERT(GPR_SLICE_START_PTR(slice));
+ GPR_ASSERT(GRPC_SLICE_START_PTR(slice));
}
/* Returned slice length must be what was requested. */
- GPR_ASSERT(GPR_SLICE_LENGTH(slice) == length);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == length);
/* If the slice has a refcount, it must be destroyable. */
if (slice.refcount) {
GPR_ASSERT(slice.refcount->ref != NULL);
@@ -66,7 +66,7 @@ static void test_slice_malloc_returns_something_sensible(void) {
}
/* We must be able to write to every byte of the data */
for (i = 0; i < length; i++) {
- GPR_SLICE_START_PTR(slice)[i] = (uint8_t)i;
+ GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
}
/* And finally we must succeed in destroying the slice */
grpc_slice_unref(slice);
@@ -97,9 +97,9 @@ static void test_slice_new_with_user_data(void) {
buf[1] = 1;
slice = grpc_slice_new_with_user_data(buf, 2, set_mark, &marker);
GPR_ASSERT(marker == 0);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice) == 2);
- GPR_ASSERT(GPR_SLICE_START_PTR(slice)[0] == 0);
- GPR_ASSERT(GPR_SLICE_START_PTR(slice)[1] == 1);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 2);
+ GPR_ASSERT(GRPC_SLICE_START_PTR(slice)[0] == 0);
+ GPR_ASSERT(GRPC_SLICE_START_PTR(slice)[1] == 1);
/* unref should cause destroy function to run. */
grpc_slice_unref(slice);
@@ -152,7 +152,7 @@ static void test_slice_sub_works(unsigned length) {
beginning of the slice. */
slice = grpc_slice_malloc(length);
for (i = 0; i < length; i++) {
- GPR_SLICE_START_PTR(slice)[i] = (uint8_t)i;
+ GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
}
/* Ensure that for all subsets length is correct and that we start on the
@@ -160,9 +160,9 @@ static void test_slice_sub_works(unsigned length) {
for (i = 0; i < length; i++) {
for (j = i; j < length; j++) {
sub = grpc_slice_sub(slice, i, j);
- GPR_ASSERT(GPR_SLICE_LENGTH(sub) == j - i);
+ GPR_ASSERT(GRPC_SLICE_LENGTH(sub) == j - i);
for (k = 0; k < j - i; k++) {
- GPR_ASSERT(GPR_SLICE_START_PTR(sub)[k] == (uint8_t)(i + k));
+ GPR_ASSERT(GRPC_SLICE_START_PTR(sub)[k] == (uint8_t)(i + k));
}
grpc_slice_unref(sub);
}
@@ -171,12 +171,12 @@ static void test_slice_sub_works(unsigned length) {
}
static void check_head_tail(grpc_slice slice, grpc_slice head, grpc_slice tail) {
- GPR_ASSERT(GPR_SLICE_LENGTH(slice) ==
- GPR_SLICE_LENGTH(head) + GPR_SLICE_LENGTH(tail));
- GPR_ASSERT(0 == memcmp(GPR_SLICE_START_PTR(slice), GPR_SLICE_START_PTR(head),
- GPR_SLICE_LENGTH(head)));
- GPR_ASSERT(0 == memcmp(GPR_SLICE_START_PTR(slice) + GPR_SLICE_LENGTH(head),
- GPR_SLICE_START_PTR(tail), GPR_SLICE_LENGTH(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_LENGTH(head),
+ GRPC_SLICE_START_PTR(tail), GRPC_SLICE_LENGTH(tail)));
}
static void test_slice_split_head_works(size_t length) {
@@ -191,7 +191,7 @@ static void test_slice_split_head_works(size_t length) {
beginning of the slice. */
slice = grpc_slice_malloc(length);
for (i = 0; i < length; i++) {
- GPR_SLICE_START_PTR(slice)[i] = (uint8_t)i;
+ GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
}
/* Ensure that for all subsets length is correct and that we start on the
@@ -219,7 +219,7 @@ static void test_slice_split_tail_works(size_t length) {
beginning of the slice. */
slice = grpc_slice_malloc(length);
for (i = 0; i < length; i++) {
- GPR_SLICE_START_PTR(slice)[i] = (uint8_t)i;
+ GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
}
/* Ensure that for all subsets length is correct and that we start on the
@@ -242,9 +242,9 @@ static void test_slice_from_copied_string_works(void) {
LOG_TEST_NAME("test_slice_from_copied_string_works");
slice = grpc_slice_from_copied_string(text);
- GPR_ASSERT(strlen(text) == GPR_SLICE_LENGTH(slice));
+ GPR_ASSERT(strlen(text) == GRPC_SLICE_LENGTH(slice));
GPR_ASSERT(0 ==
- memcmp(text, GPR_SLICE_START_PTR(slice), GPR_SLICE_LENGTH(slice)));
+ memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice)));
grpc_slice_unref(slice);
}
diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c
index fe70f22c2b..d8d7a52d15 100644
--- a/test/core/surface/byte_buffer_reader_test.c
+++ b/test/core/surface/byte_buffer_reader_test.c
@@ -63,7 +63,7 @@ static void test_read_one_slice(void) {
"Couldn't init byte buffer reader");
first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
GPR_ASSERT(first_code != 0);
- GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
+ GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
grpc_slice_unref(first_slice);
second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
GPR_ASSERT(second_code == 0);
@@ -79,14 +79,14 @@ static void test_read_one_slice_malloc(void) {
LOG_TEST("test_read_one_slice_malloc");
slice = grpc_slice_malloc(4);
- memcpy(GPR_SLICE_START_PTR(slice), "test", 4);
+ memcpy(GRPC_SLICE_START_PTR(slice), "test", 4);
buffer = grpc_raw_byte_buffer_create(&slice, 1);
grpc_slice_unref(slice);
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
"Couldn't init byte buffer reader");
first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
GPR_ASSERT(first_code != 0);
- GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
+ GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
grpc_slice_unref(first_slice);
second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
GPR_ASSERT(second_code == 0);
@@ -108,7 +108,7 @@ static void test_read_none_compressed_slice(void) {
"Couldn't init byte buffer reader");
first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
GPR_ASSERT(first_code != 0);
- GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
+ GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
grpc_slice_unref(first_slice);
second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
GPR_ASSERT(second_code == 0);
@@ -143,7 +143,7 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm,
grpc_slice_buffer_init(&sliceb_out);
input_slice = grpc_slice_malloc(input_size);
- memset(GPR_SLICE_START_PTR(input_slice), 'a', input_size);
+ memset(GRPC_SLICE_START_PTR(input_slice), 'a', input_size);
grpc_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */
GPR_ASSERT(grpc_msg_compress(algorithm, &sliceb_in, &sliceb_out));
@@ -153,10 +153,10 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm,
"Couldn't init byte buffer reader");
while (grpc_byte_buffer_reader_next(&reader, &read_slice)) {
- GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(read_slice),
- GPR_SLICE_START_PTR(input_slice) + read_count,
- GPR_SLICE_LENGTH(read_slice)) == 0);
- read_count += GPR_SLICE_LENGTH(read_slice);
+ GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(read_slice),
+ GRPC_SLICE_START_PTR(input_slice) + read_count,
+ GRPC_SLICE_LENGTH(read_slice)) == 0);
+ read_count += GRPC_SLICE_LENGTH(read_slice);
grpc_slice_unref(read_slice);
}
GPR_ASSERT(read_count == input_size);
@@ -185,7 +185,7 @@ static void test_byte_buffer_from_reader(void) {
LOG_TEST("test_byte_buffer_from_reader");
slice = grpc_slice_malloc(4);
- memcpy(GPR_SLICE_START_PTR(slice), "test", 4);
+ memcpy(GRPC_SLICE_START_PTR(slice), "test", 4);
buffer = grpc_raw_byte_buffer_create(&slice, 1);
grpc_slice_unref(slice);
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
@@ -195,7 +195,7 @@ static void test_byte_buffer_from_reader(void) {
GPR_ASSERT(buffer->type == buffer_from_reader->type);
GPR_ASSERT(buffer_from_reader->data.raw.compression == GRPC_COMPRESS_NONE);
GPR_ASSERT(buffer_from_reader->data.raw.slice_buffer.count == 1);
- GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(
+ GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(
buffer_from_reader->data.raw.slice_buffer.slices[0]),
"test", 4) == 0);
@@ -217,9 +217,9 @@ static void test_readall(void) {
memset(lotsa_bs, 'b', 1024);
/* use slices large enough to overflow inlining */
slices[0] = grpc_slice_malloc(512);
- memcpy(GPR_SLICE_START_PTR(slices[0]), lotsa_as, 512);
+ memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512);
slices[1] = grpc_slice_malloc(1024);
- memcpy(GPR_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
+ memcpy(GRPC_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
buffer = grpc_raw_byte_buffer_create(slices, 2);
grpc_slice_unref(slices[0]);
@@ -229,9 +229,9 @@ static void test_readall(void) {
"Couldn't init byte buffer reader");
slice_out = grpc_byte_buffer_reader_readall(&reader);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice_out) == 512 + 1024);
- GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
- GPR_ASSERT(memcmp(&(GPR_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice_out) == 512 + 1024);
+ GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
+ GPR_ASSERT(memcmp(&(GRPC_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
0);
grpc_slice_unref(slice_out);
grpc_byte_buffer_destroy(buffer);
@@ -252,9 +252,9 @@ static void test_byte_buffer_copy(void) {
memset(lotsa_bs, 'b', 1024);
/* use slices large enough to overflow inlining */
slices[0] = grpc_slice_malloc(512);
- memcpy(GPR_SLICE_START_PTR(slices[0]), lotsa_as, 512);
+ memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512);
slices[1] = grpc_slice_malloc(1024);
- memcpy(GPR_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
+ memcpy(GRPC_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
buffer = grpc_raw_byte_buffer_create(slices, 2);
grpc_slice_unref(slices[0]);
@@ -265,9 +265,9 @@ static void test_byte_buffer_copy(void) {
"Couldn't init byte buffer reader");
slice_out = grpc_byte_buffer_reader_readall(&reader);
- GPR_ASSERT(GPR_SLICE_LENGTH(slice_out) == 512 + 1024);
- GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
- GPR_ASSERT(memcmp(&(GPR_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
+ GPR_ASSERT(GRPC_SLICE_LENGTH(slice_out) == 512 + 1024);
+ GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
+ GPR_ASSERT(memcmp(&(GRPC_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
0);
grpc_slice_unref(slice_out);
grpc_byte_buffer_destroy(buffer);
diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.c
index a051dc8cf3..c7e8f3a050 100644
--- a/test/core/transport/chttp2/hpack_parser_test.c
+++ b/test/core/transport/chttp2/hpack_parser_test.c
@@ -77,8 +77,8 @@ static void test_vector(grpc_chttp2_hpack_parser *parser,
for (i = 0; i < nslices; i++) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
GPR_ASSERT(grpc_chttp2_hpack_parser_parse(
- &exec_ctx, parser, GPR_SLICE_START_PTR(slices[i]),
- GPR_SLICE_END_PTR(slices[i])) == GRPC_ERROR_NONE);
+ &exec_ctx, parser, GRPC_SLICE_START_PTR(slices[i]),
+ GRPC_SLICE_END_PTR(slices[i])) == GRPC_ERROR_NONE);
grpc_exec_ctx_finish(&exec_ctx);
}
diff --git a/test/core/transport/chttp2/varint_test.c b/test/core/transport/chttp2/varint_test.c
index 0d9460afc1..5b831c71b2 100644
--- a/test/core/transport/chttp2/varint_test.c
+++ b/test/core/transport/chttp2/varint_test.c
@@ -47,7 +47,7 @@ static void test_varint(uint32_t value, uint32_t prefix_bits, uint8_t prefix_or,
GPR_ASSERT(nbytes == expect_length);
slice = grpc_slice_malloc(nbytes);
GRPC_CHTTP2_WRITE_VARINT(value, prefix_bits, prefix_or,
- GPR_SLICE_START_PTR(slice), nbytes);
+ GRPC_SLICE_START_PTR(slice), nbytes);
GPR_ASSERT(grpc_slice_cmp(expect, slice) == 0);
grpc_slice_unref(expect);
grpc_slice_unref(slice);
diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c
index e47777ee72..5c89d8530a 100644
--- a/test/core/transport/metadata_test.c
+++ b/test/core/transport/metadata_test.c
@@ -279,7 +279,7 @@ static void verify_binary_header_size(const char *key, const uint8_t *value,
grpc_slice value_slice =
grpc_slice_from_copied_buffer((const char *)value, value_len);
grpc_slice base64_encoded = grpc_chttp2_base64_encode(value_slice);
- size_t expected_size = 32 + strlen(key) + GPR_SLICE_LENGTH(base64_encoded);
+ size_t expected_size = 32 + strlen(key) + GRPC_SLICE_LENGTH(base64_encoded);
GPR_ASSERT(expected_size == elem_size);
grpc_slice_unref(value_slice);
grpc_slice_unref(base64_encoded);
diff --git a/test/core/util/one_corpus_entry_fuzzer.c b/test/core/util/one_corpus_entry_fuzzer.c
index a07e83b775..6b572bb3c3 100644
--- a/test/core/util/one_corpus_entry_fuzzer.c
+++ b/test/core/util/one_corpus_entry_fuzzer.c
@@ -47,7 +47,7 @@ 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(GPR_SLICE_START_PTR(buffer), GPR_SLICE_LENGTH(buffer));
+ LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer), GRPC_SLICE_LENGTH(buffer));
grpc_slice_unref(buffer);
return 0;
}
diff --git a/test/core/util/parse_hexstring.c b/test/core/util/parse_hexstring.c
index 91149a691a..60ab1bb0c4 100644
--- a/test/core/util/parse_hexstring.c
+++ b/test/core/util/parse_hexstring.c
@@ -48,7 +48,7 @@ grpc_slice parse_hexstring(const char *hexstring) {
GPR_ASSERT((nibbles & 1) == 0);
slice = grpc_slice_malloc(nibbles / 2);
- out = GPR_SLICE_START_PTR(slice);
+ out = GRPC_SLICE_START_PTR(slice);
nibbles = 0;
temp = 0;
diff --git a/test/core/util/slice_splitter.c b/test/core/util/slice_splitter.c
index 6647b8fbb3..177c9892a5 100644
--- a/test/core/util/slice_splitter.c
+++ b/test/core/util/slice_splitter.c
@@ -69,28 +69,28 @@ void grpc_split_slices(grpc_slice_split_mode mode, grpc_slice *src_slices,
*dst_slice_count = 1;
length = 0;
for (i = 0; i < src_slice_count; i++) {
- length += GPR_SLICE_LENGTH(src_slices[i]);
+ length += GRPC_SLICE_LENGTH(src_slices[i]);
}
*dst_slices = gpr_malloc(sizeof(grpc_slice));
**dst_slices = grpc_slice_malloc(length);
length = 0;
for (i = 0; i < src_slice_count; i++) {
- memcpy(GPR_SLICE_START_PTR(**dst_slices) + length,
- GPR_SLICE_START_PTR(src_slices[i]),
- GPR_SLICE_LENGTH(src_slices[i]));
- length += GPR_SLICE_LENGTH(src_slices[i]);
+ memcpy(GRPC_SLICE_START_PTR(**dst_slices) + length,
+ GRPC_SLICE_START_PTR(src_slices[i]),
+ GRPC_SLICE_LENGTH(src_slices[i]));
+ length += GRPC_SLICE_LENGTH(src_slices[i]);
}
break;
case GRPC_SLICE_SPLIT_ONE_BYTE:
length = 0;
for (i = 0; i < src_slice_count; i++) {
- length += GPR_SLICE_LENGTH(src_slices[i]);
+ length += GRPC_SLICE_LENGTH(src_slices[i]);
}
*dst_slice_count = length;
*dst_slices = gpr_malloc(sizeof(grpc_slice) * length);
length = 0;
for (i = 0; i < src_slice_count; i++) {
- for (j = 0; j < GPR_SLICE_LENGTH(src_slices[i]); j++) {
+ for (j = 0; j < GRPC_SLICE_LENGTH(src_slices[i]); j++) {
(*dst_slices)[length] = grpc_slice_sub(src_slices[i], j, j + 1);
length++;
}
@@ -125,13 +125,13 @@ grpc_slice grpc_slice_merge(grpc_slice *slices, size_t nslices) {
size_t i;
for (i = 0; i < nslices; i++) {
- if (GPR_SLICE_LENGTH(slices[i]) + length > capacity) {
- capacity = GPR_MAX(capacity * 2, GPR_SLICE_LENGTH(slices[i]) + length);
+ if (GRPC_SLICE_LENGTH(slices[i]) + length > capacity) {
+ capacity = GPR_MAX(capacity * 2, GRPC_SLICE_LENGTH(slices[i]) + length);
out = gpr_realloc(out, capacity);
}
- memcpy(out + length, GPR_SLICE_START_PTR(slices[i]),
- GPR_SLICE_LENGTH(slices[i]));
- length += GPR_SLICE_LENGTH(slices[i]);
+ memcpy(out + length, GRPC_SLICE_START_PTR(slices[i]),
+ GRPC_SLICE_LENGTH(slices[i]));
+ length += GRPC_SLICE_LENGTH(slices[i]);
}
return grpc_slice_new(out, length, gpr_free);