aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/test/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/test/list.c')
-rw-r--r--xorg-server/test/list.c24
1 files changed, 12 insertions, 12 deletions
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);