diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:32:34 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:32:34 (EST) |
commit | 014e4c306c4765c65abf1f2ce879bebcdd8c7261 (patch) | |
tree | fe4966e1da9d415586d3363c7ac24326fde6ee51 /tests | |
parent | 32ee5d15aca5dcdae46084c4a07fb7a072af379a (diff) |
opkg: implement active_list_prev and test cases.
git-svn-id: http://opkg.googlecode.com/svn/trunk@169 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'tests')
-rw-r--r-- | tests/opkg_active_list_test.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/opkg_active_list_test.c b/tests/opkg_active_list_test.c index f7bd390..1e21645 100644 --- a/tests/opkg_active_list_test.c +++ b/tests/opkg_active_list_test.c @@ -48,7 +48,8 @@ void active_test_add_depend(struct active_test *A, struct active_test *B) { |_M |_O Then the sequence will be -G M H I O J A B K N L C D E F ++: G M H I O J A B K N L C D E F +-: F E D C L N K B A J O I H M G */ void make_list(struct active_list *head) { struct active_test *A = active_test_new("A"); @@ -100,16 +101,17 @@ int main (void) { active_list_init(&head); make_list(&head); + printf("pos order: "); for(ptr = active_list_next(&head, &head); ptr ;ptr = active_list_next(&head, ptr)) { test = list_entry(ptr, struct active_test, list); printf ("%s ",test->str); } - printf("\n"); - for(ptr = active_list_next(&head, &head); ptr ;ptr = active_list_next(&head, ptr)) { + printf("\nneg order: "); + for(ptr = active_list_prev(&head, &head); ptr ;ptr = active_list_prev(&head, ptr)) { test = list_entry(ptr, struct active_test, list); printf ("%s ",test->str); } - printf("\n"); + printf("\npos order: "); for(ptr = active_list_next(&head, NULL); ptr ;ptr = active_list_next(&head, ptr)) { test = list_entry(ptr, struct active_test, list); printf ("%s ",test->str); |