aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/test
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/test')
-rw-r--r--xorg-server/test/Makefile.am5
-rw-r--r--xorg-server/test/list.c24
-rw-r--r--xorg-server/test/signal-logging.c7
3 files changed, 20 insertions, 16 deletions
diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am
index 32edc7a3b..83442767a 100644
--- a/xorg-server/test/Makefile.am
+++ b/xorg-server/test/Makefile.am
@@ -5,7 +5,10 @@ if XORG
# Tests that require at least some DDX functions in order to fully link
# For now, requires xf86 ddx, could be adjusted to use another
SUBDIRS += xi2
-noinst_PROGRAMS += xkb input xtest misc fixes xfree86 hashtabletest os signal-logging touch
+noinst_PROGRAMS += xkb input xtest misc fixes xfree86 os signal-logging touch
+if RES
+noinst_PROGRAMS += hashtabletest
+endif
endif
check_LTLIBRARIES = libxservertest.la
diff --git a/xorg-server/test/list.c b/xorg-server/test/list.c
index f9f54ee4e..28d9609ef 100644
--- a/xorg-server/test/list.c
+++ b/xorg-server/test/list.c
@@ -249,15 +249,15 @@ test_nt_list_append(void)
/* Test using nt_list_next */
for (item = foo, i = 1; i <= 10; i++, item = nt_list_next(item, next)) {
- assert(item->a = i);
- assert(item->b = i * 2);
+ assert(item->a == i);
+ assert(item->b == i * 2);
}
/* Test using nt_list_for_each_entry */
i = 1;
nt_list_for_each_entry(item, foo, next) {
- assert(item->a = i);
- assert(item->b = i * 2);
+ assert(item->a == i);
+ assert(item->b == i * 2);
i++;
}
assert(i == 11);
@@ -270,11 +270,11 @@ test_nt_list_insert(void)
struct foo *foo = calloc(10, sizeof(struct foo));
struct foo *item;
- foo->a = 10;
- foo->b = 20;
+ foo->a = 1;
+ foo->b = 2;
nt_list_init(foo, next);
- for (item = &foo[1], i = 9; i > 0; i--, item++) {
+ for (item = &foo[1], i = 10; i > 1; i--, item++) {
item->a = i;
item->b = i * 2;
nt_list_init(item, next);
@@ -282,16 +282,16 @@ test_nt_list_insert(void)
}
/* Test using nt_list_next */
- for (item = foo, i = 10; i > 0; i--, item = nt_list_next(item, next)) {
- assert(item->a = i);
- assert(item->b = i * 2);
+ for (item = foo, i = 1; i <= 10; i++, item = nt_list_next(item, next)) {
+ assert(item->a == i);
+ assert(item->b == i * 2);
}
/* Test using nt_list_for_each_entry */
i = 1;
nt_list_for_each_entry(item, foo, next) {
- assert(item->a = i);
- assert(item->b = i * 2);
+ assert(item->a == i);
+ assert(item->b == i * 2);
i++;
}
assert(i == 11);
diff --git a/xorg-server/test/signal-logging.c b/xorg-server/test/signal-logging.c
index 432012195..3d2d04801 100644
--- a/xorg-server/test/signal-logging.c
+++ b/xorg-server/test/signal-logging.c
@@ -113,12 +113,13 @@ double float_tests[] = { 0, 5, 0.1, 0.01, 5.2342, 10.2301,
-1, -2.00, -0.6023, -1203.30
};
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverflow"
+
static void
number_formatting(void)
{
int i;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Woverflow"
long unsigned int unsigned_tests[] = { 0,/* Zero */
5, /* Single digit number */
12, /* Two digit decimal number */
@@ -141,7 +142,6 @@ number_formatting(void)
-0x15D027BF211B37A, /* Large > 32 bit number */
-0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */
} ;
-#pragma GCC diagnostic pop
for (i = 0; i < sizeof(unsigned_tests) / sizeof(unsigned_tests[0]); i++)
assert(check_number_format_test(unsigned_tests[i]));
@@ -152,6 +152,7 @@ number_formatting(void)
for (i = 0; i < sizeof(float_tests) / sizeof(float_tests[0]); i++)
assert(check_float_format_test(float_tests[i]));
}
+#pragma GCC diagnostic pop
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-security"