aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2012-08-27 15:05:48 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2012-08-27 15:05:48 +0000
commit8f7291d3f92c385548d3c81dab6f30de85b0b032 (patch)
treeb3a77727e3e621a46e7c133fa34480e0e2177df4 /src
parent3b87d21ad6fa38824fd0d73b64af94a065207c8e (diff)
updated to slightly modified api
and fix comments on tests svn path=/trunk/externals/iem/iemmatrix/; revision=16179
Diffstat (limited to 'src')
-rw-r--r--src/mtx_qhull/test_list.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/src/mtx_qhull/test_list.c b/src/mtx_qhull/test_list.c
index 9ac5924..61308ca 100644
--- a/src/mtx_qhull/test_list.c
+++ b/src/mtx_qhull/test_list.c
@@ -6,68 +6,69 @@ int main(char **argv, int argc) {
list_t l1=emptyList();
list_t l2=emptyList();
list_t l3=emptyList();
- entry_t x[]={0, 2, 4, 6};
-
- printf("empty list:\n");
+ index_t x[]={0, 2, 4, 6};
+ printf("\nempty list:\n");
printList(l1);
freeList(&l1);
- printf("constant list with 10 1 entries:\n");
- l1=initConstantList(1,10);
+ printf("\nconstant list with 10 1 entries:\n");
+ l1=initConstantList(entry_makeIndex(1),10);
printList(l1);
freeList(&l1);
- printf("list from 2 to 3:\n");
+ printf("\nlist from 2 to 3:\n");
l1=initListFromTo(2,3);
printList(l1);
- printf("list from 7 to 1:\n");
+
+ printf("\nlist from 7 to 1:\n");
l2=initListFromTo(7,1);
printList(l2);
- printf("duplicate list from 2 to 3:\n");
+
+ printf("\nduplicate list from 2 to 3:\n");
l3=duplicateList(l1);
printList(l3);
freeList(&l3);
- printf("merge list from 1 to 7 with list from 2 to 3:\n");
+ printf("\nmerge list from 2..3 with list 7..1:\n");
l3=mergeLists(l1,l2);
printList(l3);
- printf("remove entry 6 list from list:\n");
- removeValueFromList(&l3,6);
+ printf("\nremove value 6 list from list:\n");
+ removeValueFromList(&l3,entry_makeIndex(6));
printList(l3);
- printf("remove entries [2, 3] from list:\n");
+ printf("\nremove values [2, 3] from list:\n");
removeValueListFromList(&l3,l1);
printList(l3);
- printf("reverse list:\n");
- reverseList (&l3);
- printList(l3);
+ printf("\nreverse list:\n");
+ reverseList (&l2);
+ printList(l2);
- printf("append entry 8 to list:\n");
- appendToList(&l3,8);
+ printf("\nappend entry 8 to list:\n");
+ appendToList(&l3,entry_makeIndex(8));
printList(l3);
- printf("is 8 not in list?: %d\n",notInList(8,l3));
- printf("is 3 not in list?: %d\n",notInList(3,l3));
+ printf("\nis 8 not in list?: %d\n",notInList(entry_makeIndex(8),l3));
+ printf("is 3 not in list?: %d\n",notInList(entry_makeIndex(3),l3));
- printf("remove item 4 from list\n");
- removeEntryFromList(&l3,4);
+ printf("\nremove index 4 from list\n");
+ removeIndexFromList(&l3,4);
printList(l3);
- printf("remove item 1 from list\n");
- removeEntryFromList(&l3,1);
+ printf("\nremove index 1 from list\n");
+ removeIndexFromList(&l3,1);
printList(l3);
- printf("remove item 0 from list\n");
- removeEntryFromList(&l3,0);
+ printf("\nremove index 0 from list\n");
+ removeIndexFromList(&l3,0);
printList(l3);
- printf("...taking a longer list\n");
+ printf("\n...taking a longer list\n");
printList(l2);
freeList(&l3);
- l3=initList(x,4);
- printf("removing index list ");
+ l3=initListIndex(x,4);
+ printf("\nremoving index list ");
printList(l3);
removeEntryListFromList(&l2,l3);
printList(l2);
@@ -77,9 +78,9 @@ int main(char **argv, int argc) {
l1=initListFromTo(1,3);
l2=initListFromTo(0,5);
- printf("...taking a longer list\n");
+ printf("\n...taking a longer list\n");
printList(l1);
- printf("finding indices of values in list");
+ printf("\nfinding indices of values in list");
printList(l2);
l3=findValueListInList(l2,l1);
printList(l3);