test/test_list.c

changeset 492
188942a7308b
parent 491
6d538177f746
child 494
6ce8cfa10a96
equal deleted inserted replaced
491:6d538177f746 492:188942a7308b
28 28
29 #include "cx/linked_list.h" 29 #include "cx/linked_list.h"
30 #include "test_config.h" 30 #include "test_config.h"
31 #include "util_allocator.h" 31 #include "util_allocator.h"
32 32
33 int cmp_int( 33 int cmp_int_impl(
34 int const *l, 34 int const *l,
35 int const *r 35 int const *r
36 ) { 36 ) {
37 int left = *l, right = *r; 37 int left = *l, right = *r;
38 return left == right ? 0 : (left < right ? -1 : 1); 38 return left == right ? 0 : (left < right ? -1 : 1);
39 } 39 }
40
41 #define cmp_int ((CxListComparator) cmp_int_impl)
40 42
41 struct node { 43 struct node {
42 struct node *next; 44 struct node *next;
43 struct node *prev; 45 struct node *prev;
44 int data; 46 int data;
130 void *list = create_test_data(4, data); 132 void *list = create_test_data(4, data);
131 int s; 133 int s;
132 134
133 s = 2; 135 s = 2;
134 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data, 136 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data,
135 false, (CxListComparator) cmp_int, &s), 0) 137 false, cmp_int, &s), 0)
136 s = 4; 138 s = 4;
137 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data, 139 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data,
138 false, (CxListComparator) cmp_int, &s), 1) 140 false, cmp_int, &s), 1)
139 s = 6; 141 s = 6;
140 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data, 142 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data,
141 false, (CxListComparator) cmp_int, &s), 2) 143 false, cmp_int, &s), 2)
142 s = 8; 144 s = 8;
143 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data, 145 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data,
144 false, (CxListComparator) cmp_int, &s), 3) 146 false, cmp_int, &s), 3)
145 s = 10; 147 s = 10;
146 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data, 148 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data,
147 false, (CxListComparator) cmp_int, &s), 4) 149 false, cmp_int, &s), 4)
148 s = -2; 150 s = -2;
149 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data, 151 CU_ASSERT_EQUAL(cx_linked_list_find(list, loc_next, loc_data,
150 false, (CxListComparator) cmp_int, &s), 4) 152 false, cmp_int, &s), 4)
151 } 153 }
152 154
153 void test_linked_list_compare(void) { 155 void test_linked_list_compare(void) {
154 int a[] = {2, 4, 6, 8}; 156 int a[] = {2, 4, 6, 8};
155 int b[] = {2, 4, 6}; 157 int b[] = {2, 4, 6};
158 void *la = create_test_data(4, a); 160 void *la = create_test_data(4, a);
159 void *lb = create_test_data(3, b); 161 void *lb = create_test_data(3, b);
160 void *lc = create_test_data(4, c); 162 void *lc = create_test_data(4, c);
161 163
162 CU_ASSERT_TRUE(0 < cx_linked_list_compare(la, lb, loc_next, loc_data, 164 CU_ASSERT_TRUE(0 < cx_linked_list_compare(la, lb, loc_next, loc_data,
163 false, (CxListComparator) cmp_int) 165 false, cmp_int)
164 ) 166 )
165 CU_ASSERT_TRUE(0 > cx_linked_list_compare(lb, la, loc_next, loc_data, 167 CU_ASSERT_TRUE(0 > cx_linked_list_compare(lb, la, loc_next, loc_data,
166 false, (CxListComparator) cmp_int) 168 false, cmp_int)
167 ) 169 )
168 CU_ASSERT_TRUE(0 < cx_linked_list_compare(lc, la, loc_next, loc_data, 170 CU_ASSERT_TRUE(0 < cx_linked_list_compare(lc, la, loc_next, loc_data,
169 false, (CxListComparator) cmp_int) 171 false, cmp_int)
170 ) 172 )
171 CU_ASSERT_TRUE(0 > cx_linked_list_compare(la, lc, loc_next, loc_data, 173 CU_ASSERT_TRUE(0 > cx_linked_list_compare(la, lc, loc_next, loc_data,
172 false, (CxListComparator) cmp_int) 174 false, cmp_int)
173 ) 175 )
174 CU_ASSERT_TRUE(0 == cx_linked_list_compare(la, la, loc_next, loc_data, 176 CU_ASSERT_TRUE(0 == cx_linked_list_compare(la, la, loc_next, loc_data,
175 false, (CxListComparator) cmp_int) 177 false, cmp_int)
176 ) 178 )
177 179
178 destroy_test_data(la); 180 destroy_test_data(la);
179 destroy_test_data(lb); 181 destroy_test_data(lb);
180 destroy_test_data(lc); 182 destroy_test_data(lc);
510 512
511 void *begin = create_test_data(100, scrambled); 513 void *begin = create_test_data(100, scrambled);
512 void *end = cx_linked_list_last(begin, loc_next); 514 void *end = cx_linked_list_last(begin, loc_next);
513 515
514 cx_linked_list_sort(&begin, &end, loc_prev, loc_next, loc_data, 516 cx_linked_list_sort(&begin, &end, loc_prev, loc_next, loc_data,
515 false, (CxListComparator) cmp_int); 517 false, cmp_int);
516 518
517 struct node *check = begin; 519 struct node *check = begin;
518 struct node *check_last = NULL; 520 struct node *check_last = NULL;
519 CU_ASSERT_PTR_NULL(check->prev) 521 CU_ASSERT_PTR_NULL(check->prev)
520 CU_ASSERT_EQUAL(check->data, expected[0]) 522 CU_ASSERT_EQUAL(check->data, expected[0])
547 549
548 cx_linked_list_reverse(&begin, &end, loc_prev, loc_next); 550 cx_linked_list_reverse(&begin, &end, loc_prev, loc_next);
549 CU_ASSERT_PTR_EQUAL(end, list) 551 CU_ASSERT_PTR_EQUAL(end, list)
550 CU_ASSERT_PTR_EQUAL(begin, cx_linked_list_first(end, loc_prev)) 552 CU_ASSERT_PTR_EQUAL(begin, cx_linked_list_first(end, loc_prev))
551 CU_ASSERT_TRUE(0 == cx_linked_list_compare(begin, expected, loc_next, loc_data, 553 CU_ASSERT_TRUE(0 == cx_linked_list_compare(begin, expected, loc_next, loc_data,
552 0, (CxListComparator) cmp_int)) 554 0, cmp_int))
553 555
554 destroy_test_data(begin); 556 destroy_test_data(begin);
555 destroy_test_data(expected); 557 destroy_test_data(expected);
556 } 558 }
557 559
558 void test_hl_linked_list_create(void) { 560 void test_hl_linked_list_create(void) {
559 cxTestingAllocatorReset(); 561 cxTestingAllocatorReset();
560 562
561 CxList list = cxLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int)); 563 CxList list = cxLinkedListCreate(cxTestingAllocator, cmp_int, sizeof(int));
562 564
563 CU_ASSERT_EQUAL(list->size, 0) 565 CU_ASSERT_EQUAL(list->size, 0)
564 CU_ASSERT_EQUAL(list->capacity, (size_t) -1) 566 CU_ASSERT_EQUAL(list->capacity, (size_t) -1)
565 CU_ASSERT_PTR_EQUAL(list->allocator, cxTestingAllocator) 567 CU_ASSERT_PTR_EQUAL(list->allocator, cxTestingAllocator)
566 CU_ASSERT_EQUAL(list->itemsize, sizeof(int)) 568 CU_ASSERT_EQUAL(list->itemsize, sizeof(int))
573 void test_hl_linked_list_from_array(void) { 575 void test_hl_linked_list_from_array(void) {
574 cxTestingAllocatorReset(); 576 cxTestingAllocatorReset();
575 577
576 int data[] = {2, 4, 5, 7, 10, 15}; 578 int data[] = {2, 4, 5, 7, 10, 15};
577 579
578 CxList expected = cxLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int)); 580 CxList expected = cxLinkedListCreate(cxTestingAllocator, cmp_int, sizeof(int));
579 for (int i = 0; i < 5; i++) cxListAdd(expected, &data[i]); 581 for (int i = 0; i < 5; i++) cxListAdd(expected, &data[i]);
580 582
581 CxList list = cxLinkedListFromArray(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int), 5, data); 583 CxList list = cxLinkedListFromArray(cxTestingAllocator, cmp_int, sizeof(int), 5, data);
582 584
583 CU_ASSERT_TRUE(0 == cxListCompare(list, expected)) 585 CU_ASSERT_TRUE(0 == cxListCompare(list, expected))
584 586
585 cxLinkedListDestroy(list); 587 cxLinkedListDestroy(list);
586 cxLinkedListDestroy(expected); 588 cxLinkedListDestroy(expected);
589 591
590 void test_hl_linked_list_add(void) { 592 void test_hl_linked_list_add(void) {
591 cxTestingAllocatorReset(); 593 cxTestingAllocatorReset();
592 594
593 int data; 595 int data;
594 CxList list = cxLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int)); 596 CxList list = cxLinkedListCreate(cxTestingAllocator, cmp_int, sizeof(int));
595 597
596 data = 5; 598 data = 5;
597 CU_ASSERT_EQUAL(cxListAdd(list, &data), 0) 599 CU_ASSERT_EQUAL(cxListAdd(list, &data), 0)
598 data = 47; 600 data = 47;
599 CU_ASSERT_EQUAL(cxListAdd(list, &data), 0) 601 CU_ASSERT_EQUAL(cxListAdd(list, &data), 0)
601 CU_ASSERT_EQUAL(cxListAdd(list, &data), 0) 603 CU_ASSERT_EQUAL(cxListAdd(list, &data), 0)
602 604
603 CU_ASSERT_EQUAL(list->size, 3) 605 CU_ASSERT_EQUAL(list->size, 3)
604 CU_ASSERT_TRUE(list->capacity >= list->size) 606 CU_ASSERT_TRUE(list->capacity >= list->size)
605 607
606 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 0), 5) 608 int exp[] = {5, 47, 13};
607 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 1), 47) 609 CxList expected = cxLinkedListFromArray(cxTestingAllocator, cmp_int, sizeof(int), 3, exp);
608 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 2), 13) 610 CU_ASSERT_TRUE(0 == cxListCompare(list, expected))
609 611
610 cxLinkedListDestroy(list); 612 cxLinkedListDestroy(list);
613 cxLinkedListDestroy(expected);
611 CU_ASSERT_TRUE(cxTestingAllocatorVerify()) 614 CU_ASSERT_TRUE(cxTestingAllocatorVerify())
612 } 615 }
613 616
614 void test_hl_linked_list_insert(void) { 617 void test_hl_linked_list_insert(void) {
615 cxTestingAllocatorReset(); 618 cxTestingAllocatorReset();
616 619
617 int data; 620 int data;
618 CxList list = cxLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int)); 621 CxList list = cxLinkedListCreate(cxTestingAllocator, cmp_int, sizeof(int));
619 622
620 data = 5; 623 data = 5;
621 CU_ASSERT_NOT_EQUAL(cxListInsert(list, 1, &data), 0) 624 CU_ASSERT_NOT_EQUAL(cxListInsert(list, 1, &data), 0)
622 CU_ASSERT_EQUAL(list->size, 0) 625 CU_ASSERT_EQUAL(list->size, 0)
623 CU_ASSERT_EQUAL(cxListInsert(list, 0, &data), 0) 626 CU_ASSERT_EQUAL(cxListInsert(list, 0, &data), 0)
632 CU_ASSERT_EQUAL(cxListInsert(list, 3, &data), 0) 635 CU_ASSERT_EQUAL(cxListInsert(list, 3, &data), 0)
633 636
634 CU_ASSERT_EQUAL(list->size, 4) 637 CU_ASSERT_EQUAL(list->size, 4)
635 CU_ASSERT_TRUE(list->capacity >= list->size) 638 CU_ASSERT_TRUE(list->capacity >= list->size)
636 639
637 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 0), 47) 640 int exp[] = {47, 13, 5, 42};
638 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 1), 13) 641 CxList expected = cxLinkedListFromArray(cxTestingAllocator, cmp_int, sizeof(int), 4, exp);
639 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 2), 5) 642 CU_ASSERT_TRUE(0 == cxListCompare(list, expected))
640 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 3), 42) 643
641 644 cxLinkedListDestroy(list);
642 cxLinkedListDestroy(list); 645 cxLinkedListDestroy(expected);
643 CU_ASSERT_TRUE(cxTestingAllocatorVerify()) 646 CU_ASSERT_TRUE(cxTestingAllocatorVerify())
644 } 647 }
645 648
646 void test_hl_linked_list_remove(void) { 649 void test_hl_linked_list_remove(void) {
647 cxTestingAllocatorReset(); 650 cxTestingAllocatorReset();
648 651
649 int data; 652 int data[] = {5, 47, 42, 13};
650 CxList list = cxLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int)); 653 CxList list = cxLinkedListFromArray(cxTestingAllocator, cmp_int,
651 654 sizeof(int), 4, data);
652 data = 5;
653 cxListAdd(list, &data);
654 data = 47;
655 cxListAdd(list, &data);
656 data = 42;
657 cxListAdd(list, &data);
658 data = 13;
659 cxListAdd(list, &data);
660 655
661 CU_ASSERT_EQUAL(list->size, 4) 656 CU_ASSERT_EQUAL(list->size, 4)
662 CU_ASSERT_TRUE(list->capacity >= list->size) 657 CU_ASSERT_TRUE(list->capacity >= list->size)
663 658
664 CU_ASSERT_NOT_EQUAL(cxListRemove(list, 4), 0) 659 CU_ASSERT_NOT_EQUAL(cxListRemove(list, 4), 0)
692 } 687 }
693 688
694 void test_hl_linked_list_at(void) { 689 void test_hl_linked_list_at(void) {
695 cxTestingAllocatorReset(); 690 cxTestingAllocatorReset();
696 691
697 CxList list = cxLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int)); 692 int data[] = {5, 47, 13};
698 693 CxList list = cxLinkedListFromArray(cxTestingAllocator, cmp_int,
699 int data; 694 sizeof(int), 3, data);
700 data = 5; 695
701 cxListAdd(list, &data); 696 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 0), 5)
702 data = 47; 697 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 1), 47)
703 cxListAdd(list, &data); 698 CU_ASSERT_EQUAL(*(int *) cxListAt(list, 2), 13)
704 data = 13;
705 cxListAdd(list, &data);
706
707 CU_ASSERT_EQUAL(*(int*)cxListAt(list, 0), 5)
708 CU_ASSERT_EQUAL(*(int*)cxListAt(list, 1), 47)
709 CU_ASSERT_EQUAL(*(int*)cxListAt(list, 2), 13)
710 CU_ASSERT_PTR_NULL(cxListAt(list, 3)) 699 CU_ASSERT_PTR_NULL(cxListAt(list, 3))
711 700
712 cxLinkedListDestroy(list); 701 cxLinkedListDestroy(list);
713 CU_ASSERT_TRUE(cxTestingAllocatorVerify()) 702 CU_ASSERT_TRUE(cxTestingAllocatorVerify())
714 } 703 }
715 704
716 void test_hl_linked_list_find(void) { 705 void test_hl_linked_list_find(void) {
717 cxTestingAllocatorReset(); 706 cxTestingAllocatorReset();
718 707
719 int data, criteria; 708 int data[] = {5, 47, 13};
720 CxList list = cxLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int)); 709 CxList list = cxLinkedListFromArray(cxTestingAllocator, cmp_int,
721 710 sizeof(int), 3, data);
722 data = 5;
723 cxListAdd(list, &data);
724 data = 47;
725 cxListAdd(list, &data);
726 data = 13;
727 cxListAdd(list, &data);
728
729 CU_ASSERT_EQUAL(list->size, 3) 711 CU_ASSERT_EQUAL(list->size, 3)
730 CU_ASSERT_TRUE(list->capacity >= list->size) 712 CU_ASSERT_TRUE(list->capacity >= list->size)
713
714 int criteria;
731 715
732 criteria = 5; 716 criteria = 5;
733 CU_ASSERT_EQUAL(cxListFind(list, &criteria), 0) 717 CU_ASSERT_EQUAL(cxListFind(list, &criteria), 0)
734 criteria = 47; 718 criteria = 47;
735 CU_ASSERT_EQUAL(cxListFind(list, &criteria), 1) 719 CU_ASSERT_EQUAL(cxListFind(list, &criteria), 1)
762 4016, 4085, 4121, 4254, 4319, 4366, 4459, 4514, 4681 746 4016, 4085, 4121, 4254, 4319, 4366, 4459, 4514, 4681
763 }; 747 };
764 748
765 cxTestingAllocatorReset(); 749 cxTestingAllocatorReset();
766 750
767 CxList list = cxLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int, sizeof(int)); 751 CxList list = cxLinkedListFromArray(cxTestingAllocator, cmp_int, sizeof(int), 100, scrambled);
768 752 CxList exp = cxLinkedListFromArray(cxTestingAllocator, cmp_int, sizeof(int), 100, expected);
769 for (int i = 0; i < 100; i++) {
770 cxListAdd(list, &scrambled[i]);
771 }
772 753
773 cxListSort(list); 754 cxListSort(list);
774 755 CU_ASSERT_TRUE(0 == cxListCompare(list, exp))
775 for (int i = 0; i < 100; i++) { 756
776 CU_ASSERT_EQUAL(*(int *) cxListAt(list, i), expected[i]) 757 cxLinkedListDestroy(list);
777 } 758 cxLinkedListDestroy(exp);
778
779 cxLinkedListDestroy(list);
780 CU_ASSERT_TRUE(cxTestingAllocatorVerify()) 759 CU_ASSERT_TRUE(cxTestingAllocatorVerify())
781 } 760 }
782 761
783 void test_hl_ptr_linked_list_create(void) { 762 void test_hl_ptr_linked_list_create(void) {
784 cxTestingAllocatorReset(); 763 cxTestingAllocatorReset();
785 764
786 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int); 765 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, cmp_int);
787 766
788 CU_ASSERT_EQUAL(list->size, 0) 767 CU_ASSERT_EQUAL(list->size, 0)
789 CU_ASSERT_EQUAL(list->capacity, (size_t) -1) 768 CU_ASSERT_EQUAL(list->capacity, (size_t) -1)
790 CU_ASSERT_PTR_EQUAL(list->allocator, cxTestingAllocator) 769 CU_ASSERT_PTR_EQUAL(list->allocator, cxTestingAllocator)
791 CU_ASSERT_EQUAL(list->itemsize, sizeof(void *)) 770 CU_ASSERT_EQUAL(list->itemsize, sizeof(void *))
796 } 775 }
797 776
798 void test_hl_ptr_linked_list_add(void) { 777 void test_hl_ptr_linked_list_add(void) {
799 cxTestingAllocatorReset(); 778 cxTestingAllocatorReset();
800 779
801 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int); 780 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, cmp_int);
802 781
803 int a = 5, b = 47, c = 13; 782 int a = 5, b = 47, c = 13;
804 783
805 CU_ASSERT_EQUAL(cxListAdd(list, &a), 0) 784 CU_ASSERT_EQUAL(cxListAdd(list, &a), 0)
806 CU_ASSERT_EQUAL(cxListAdd(list, &b), 0) 785 CU_ASSERT_EQUAL(cxListAdd(list, &b), 0)
826 } 805 }
827 806
828 void test_hl_ptr_linked_list_insert(void) { 807 void test_hl_ptr_linked_list_insert(void) {
829 cxTestingAllocatorReset(); 808 cxTestingAllocatorReset();
830 809
831 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int); 810 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, cmp_int);
832 811
833 int a = 5, b = 47, c = 13, d = 42; 812 int a = 5, b = 47, c = 13, d = 42;
834 813
835 CU_ASSERT_NOT_EQUAL(cxListInsert(list, 1, &a), 0) 814 CU_ASSERT_NOT_EQUAL(cxListInsert(list, 1, &a), 0)
836 CU_ASSERT_EQUAL(list->size, 0) 815 CU_ASSERT_EQUAL(list->size, 0)
856 835
857 void test_hl_ptr_linked_list_remove(void) { 836 void test_hl_ptr_linked_list_remove(void) {
858 cxTestingAllocatorReset(); 837 cxTestingAllocatorReset();
859 838
860 int a = 5, b = 47, c = 42, d = 13; 839 int a = 5, b = 47, c = 42, d = 13;
861 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int); 840 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, cmp_int);
862 841
863 cxListAdd(list, &a); 842 cxListAdd(list, &a);
864 cxListAdd(list, &b); 843 cxListAdd(list, &b);
865 cxListAdd(list, &c); 844 cxListAdd(list, &c);
866 cxListAdd(list, &d); 845 cxListAdd(list, &d);
899 } 878 }
900 879
901 void test_hl_ptr_linked_list_at(void) { 880 void test_hl_ptr_linked_list_at(void) {
902 cxTestingAllocatorReset(); 881 cxTestingAllocatorReset();
903 882
904 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int); 883 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, cmp_int);
905 884
906 int a = 5, b = 47, c = 13; 885 int a = 5, b = 47, c = 13;
907 cxListAdd(list, &a); 886 cxListAdd(list, &a);
908 cxListAdd(list, &b); 887 cxListAdd(list, &b);
909 cxListAdd(list, &c); 888 cxListAdd(list, &c);
919 898
920 void test_hl_ptr_linked_list_find(void) { 899 void test_hl_ptr_linked_list_find(void) {
921 cxTestingAllocatorReset(); 900 cxTestingAllocatorReset();
922 901
923 int a = 5, b = 47, c = 13, criteria; 902 int a = 5, b = 47, c = 13, criteria;
924 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int); 903 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, cmp_int);
925 904
926 cxListAdd(list, &a); 905 cxListAdd(list, &a);
927 cxListAdd(list, &b); 906 cxListAdd(list, &b);
928 cxListAdd(list, &c); 907 cxListAdd(list, &c);
929 908
965 4016, 4085, 4121, 4254, 4319, 4366, 4459, 4514, 4681 944 4016, 4085, 4121, 4254, 4319, 4366, 4459, 4514, 4681
966 }; 945 };
967 946
968 cxTestingAllocatorReset(); 947 cxTestingAllocatorReset();
969 948
970 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, (CxListComparator) cmp_int); 949 CxList list = cxPointerLinkedListCreate(cxTestingAllocator, cmp_int);
971 950
972 for (int i = 0; i < 100; i++) { 951 for (int i = 0; i < 100; i++) {
973 cxListAdd(list, &scrambled[i]); 952 cxListAdd(list, &scrambled[i]);
974 } 953 }
975 954

mercurial