aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/build/empty.c34
-rw-r--r--test/core/compression/message_compress_test.c2
-rw-r--r--test/core/fling/server.c2
-rw-r--r--test/core/iomgr/fd_posix_test.c2
-rw-r--r--test/core/iomgr/udp_server_test.c2
-rw-r--r--test/core/support/murmur_hash_test.c4
-rw-r--r--test/core/support/stack_lockfree_test.c7
-rw-r--r--test/core/transport/chttp2/hpack_table_test.c2
-rw-r--r--test/core/transport/chttp2/stream_encoder_test.c4
-rw-r--r--test/core/transport/chttp2/stream_map_test.c40
10 files changed, 68 insertions, 31 deletions
diff --git a/test/build/empty.c b/test/build/empty.c
new file mode 100644
index 0000000000..58e4698aee
--- /dev/null
+++ b/test/build/empty.c
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+int main(void) {}
diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c
index 495841c79f..98da6a1eaa 100644
--- a/test/core/compression/message_compress_test.c
+++ b/test/core/compression/message_compress_test.c
@@ -149,7 +149,7 @@ static gpr_slice create_test_value(test_value id) {
static void test_bad_data(void) {
gpr_slice_buffer input;
gpr_slice_buffer output;
- int i;
+ grpc_compression_algorithm i;
gpr_slice_buffer_init(&input);
gpr_slice_buffer_init(&output);
diff --git a/test/core/fling/server.c b/test/core/fling/server.c
index 64f9573084..5aace03520 100644
--- a/test/core/fling/server.c
+++ b/test/core/fling/server.c
@@ -197,7 +197,7 @@ int main(int argc, char **argv) {
grpc_test_init(1, fake_argv);
grpc_init();
- srand(clock());
+ srand((unsigned)clock());
cl = gpr_cmdline_create("fling server");
gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr);
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c
index 8bba87d61f..af66ef0997 100644
--- a/test/core/iomgr/fd_posix_test.c
+++ b/test/core/iomgr/fd_posix_test.c
@@ -419,7 +419,7 @@ static void test_grpc_fd_change(void) {
int flags;
int sv[2];
char data;
- int result;
+ ssize_t result;
grpc_iomgr_closure first_closure;
grpc_iomgr_closure second_closure;
diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c
index c91752b937..8c964246c7 100644
--- a/test/core/iomgr/udp_server_test.c
+++ b/test/core/iomgr/udp_server_test.c
@@ -53,7 +53,7 @@ static void on_connect(void *arg, grpc_endpoint *udp) {}
static void on_read(int fd, grpc_udp_server_cb new_transport_cb, void *cb_arg) {
char read_buffer[512];
- int byte_count;
+ ssize_t byte_count;
gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
byte_count = recv(fd, read_buffer, sizeof(read_buffer), 0);
diff --git a/test/core/support/murmur_hash_test.c b/test/core/support/murmur_hash_test.c
index 1e5279f462..1762486776 100644
--- a/test/core/support/murmur_hash_test.c
+++ b/test/core/support/murmur_hash_test.c
@@ -57,8 +57,8 @@ static void verification_test(hash_func hash, gpr_uint32 expected) {
the seed */
for (i = 0; i < 256; i++) {
- key[i] = (uint8_t)i;
- hashes[i] = hash(key, i, 256u - i);
+ key[i] = (gpr_uint8)i;
+ hashes[i] = hash(key, i, (gpr_uint32)(256u - i));
}
/* Then hash the result array */
diff --git a/test/core/support/stack_lockfree_test.c b/test/core/support/stack_lockfree_test.c
index 4a2a0532d8..0f49e6fa52 100644
--- a/test/core/support/stack_lockfree_test.c
+++ b/test/core/support/stack_lockfree_test.c
@@ -62,7 +62,7 @@ static void test_serial_sized(size_t size) {
/* Now add repeatedly more items and check them */
for (i = 1; i < size; i *= 2) {
for (j = 0; j <= i; j++) {
- GPR_ASSERT(gpr_stack_lockfree_push(stack, j) == (j == 0));
+ GPR_ASSERT(gpr_stack_lockfree_push(stack, (int)j) == (j == 0));
}
for (j = 0; j <= i; j++) {
GPR_ASSERT(gpr_stack_lockfree_pop(stack) == (int)(i - j));
@@ -118,7 +118,7 @@ static void test_mt_sized(size_t size, int nth) {
stack = gpr_stack_lockfree_create(size);
for (i = 0; i < nth; i++) {
args[i].stack = stack;
- args[i].stack_size = size;
+ args[i].stack_size = (int)size;
args[i].nthreads = nth;
args[i].rank = i;
args[i].sum = 0;
@@ -137,7 +137,8 @@ static void test_mt_sized(size_t size, int nth) {
}
static void test_mt() {
- size_t size, nth;
+ size_t size;
+ int nth;
for (nth = 1; nth < MAX_THREADS; nth++) {
for (size = 128; size < MAX_STACK_SIZE; size *= 2) {
test_mt_sized(size, nth);
diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c
index ec0a569371..aa3e273a6c 100644
--- a/test/core/transport/chttp2/hpack_table_test.c
+++ b/test/core/transport/chttp2/hpack_table_test.c
@@ -49,7 +49,7 @@ 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, size_t idx,
+static void assert_index(const grpc_chttp2_hptbl *tbl, gpr_uint32 idx,
const char *key, const char *value) {
grpc_mdelem *md = grpc_chttp2_hptbl_lookup(tbl, idx);
assert_str(tbl, md->key, key);
diff --git a/test/core/transport/chttp2/stream_encoder_test.c b/test/core/transport/chttp2/stream_encoder_test.c
index 4bb503b4e9..a723b90084 100644
--- a/test/core/transport/chttp2/stream_encoder_test.c
+++ b/test/core/transport/chttp2/stream_encoder_test.c
@@ -75,8 +75,8 @@ static void verify_sopb(size_t window_available, int eof,
gpr_slice_buffer_init(&output);
grpc_sopb_init(&encops);
GPR_ASSERT(expect_window_used ==
- grpc_chttp2_preencode(g_sopb.ops, &g_sopb.nops, window_available,
- &encops));
+ grpc_chttp2_preencode(g_sopb.ops, &g_sopb.nops,
+ (gpr_uint32)window_available, &encops));
grpc_chttp2_encode(encops.ops, encops.nops, eof, 0xdeadbeef, &g_compressor,
&output);
encops.nops = 0;
diff --git a/test/core/transport/chttp2/stream_map_test.c b/test/core/transport/chttp2/stream_map_test.c
index 72aaafd18d..81fb80f84f 100644
--- a/test/core/transport/chttp2/stream_map_test.c
+++ b/test/core/transport/chttp2/stream_map_test.c
@@ -82,9 +82,9 @@ static void test_double_deletion(void) {
}
/* test add & lookup */
-static void test_basic_add_find(size_t n) {
+static void test_basic_add_find(gpr_uint32 n) {
grpc_chttp2_stream_map map;
- size_t i;
+ gpr_uint32 i;
size_t got;
LOG_TEST("test_basic_add_find");
@@ -107,15 +107,15 @@ static void test_basic_add_find(size_t n) {
/* verify that for_each gets the right values during test_delete_evens_XXX */
static void verify_for_each(void *user_data, gpr_uint32 stream_id, void *ptr) {
- size_t *for_each_check = user_data;
+ gpr_uint32 *for_each_check = user_data;
GPR_ASSERT(ptr);
GPR_ASSERT(*for_each_check == stream_id);
*for_each_check += 2;
}
-static void check_delete_evens(grpc_chttp2_stream_map *map, size_t n) {
- size_t for_each_check = 1;
- size_t i;
+static void check_delete_evens(grpc_chttp2_stream_map *map, gpr_uint32 n) {
+ gpr_uint32 for_each_check = 1;
+ gpr_uint32 i;
size_t got;
GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, 0));
@@ -139,9 +139,9 @@ static void check_delete_evens(grpc_chttp2_stream_map *map, size_t n) {
/* add a bunch of keys, delete the even ones, and make sure the map is
consistent */
-static void test_delete_evens_sweep(size_t n) {
+static void test_delete_evens_sweep(gpr_uint32 n) {
grpc_chttp2_stream_map map;
- size_t i;
+ gpr_uint32 i;
LOG_TEST("test_delete_evens_sweep");
gpr_log(GPR_INFO, "n = %d", n);
@@ -152,7 +152,8 @@ static void test_delete_evens_sweep(size_t n) {
}
for (i = 1; i <= n; i++) {
if ((i & 1) == 0) {
- GPR_ASSERT((void *)i == grpc_chttp2_stream_map_delete(&map, i));
+ GPR_ASSERT((void *)(gpr_uintptr)i ==
+ grpc_chttp2_stream_map_delete(&map, i));
}
}
check_delete_evens(&map, n);
@@ -161,9 +162,9 @@ static void test_delete_evens_sweep(size_t n) {
/* add a bunch of keys, delete the even ones immediately, and make sure the map
is consistent */
-static void test_delete_evens_incremental(size_t n) {
+static void test_delete_evens_incremental(gpr_uint32 n) {
grpc_chttp2_stream_map map;
- size_t i;
+ gpr_uint32 i;
LOG_TEST("test_delete_evens_incremental");
gpr_log(GPR_INFO, "n = %d", n);
@@ -181,10 +182,10 @@ static void test_delete_evens_incremental(size_t n) {
/* add a bunch of keys, delete old ones after some time, ensure the
backing array does not grow */
-static void test_periodic_compaction(size_t n) {
+static void test_periodic_compaction(gpr_uint32 n) {
grpc_chttp2_stream_map map;
- size_t i;
- size_t del;
+ gpr_uint32 i;
+ gpr_uint32 del;
LOG_TEST("test_periodic_compaction");
gpr_log(GPR_INFO, "n = %d", n);
@@ -192,10 +193,11 @@ static void test_periodic_compaction(size_t n) {
grpc_chttp2_stream_map_init(&map, 16);
GPR_ASSERT(map.capacity == 16);
for (i = 1; i <= n; i++) {
- grpc_chttp2_stream_map_add(&map, i, (void *)i);
+ grpc_chttp2_stream_map_add(&map, i, (void *)(gpr_uintptr)i);
if (i > 8) {
del = i - 8;
- GPR_ASSERT((void *)del == grpc_chttp2_stream_map_delete(&map, del));
+ GPR_ASSERT((void *)(gpr_uintptr)del ==
+ grpc_chttp2_stream_map_delete(&map, del));
}
}
GPR_ASSERT(map.capacity == 16);
@@ -203,9 +205,9 @@ static void test_periodic_compaction(size_t n) {
}
int main(int argc, char **argv) {
- size_t n = 1;
- size_t prev = 1;
- size_t tmp;
+ gpr_uint32 n = 1;
+ gpr_uint32 prev = 1;
+ gpr_uint32 tmp;
grpc_test_init(argc, argv);