home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------------------
- // test_xx
- //-------------------------------------------------------------------------
- int test_xx(){
- char *function = "xx";
- tstring *ts;
- wlist *wl;
- int pass=TRUE;
- int passall=TRUE;
- char *result;
-
- wl=new wlist;
- wl->SetPrintData(print_tstring);
- wl->SetCompareData(compare_tstring);
-
- //-----------------------------------------------------------------
- // test with empty list
- //-----------------------------------------------------------------
-
- if(!pass)
- {
- printf("\tfunction %s failed empty list test\n",function);
- passall=FALSE;
- pass=TRUE;
- }
- wl->DeleteAll();
- //-----------------------------------------------------------------
- // test with one nodes in list
- //-----------------------------------------------------------------
- wlbuild(wl,1);
-
- if(!pass)
- {
- printf("\tfunction %s failed 1 element list test\n",function);
- passall=FALSE;
- pass=TRUE;
- }
- wl->DeleteAll();
- //-----------------------------------------------------------------
- // test with 2 nodes in list list
- //-----------------------------------------------------------------
- wlbuild(wl,2);
-
- if(!pass)
- {
- printf("\tfunction %s failed 2 element list test\n",function);
- passall=FALSE;
- pass=TRUE;
- }
- wl->DeleteAll();
- //-----------------------------------------------------------------
- // test with 3 nodes in list
- //-----------------------------------------------------------------
- wlbuild(wl,3);
-
-
- if(!pass)
- {
- printf("\tfunction %s failed 3 element list test\n",function);
- passall=FALSE;
- pass=TRUE;
- }
- wl->DeleteAll();
- return passall;
- }
-