aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-01-30 02:11:35 +0100
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-01-30 02:11:35 +0100
commit213ed9185098c543996f2362ea4ee810930f6f5d (patch)
treeec393db8608bde3be050c31252d0e7a230567557 /test/core/iomgr
parentc630682ad8c2cf597d1786ec637587678f3c7d6e (diff)
Re-enabling errors on warning, disabling unused parameter warning, and fixing all subsequent errors.
Diffstat (limited to 'test/core/iomgr')
-rw-r--r--test/core/iomgr/resolve_address_test.c6
-rw-r--r--test/core/iomgr/sockaddr_utils_test.c7
-rw-r--r--test/core/iomgr/tcp_posix_test.c10
3 files changed, 11 insertions, 12 deletions
diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c
index 4cc101b6b0..1f97724e60 100644
--- a/test/core/iomgr/resolve_address_test.c
+++ b/test/core/iomgr/resolve_address_test.c
@@ -85,7 +85,7 @@ static void test_ipv6_with_port(void) {
static void test_ipv6_without_port(void) {
const char* const kCases[] = {"2001:db8::1", "2001:db8::1.2.3.4",
"[2001:db8::1]", };
- int i;
+ unsigned i;
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
@@ -96,7 +96,7 @@ static void test_ipv6_without_port(void) {
static void test_invalid_ip_addresses(void) {
const char* const kCases[] = {"293.283.1238.3:1", "[2001:db8::11111]:1", };
- int i;
+ unsigned i;
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
@@ -108,7 +108,7 @@ static void test_invalid_ip_addresses(void) {
static void test_unparseable_hostports(void) {
const char* const kCases[] = {"[", "[::1", "[::1]bad",
"[1.2.3.4]", "[localhost]", "[localhost]:1", };
- int i;
+ unsigned i;
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
diff --git a/test/core/iomgr/sockaddr_utils_test.c b/test/core/iomgr/sockaddr_utils_test.c
index 3e653da4c9..6cbdc4e21c 100644
--- a/test/core/iomgr/sockaddr_utils_test.c
+++ b/test/core/iomgr/sockaddr_utils_test.c
@@ -182,7 +182,8 @@ static void expect_sockaddr_str(const char *expected, void *addr,
gpr_log(GPR_INFO, " expect_sockaddr_str(%s)", expected);
result = grpc_sockaddr_to_string(&str, (struct sockaddr *)addr, normalize);
GPR_ASSERT(str != NULL);
- GPR_ASSERT(result == strlen(str));
+ GPR_ASSERT(result >= 0);
+ GPR_ASSERT((size_t)result == strlen(str));
GPR_ASSERT(strcmp(expected, str) == 0);
gpr_free(str);
}
@@ -194,7 +195,7 @@ static void test_sockaddr_to_string(void) {
gpr_log(GPR_INFO, "%s", __FUNCTION__);
- errno = 0xDEADBEEF;
+ errno = 0x7EADBEEF;
input4 = make_addr4(kIPv4, sizeof(kIPv4));
expect_sockaddr_str("192.0.2.1:12345", &input4, 0);
@@ -217,7 +218,7 @@ static void test_sockaddr_to_string(void) {
expect_sockaddr_str("(sockaddr family=123)", &dummy, 0);
expect_sockaddr_str("(sockaddr family=123)", &dummy, 1);
- GPR_ASSERT(errno == 0xDEADBEEF);
+ GPR_ASSERT(errno == 0x7EADBEEF);
}
int main(int argc, char **argv) {
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c
index 24634b4700..f52ae22981 100644
--- a/test/core/iomgr/tcp_posix_test.c
+++ b/test/core/iomgr/tcp_posix_test.c
@@ -94,7 +94,7 @@ static size_t fill_socket_partial(int fd, size_t bytes) {
ssize_t write_bytes;
size_t total_bytes = 0;
unsigned char *buf = malloc(bytes);
- int i;
+ unsigned i;
for (i = 0; i < bytes; ++i) {
buf[i] = i % 256;
}
@@ -115,15 +115,14 @@ struct read_socket_state {
grpc_endpoint *ep;
gpr_mu mu;
gpr_cv cv;
- size_t read_bytes;
+ ssize_t read_bytes;
ssize_t target_read_bytes;
};
static ssize_t count_and_unref_slices(gpr_slice *slices, size_t nslices,
int *current_data) {
ssize_t num_bytes = 0;
- int i;
- int j;
+ unsigned i, j;
unsigned char *buf;
for (i = 0; i < nslices; ++i) {
buf = GPR_SLICE_START_PTR(slices[i]);
@@ -254,8 +253,7 @@ static gpr_slice *allocate_blocks(ssize_t num_bytes, ssize_t slice_size,
ssize_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0);
gpr_slice *slices = gpr_malloc(sizeof(gpr_slice) * nslices);
ssize_t num_bytes_left = num_bytes;
- int i;
- int j;
+ unsigned i, j;
unsigned char *buf;
*num_blocks = nslices;