9 #ifndef TEST_DATAARRANGE_H
10 #define TEST_DATAARRANGE_H
20 for (
int i=1;i<=20;i++)
23 for (
int i=0;i<3;i++){
24 TEST_CHECK((*fun[i])(pd, 0)==1);
27 for (
int i=0;i<3;i++){
28 TEST_CHECK((*fun[i])(pd, 99)==EMPTY);
32 for(
int i=19;i>0;i--){
34 TEST_CHECK(pd.lines[i].avail == 0);
35 TEST_CHECK(pd.lines[i].heap == NULL);
36 TEST_CHECK(pd.lines[i].list.first == NULL);
42 TEST_CHECK(PeekMaxPack(pd, 0)==20);
43 for (
int i=0;i<3;i++){
44 TEST_CHECK((*fun[i])(pd, 2)==EMPTY);
47 TEST_CHECK(PopFirstPack(pd, 0) == 1);
48 TEST_CHECK(PopLastPack(pd, 0) == 2);
49 TEST_CHECK(PopMaxPack(pd, 0) == 20);
51 TEST_CHECK(pd.packs[1].avail==0);
52 TEST_CHECK(pd.packs[2].avail==0);
53 TEST_CHECK(pd.packs[20].avail==0);
59 void test_func_pointer(
void){
61 pack* pk = &pd.packs[1];
63 TEST_CHECK( (*(pk->popfunc))(pd, pk->line) == pk->ID);
packData init_packData(int n, int l)
Initiate a package management problem.
Definition: list.c:43
int PeekFirstPack(packData, int i)
Definition: list.c:152
int PeekLastPack(packData, int i)
Definition: list.c:173