26 |
#include <stdarg.h> |
#include <stdarg.h> |
27 |
#include <utilities/ascConfig.h> |
#include <utilities/ascConfig.h> |
28 |
#include <utilities/ascMalloc.h> |
#include <utilities/ascMalloc.h> |
|
#include <utilities/ascPrintType.h> |
|
29 |
#include <utilities/ascPrint.h> |
#include <utilities/ascPrint.h> |
30 |
#include <general/list.h> |
#include <general/list.h> |
31 |
#include "CUnit/CUnit.h" |
#include "CUnit/CUnit.h" |
147 |
* 1. pooling & recycling has been set up |
* 1. pooling & recycling has been set up |
148 |
* 2. the local gl_list_t* have been destroyed |
* 2. the local gl_list_t* have been destroyed |
149 |
* 3. pint_array[0..19] is allocated and initialized to [0..19] |
* 3. pint_array[0..19] is allocated and initialized to [0..19] |
150 |
* |
* |
151 |
* If a test section messes with any of these, then it must restore |
* If a test section messes with any of these, then it must restore |
152 |
* this state before finishing. |
* this state before finishing. |
153 |
*/ |
*/ |
788 |
for (i=0 ; i<9 ; ++i) { |
for (i=0 ; i<9 ; ++i) { |
789 |
CU_TEST(*((unsigned long*)gl_fetch(p_list1, i+2)) >= *((unsigned long*)gl_fetch(p_list1, i+1))); |
CU_TEST(*((unsigned long*)gl_fetch(p_list1, i+2)) >= *((unsigned long*)gl_fetch(p_list1, i+1))); |
790 |
} |
} |
791 |
|
|
792 |
for (i=0 ; i<10 ; ++i) { /* fill the list with unsorted data again */ |
for (i=0 ; i<10 ; ++i) { /* fill the list with unsorted data again */ |
793 |
gl_store(p_list1, i+1, pint_array[9-i]); |
gl_store(p_list1, i+1, pint_array[9-i]); |
794 |
CU_TEST(0 == gl_sorted(p_list1)); |
CU_TEST(0 == gl_sorted(p_list1)); |
1569 |
else { |
else { |
1570 |
CU_TEST(0 > gl_compare_ptrs(p_list1, p_list2)); |
CU_TEST(0 > gl_compare_ptrs(p_list1, p_list2)); |
1571 |
} |
} |
1572 |
|
|
1573 |
gl_reset(p_list1); |
gl_reset(p_list1); |
1574 |
gl_reset(p_list2); |
gl_reset(p_list2); |
1575 |
|
|
1576 |
for (i=0 ; i<20 ; ++i) { |
for (i=0 ; i<20 ; ++i) { |
1577 |
gl_append_ptr(p_list1, pint_array[i]); |
gl_append_ptr(p_list1, pint_array[i]); |
1578 |
gl_append_ptr(p_list2, pint_array[i]); |
gl_append_ptr(p_list2, pint_array[i]); |
1579 |
} |
} |
1580 |
|
|
1581 |
CU_TEST(0 == gl_compare_ptrs(p_list1, p_list2)); /* compare equal lists */ |
CU_TEST(0 == gl_compare_ptrs(p_list1, p_list2)); /* compare equal lists */ |
1582 |
CU_TEST(0 == gl_compare_ptrs(p_list2, p_list1)); /* compare equal lists */ |
CU_TEST(0 == gl_compare_ptrs(p_list2, p_list1)); /* compare equal lists */ |
1583 |
|
|