aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/compression
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/compression')
-rw-r--r--test/core/compression/algorithm_test.c4
-rw-r--r--test/core/compression/compression_test.c14
-rw-r--r--test/core/compression/message_compress_test.c21
-rw-r--r--test/core/compression/stream_compression_test.c36
4 files changed, 38 insertions, 37 deletions
diff --git a/test/core/compression/algorithm_test.c b/test/core/compression/algorithm_test.c
index a11e6e90ac..e711101b3f 100644
--- a/test/core/compression/algorithm_test.c
+++ b/test/core/compression/algorithm_test.c
@@ -35,7 +35,7 @@ static void test_algorithm_mesh(void) {
gpr_log(GPR_DEBUG, "test_algorithm_mesh");
for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
- const char *name;
+ const char* name;
grpc_compression_algorithm parsed;
grpc_slice mdstr;
grpc_mdelem mdelem;
@@ -84,7 +84,7 @@ static void test_algorithm_failure(void) {
grpc_exec_ctx_finish(&exec_ctx);
}
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc_init();
diff --git a/test/core/compression/compression_test.c b/test/core/compression/compression_test.c
index 326a800300..b6ab0bb844 100644
--- a/test/core/compression/compression_test.c
+++ b/test/core/compression/compression_test.c
@@ -28,15 +28,15 @@
static void test_compression_algorithm_parse(void) {
size_t i;
- const char *valid_names[] = {"identity", "gzip", "deflate"};
+ const char* valid_names[] = {"identity", "gzip", "deflate"};
const grpc_compression_algorithm valid_algorithms[] = {
GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE};
- const char *invalid_names[] = {"gzip2", "foo", "", "2gzip"};
+ const char* invalid_names[] = {"gzip2", "foo", "", "2gzip"};
gpr_log(GPR_DEBUG, "test_compression_algorithm_parse");
for (i = 0; i < GPR_ARRAY_SIZE(valid_names); i++) {
- const char *valid_name = valid_names[i];
+ const char* valid_name = valid_names[i];
grpc_compression_algorithm algorithm;
const int success = grpc_compression_algorithm_parse(
grpc_slice_from_static_string(valid_name), &algorithm);
@@ -45,7 +45,7 @@ static void test_compression_algorithm_parse(void) {
}
for (i = 0; i < GPR_ARRAY_SIZE(invalid_names); i++) {
- const char *invalid_name = invalid_names[i];
+ const char* invalid_name = invalid_names[i];
grpc_compression_algorithm algorithm;
int success;
success = grpc_compression_algorithm_parse(
@@ -57,9 +57,9 @@ static void test_compression_algorithm_parse(void) {
static void test_compression_algorithm_name(void) {
int success;
- const char *name;
+ const char* name;
size_t i;
- const char *valid_names[] = {"identity", "gzip", "deflate"};
+ const char* valid_names[] = {"identity", "gzip", "deflate"};
const grpc_compression_algorithm valid_algorithms[] = {
GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE};
@@ -202,7 +202,7 @@ static void test_compression_enable_disable_algorithm(void) {
}
}
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
grpc_init();
test_compression_algorithm_parse();
test_compression_algorithm_name();
diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c
index f7f4893dee..5afa8af6f8 100644
--- a/test/core/compression/message_compress_test.c
+++ b/test/core/compression/message_compress_test.c
@@ -49,17 +49,18 @@ static void assert_passthrough(grpc_slice value,
grpc_slice_buffer output;
grpc_slice final;
int was_compressed;
- const char *algorithm_name;
+ const char* algorithm_name;
GPR_ASSERT(grpc_compression_algorithm_name(algorithm, &algorithm_name) != 0);
- gpr_log(
- 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),
- algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode),
- grpc_slice_split_mode_name(compressed_split_mode));
+ gpr_log(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),
+ algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode),
+ grpc_slice_split_mode_name(compressed_split_mode));
grpc_slice_buffer_init(&input);
grpc_slice_buffer_init(&compressed_raw);
@@ -285,7 +286,7 @@ static void test_bad_decompression_algorithm(void) {
grpc_slice_buffer_destroy(&output);
}
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
unsigned i, j, k, m;
grpc_slice_split_mode uncompressed_split_modes[] = {
GRPC_SLICE_SPLIT_IDENTITY, GRPC_SLICE_SPLIT_ONE_BYTE};
diff --git a/test/core/compression/stream_compression_test.c b/test/core/compression/stream_compression_test.c
index afed6cd6b5..568f9f5f6a 100644
--- a/test/core/compression/stream_compression_test.c
+++ b/test/core/compression/stream_compression_test.c
@@ -25,7 +25,7 @@
#include "src/core/lib/compression/stream_compression.h"
-static void generate_random_payload(char *payload, size_t size) {
+static void generate_random_payload(char* payload, size_t size) {
size_t i;
static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
for (i = 0; i < size - 1; ++i) {
@@ -34,8 +34,8 @@ static void generate_random_payload(char *payload, size_t size) {
payload[size - 1] = '\0';
}
-static bool slice_buffer_equals_string(grpc_slice_buffer *buf,
- const char *str) {
+static bool slice_buffer_equals_string(grpc_slice_buffer* buf,
+ const char* str) {
size_t i;
if (buf->length != strlen(str)) {
return false;
@@ -43,8 +43,8 @@ static bool slice_buffer_equals_string(grpc_slice_buffer *buf,
size_t pointer = 0;
for (i = 0; i < buf->count; i++) {
size_t slice_len = GRPC_SLICE_LENGTH(buf->slices[i]);
- if (0 != strncmp(str + pointer,
- (char *)GRPC_SLICE_START_PTR(buf->slices[i]), slice_len)) {
+ if (0 != strncmp(str + pointer, (char*)GRPC_SLICE_START_PTR(buf->slices[i]),
+ slice_len)) {
return false;
}
pointer += slice_len;
@@ -58,10 +58,10 @@ static void test_stream_compression_simple_compress_decompress() {
grpc_slice_buffer_init(&source);
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
- grpc_stream_compression_context *compress_ctx =
+ grpc_stream_compression_context* compress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
- grpc_stream_compression_context *decompress_ctx =
+ grpc_stream_compression_context* decompress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
@@ -91,10 +91,10 @@ test_stream_compression_simple_compress_decompress_with_output_size_constraint()
grpc_slice_buffer_init(&source);
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
- grpc_stream_compression_context *compress_ctx =
+ grpc_stream_compression_context* compress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
- grpc_stream_compression_context *decompress_ctx =
+ grpc_stream_compression_context* decompress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
@@ -112,7 +112,7 @@ test_stream_compression_simple_compress_decompress_with_output_size_constraint()
GPR_ASSERT(output_size == max_output_size);
GPR_ASSERT(end_of_context == false);
grpc_slice slice_recv = grpc_slice_buffer_take_first(&sink);
- char *str_recv = (char *)GRPC_SLICE_START_PTR(slice_recv);
+ char* str_recv = (char*)GRPC_SLICE_START_PTR(slice_recv);
GPR_ASSERT(GRPC_SLICE_LENGTH(slice_recv) == max_output_size);
GPR_ASSERT(0 == strncmp(test_str, str_recv, max_output_size));
grpc_slice_unref(slice_recv);
@@ -134,16 +134,16 @@ test_stream_compression_simple_compress_decompress_with_output_size_constraint()
#define LARGE_DATA_SIZE (1024 * 1024)
static void
test_stream_compression_simple_compress_decompress_with_large_data() {
- char *test_str = gpr_malloc(LARGE_DATA_SIZE * sizeof(char));
+ char* test_str = gpr_malloc(LARGE_DATA_SIZE * sizeof(char));
generate_random_payload(test_str, LARGE_DATA_SIZE);
grpc_slice_buffer source, relay, sink;
grpc_slice_buffer_init(&source);
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
- grpc_stream_compression_context *compress_ctx =
+ grpc_stream_compression_context* compress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
- grpc_stream_compression_context *decompress_ctx =
+ grpc_stream_compression_context* decompress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
@@ -174,7 +174,7 @@ static void test_stream_compression_drop_context() {
grpc_slice_buffer_init(&source);
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
- grpc_stream_compression_context *compress_ctx =
+ grpc_stream_compression_context* compress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
@@ -207,7 +207,7 @@ static void test_stream_compression_drop_context() {
grpc_slice_unref(slice2);
grpc_slice_buffer_add(&relay, slice3);
- grpc_stream_compression_context *decompress_ctx =
+ grpc_stream_compression_context* decompress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
bool end_of_context;
@@ -243,7 +243,7 @@ static void test_stream_compression_sync_flush() {
grpc_slice_buffer_init(&source);
grpc_slice_buffer_init(&relay);
grpc_slice_buffer_init(&sink);
- grpc_stream_compression_context *compress_ctx =
+ grpc_stream_compression_context* compress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
grpc_slice slice = grpc_slice_from_static_string(test_str);
@@ -252,7 +252,7 @@ static void test_stream_compression_sync_flush() {
~(size_t)0,
GRPC_STREAM_COMPRESSION_FLUSH_SYNC));
- grpc_stream_compression_context *decompress_ctx =
+ grpc_stream_compression_context* decompress_ctx =
grpc_stream_compression_context_create(
GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
bool end_of_context;
@@ -284,7 +284,7 @@ static void test_stream_compression_sync_flush() {
grpc_slice_buffer_destroy(&sink);
}
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
grpc_init();
test_stream_compression_simple_compress_decompress();
test_stream_compression_simple_compress_decompress_with_output_size_constraint();