test/test_list.cpp

changeset 611
77efa5163ae5
parent 610
de5d3ee6435f
child 613
85c08391a090
equal deleted inserted replaced
610:de5d3ee6435f 611:77efa5163ae5
629 EXPECT_EQ(list->size, 2); 629 EXPECT_EQ(list->size, 2);
630 EXPECT_EQ(cxListInsert(list, 1, &c), 0); 630 EXPECT_EQ(cxListInsert(list, 1, &c), 0);
631 EXPECT_EQ(list->size, 3); 631 EXPECT_EQ(list->size, 3);
632 EXPECT_EQ(cxListInsert(list, 3, &d), 0); 632 EXPECT_EQ(cxListInsert(list, 3, &d), 0);
633 633
634 EXPECT_EQ(list->size, 4); 634 ASSERT_EQ(list->size, 4);
635 EXPECT_GE(list->capacity, list->size); 635 EXPECT_GE(list->capacity, list->size);
636 636
637 EXPECT_EQ(*(int *) cxListAt(list, 0), 47); 637 EXPECT_EQ(*(int *) cxListAt(list, 0), 47);
638 EXPECT_EQ(*(int *) cxListAt(list, 1), 13); 638 EXPECT_EQ(*(int *) cxListAt(list, 1), 13);
639 EXPECT_EQ(*(int *) cxListAt(list, 2), 5); 639 EXPECT_EQ(*(int *) cxListAt(list, 2), 5);
838 TEST_F(PointerLinkedList, cxListInsert) { 838 TEST_F(PointerLinkedList, cxListInsert) {
839 verifyInsert(autofree(cxPointerLinkedListCreate(&testingAllocator, cx_cmp_int))); 839 verifyInsert(autofree(cxPointerLinkedListCreate(&testingAllocator, cx_cmp_int)));
840 } 840 }
841 841
842 TEST_F(ArrayList, cxListInsert) { 842 TEST_F(ArrayList, cxListInsert) {
843 ASSERT_EQ(1,0); // TODO: remove when implemented
844 verifyInsert(autofree(cxArrayListCreate(&testingAllocator, cx_cmp_int, sizeof(int), 2))); 843 verifyInsert(autofree(cxArrayListCreate(&testingAllocator, cx_cmp_int, sizeof(int), 2)));
845 } 844 }
846 845
847 TEST_F(LinkedList, cxListRemove) { 846 TEST_F(LinkedList, cxListRemove) {
848 verifyRemove(linkedListFromTestData()); 847 verifyRemove(linkedListFromTestData());

mercurial