chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cdda4aa
)
test: duplicate LIST_FOREACH_OTHERS test to check for corner cases of end and start...
author
Lennart Poettering
<lennart@poettering.net>
Wed, 28 Jan 2015 13:22:13 +0000
(14:22 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 28 Jan 2015 13:22:13 +0000
(14:22 +0100)
src/test/test-list.c
patch
|
blob
|
history
diff --git
a/src/test/test-list.c
b/src/test/test-list.c
index 399ec8e58e01375fd363180ab9824de46160744a..f6da1a70533ad8a53a09b38b4901a13f1006ba8d 100644
(file)
--- a/
src/test/test-list.c
+++ b/
src/test/test-list.c
@@
-45,6
+45,20
@@
int main(int argc, const char *argv[]) {
}
assert_se(i == ELEMENTSOF(items)-1);
+ i = 0;
+ LIST_FOREACH_OTHERS(item, cursor, &items[0]) {
+ i++;
+ assert_se(cursor != &items[0]);
+ }
+ assert_se(i == ELEMENTSOF(items)-1);
+
+ i = 0;
+ LIST_FOREACH_OTHERS(item, cursor, &items[3]) {
+ i++;
+ assert_se(cursor != &items[3]);
+ }
+ assert_se(i == ELEMENTSOF(items)-1);
+
assert_se(!LIST_JUST_US(item, head));
assert_se(items[0].item_next == NULL);