diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-08-05 22:20:36 +0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-08-05 22:20:36 +0300 |
commit | b5a306ef73f9c31499f2d97f8b9d3db514b56a09 (patch) | |
tree | 9f1970d84dc720b7bc86824242d95cdedee784e1 /src/test | |
parent | 8dbf626535136b6fe6e1cf7d4ff251b2f505087c (diff) | |
parent | 9b57d9aee48e78bb591baecea1c3dbafd974759f (diff) |
Merge pull request #877 from crawford/dhcp-private-options-v4
networkd: save private-zone DHCP options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-list.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/test/test-list.c b/src/test/test-list.c index f6da1a7053..160064d06a 100644 --- a/src/test/test-list.c +++ b/src/test/test-list.c @@ -99,6 +99,50 @@ int main(int argc, const char *argv[]) { assert_se(items[1].item_prev == &items[3]); assert_se(items[3].item_prev == NULL); + LIST_REMOVE(item, head, &items[1]); + assert_se(LIST_JUST_US(item, &items[1])); + + assert_se(items[0].item_next == NULL); + assert_se(items[2].item_next == &items[0]); + assert_se(items[3].item_next == &items[2]); + + assert_se(items[0].item_prev == &items[2]); + assert_se(items[2].item_prev == &items[3]); + assert_se(items[3].item_prev == NULL); + + LIST_INSERT_BEFORE(item, head, &items[2], &items[1]); + assert_se(items[0].item_next == NULL); + assert_se(items[2].item_next == &items[0]); + assert_se(items[1].item_next == &items[2]); + assert_se(items[3].item_next == &items[1]); + + assert_se(items[0].item_prev == &items[2]); + assert_se(items[2].item_prev == &items[1]); + assert_se(items[1].item_prev == &items[3]); + assert_se(items[3].item_prev == NULL); + + LIST_REMOVE(item, head, &items[0]); + assert_se(LIST_JUST_US(item, &items[0])); + + assert_se(items[2].item_next == NULL); + assert_se(items[1].item_next == &items[2]); + assert_se(items[3].item_next == &items[1]); + + assert_se(items[2].item_prev == &items[1]); + assert_se(items[1].item_prev == &items[3]); + assert_se(items[3].item_prev == NULL); + + LIST_INSERT_BEFORE(item, head, NULL, &items[0]); + assert_se(items[0].item_next == NULL); + assert_se(items[2].item_next == &items[0]); + assert_se(items[1].item_next == &items[2]); + assert_se(items[3].item_next == &items[1]); + + assert_se(items[0].item_prev == &items[2]); + assert_se(items[2].item_prev == &items[1]); + assert_se(items[1].item_prev == &items[3]); + assert_se(items[3].item_prev == NULL); + LIST_REMOVE(item, head, &items[0]); assert_se(LIST_JUST_US(item, &items[0])); |