aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-04-13 10:11:11 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-04-13 10:11:11 -0400
commitac06144cc94c893b0a8ae53ed7e241f3bd7631e4 (patch)
treec7e1a360e6cc6a66cbef3d94fa77327256098f41 /tests
parentserver: Add client destroy signal (diff)
downloadwayland-ac06144cc94c893b0a8ae53ed7e241f3bd7631e4.tar
wayland-ac06144cc94c893b0a8ae53ed7e241f3bd7631e4.tar.gz
wayland-ac06144cc94c893b0a8ae53ed7e241f3bd7631e4.tar.bz2
wayland-ac06144cc94c893b0a8ae53ed7e241f3bd7631e4.tar.lz
wayland-ac06144cc94c893b0a8ae53ed7e241f3bd7631e4.tar.xz
wayland-ac06144cc94c893b0a8ae53ed7e241f3bd7631e4.tar.zst
wayland-ac06144cc94c893b0a8ae53ed7e241f3bd7631e4.zip
tests: Fix signedness warnings
Diffstat (limited to 'tests')
-rw-r--r--tests/array-test.c12
-rw-r--r--tests/connection-test.c2
-rw-r--r--tests/list-test.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/array-test.c b/tests/array-test.c
index 2be369f..0269e3e 100644
--- a/tests/array-test.c
+++ b/tests/array-test.c
@@ -45,16 +45,16 @@ TEST(array_init)
TEST(array_add)
{
struct mydata {
- int a;
- unsigned b;
+ unsigned int a;
+ unsigned int b;
double c;
double d;
};
- const int iterations = 1321; /* this is arbitrary */
+ const unsigned int iterations = 1321; /* this is arbitrary */
const int datasize = sizeof(struct mydata);
struct wl_array array;
- int i;
+ size_t i;
wl_array_init(&array);
@@ -64,7 +64,7 @@ TEST(array_add)
assert((i + 1) * datasize == array.size);
ptr->a = i * 3;
- ptr->b = -i;
+ ptr->b = 20000 - i;
ptr->c = (double)(i);
ptr->d = (double)(i / 2.);
}
@@ -75,7 +75,7 @@ TEST(array_add)
struct mydata* check = (struct mydata*)(array.data + index);
assert(check->a == i * 3);
- assert(check->b == -i);
+ assert(check->b == 20000 - i);
assert(check->c == (double)(i));
assert(check->d == (double)(i/2.));
}
diff --git a/tests/connection-test.c b/tests/connection-test.c
index ff31518..a4d76b7 100644
--- a/tests/connection-test.c
+++ b/tests/connection-test.c
@@ -186,7 +186,7 @@ static void
marshal(struct marshal_data *data, const char *format, int size, ...)
{
struct wl_closure *closure;
- static const int opcode = 4444;
+ static const uint32_t opcode = 4444;
static struct wl_object sender = { NULL, NULL, 1234 };
struct wl_message message = { "test", format, NULL };
va_list ap;
diff --git a/tests/list-test.c b/tests/list-test.c
index 2b59aa4..06d0b29 100644
--- a/tests/list-test.c
+++ b/tests/list-test.c
@@ -59,7 +59,7 @@ TEST(list_iterator)
struct wl_list list;
struct element e1, e2, e3, e4, *e;
int reference[] = { 708090, 102030, 5588, 12 };
- int i;
+ unsigned int i;
e1.i = 708090;
e2.i = 102030;