aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/transport
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-10 11:47:15 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-10 11:47:15 -0700
commit32ca48ce0b963949ff29d2dcd526b174679779aa (patch)
treee1203e29dbc0827fe4e9eed5737b3f1589d44f34 /test/core/transport
parentbe947697d7c5edb1f67c9df5ef024e3eaf98e9e6 (diff)
Core compiles with -Wsign-conversion
Diffstat (limited to 'test/core/transport')
-rw-r--r--test/core/transport/chttp2/hpack_table_test.c4
-rw-r--r--test/core/transport/chttp2/stream_encoder_test.c10
-rw-r--r--test/core/transport/chttp2/stream_map_test.c6
-rw-r--r--test/core/transport/metadata_test.c12
4 files changed, 16 insertions, 16 deletions
diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c
index 15b37d17b6..ec0a569371 100644
--- a/test/core/transport/chttp2/hpack_table_test.c
+++ b/test/core/transport/chttp2/hpack_table_test.c
@@ -49,8 +49,8 @@ static void assert_str(const grpc_chttp2_hptbl *tbl, grpc_mdstr *mdstr,
GPR_ASSERT(gpr_slice_str_cmp(mdstr->slice, str) == 0);
}
-static void assert_index(const grpc_chttp2_hptbl *tbl, int idx, const char *key,
- const char *value) {
+static void assert_index(const grpc_chttp2_hptbl *tbl, size_t idx,
+ const char *key, const char *value) {
grpc_mdelem *md = grpc_chttp2_hptbl_lookup(tbl, idx);
assert_str(tbl, md->key, key);
assert_str(tbl, md->value, value);
diff --git a/test/core/transport/chttp2/stream_encoder_test.c b/test/core/transport/chttp2/stream_encoder_test.c
index e6731ff195..4bb503b4e9 100644
--- a/test/core/transport/chttp2/stream_encoder_test.c
+++ b/test/core/transport/chttp2/stream_encoder_test.c
@@ -52,8 +52,8 @@ int g_failure = 0;
grpc_stream_op_buffer g_sopb;
void **to_delete = NULL;
-int num_to_delete = 0;
-int cap_to_delete = 0;
+size_t num_to_delete = 0;
+size_t cap_to_delete = 0;
static gpr_slice create_test_slice(size_t length) {
gpr_slice slice = gpr_slice_malloc(length);
@@ -126,8 +126,8 @@ static void test_small_data_framing(void) {
verify_sopb(10, 0, 5, "000005 0000 deadbeef 00000000ff");
}
-static void add_sopb_headers(int n, ...) {
- int i;
+static void add_sopb_headers(size_t n, ...) {
+ size_t i;
grpc_metadata_batch b;
va_list l;
grpc_linked_mdelem *e = gpr_malloc(sizeof(*e) * n);
@@ -336,7 +336,7 @@ static void run_test(void (*test)(), const char *name) {
}
int main(int argc, char **argv) {
- int i;
+ size_t i;
grpc_test_init(argc, argv);
TEST(test_small_data_framing);
TEST(test_basic_headers);
diff --git a/test/core/transport/chttp2/stream_map_test.c b/test/core/transport/chttp2/stream_map_test.c
index b0bb3a8904..72aaafd18d 100644
--- a/test/core/transport/chttp2/stream_map_test.c
+++ b/test/core/transport/chttp2/stream_map_test.c
@@ -203,9 +203,9 @@ static void test_periodic_compaction(size_t n) {
}
int main(int argc, char **argv) {
- int n = 1;
- int prev = 1;
- int tmp;
+ size_t n = 1;
+ size_t prev = 1;
+ size_t tmp;
grpc_test_init(argc, argv);
diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c
index 4a4d4bcb8a..1861442bb1 100644
--- a/test/core/transport/metadata_test.c
+++ b/test/core/transport/metadata_test.c
@@ -177,11 +177,11 @@ static void test_spin_creating_the_same_thing(void) {
static void test_things_stick_around(void) {
grpc_mdctx *ctx;
- int i, j;
+ size_t i, j;
char *buffer;
- int nstrs = 1000;
+ size_t nstrs = 1000;
grpc_mdstr **strs = gpr_malloc(sizeof(grpc_mdstr *) * nstrs);
- int *shuf = gpr_malloc(sizeof(int) * nstrs);
+ size_t *shuf = gpr_malloc(sizeof(size_t) * nstrs);
grpc_mdstr *test;
LOG_TEST("test_things_stick_around");
@@ -201,9 +201,9 @@ static void test_things_stick_around(void) {
}
for (i = 0; i < nstrs; i++) {
- int p = rand() % nstrs;
- int q = rand() % nstrs;
- int temp = shuf[p];
+ size_t p = (size_t)rand() % nstrs;
+ size_t q = (size_t)rand() % nstrs;
+ size_t temp = shuf[p];
shuf[p] = shuf[q];
shuf[q] = temp;
}