aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/compression
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-02-08 11:08:41 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-02-08 11:08:41 -0800
commit239b7d4b0be55975e5fc0b62e28f3d3e2a54fa9b (patch)
tree30c6d791eed6e7eaa8dfefe29b8b60651e56b059 /test/core/compression
parent8f4fbb1c550c99e25f42ceafec3af92b34279db5 (diff)
parent100e0a78ebc1ecfaefb57c5105506b3091d4b86c (diff)
Merge branch 'master' into gpr_review
Diffstat (limited to 'test/core/compression')
-rw-r--r--test/core/compression/algorithm_test.cc2
-rw-r--r--test/core/compression/compression_test.cc50
2 files changed, 25 insertions, 27 deletions
diff --git a/test/core/compression/algorithm_test.cc b/test/core/compression/algorithm_test.cc
index 632077dd17..3dcddf3e67 100644
--- a/test/core/compression/algorithm_test.cc
+++ b/test/core/compression/algorithm_test.cc
@@ -28,7 +28,7 @@
#include "src/core/lib/transport/static_metadata.h"
#include "test/core/util/test_config.h"
-const uint32_t message_prefix_length = 8;
+const uint32_t message_prefix_length = 0;
const uint32_t stream_prefix_length = 7;
static void test_algorithm_mesh(void) {
int i;
diff --git a/test/core/compression/compression_test.cc b/test/core/compression/compression_test.cc
index c60aa6f38e..6522988c66 100644
--- a/test/core/compression/compression_test.cc
+++ b/test/core/compression/compression_test.cc
@@ -28,11 +28,10 @@
static void test_compression_algorithm_parse(void) {
size_t i;
- const char* valid_names[] = {"identity", "message/gzip", "message/deflate",
- "stream/gzip"};
+ const char* valid_names[] = {"identity", "gzip", "deflate", "stream/gzip"};
const grpc_compression_algorithm valid_algorithms[] = {
- GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP,
- GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP};
+ GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE,
+ GRPC_COMPRESS_STREAM_GZIP};
const char* invalid_names[] = {"gzip2", "foo", "", "2gzip"};
gpr_log(GPR_DEBUG, "test_compression_algorithm_parse");
@@ -61,11 +60,10 @@ static void test_compression_algorithm_name(void) {
int success;
const char* name;
size_t i;
- const char* valid_names[] = {"identity", "message/gzip", "message/deflate",
- "stream/gzip"};
+ const char* valid_names[] = {"identity", "gzip", "deflate", "stream/gzip"};
const grpc_compression_algorithm valid_algorithms[] = {
- GRPC_COMPRESS_NONE, GRPC_COMPRESS_MESSAGE_GZIP,
- GRPC_COMPRESS_MESSAGE_DEFLATE, GRPC_COMPRESS_STREAM_GZIP};
+ GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE,
+ GRPC_COMPRESS_STREAM_GZIP};
gpr_log(GPR_DEBUG, "test_compression_algorithm_name");
@@ -110,21 +108,21 @@ static void test_compression_algorithm_for_level(void) {
/* accept only gzip */
uint32_t accepted_encodings = 0;
GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
- GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP);
+ GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP);
GPR_ASSERT(GRPC_COMPRESS_NONE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP ==
+ GPR_ASSERT(GRPC_COMPRESS_GZIP ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP ==
+ GPR_ASSERT(GRPC_COMPRESS_GZIP ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP ==
+ GPR_ASSERT(GRPC_COMPRESS_GZIP ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
accepted_encodings));
}
@@ -133,21 +131,21 @@ static void test_compression_algorithm_for_level(void) {
/* accept only deflate */
uint32_t accepted_encodings = 0;
GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
- GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE);
+ GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE);
GPR_ASSERT(GRPC_COMPRESS_NONE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE ==
+ GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE ==
+ GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE ==
+ GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
accepted_encodings));
}
@@ -156,22 +154,22 @@ static void test_compression_algorithm_for_level(void) {
/* accept gzip and deflate */
uint32_t accepted_encodings = 0;
GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
- GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP);
- GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE);
+ GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP);
+ GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE);
GPR_ASSERT(GRPC_COMPRESS_NONE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP ==
+ GPR_ASSERT(GRPC_COMPRESS_GZIP ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE ==
+ GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE ==
+ GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
accepted_encodings));
}
@@ -203,23 +201,23 @@ static void test_compression_algorithm_for_level(void) {
/* accept all algorithms */
uint32_t accepted_encodings = 0;
GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
- GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_GZIP);
- GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_MESSAGE_DEFLATE);
+ GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP);
+ GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE);
GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_STREAM_GZIP);
GPR_ASSERT(GRPC_COMPRESS_NONE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_GZIP ==
+ GPR_ASSERT(GRPC_COMPRESS_GZIP ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE ==
+ GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
accepted_encodings));
- GPR_ASSERT(GRPC_COMPRESS_MESSAGE_DEFLATE ==
+ GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
accepted_encodings));
}