home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 410_01 / wlist / testtmpl.cc < prev    next >
Encoding:
Text File  |  1995-12-30  |  1.6 KB  |  66 lines

  1. //-------------------------------------------------------------------------
  2. // test_xx
  3. //-------------------------------------------------------------------------
  4. int test_xx(){
  5.     char    *function    =    "xx";
  6.     tstring *ts;
  7.     wlist *wl;
  8.     int pass=TRUE;
  9.     int passall=TRUE;
  10.     char    *result;
  11.  
  12.     wl=new wlist;
  13.     wl->SetPrintData(print_tstring);
  14.     wl->SetCompareData(compare_tstring);
  15.  
  16.     //-----------------------------------------------------------------
  17.     // test with empty list
  18.     //-----------------------------------------------------------------
  19.  
  20.     if(!pass)
  21.     {
  22.         printf("\tfunction %s failed empty list test\n",function);
  23.         passall=FALSE;
  24.         pass=TRUE;
  25.     }
  26.     wl->DeleteAll();
  27.     //-----------------------------------------------------------------
  28.     // test with one nodes in list
  29.     //-----------------------------------------------------------------
  30.     wlbuild(wl,1);
  31.  
  32.     if(!pass)
  33.     {
  34.         printf("\tfunction %s failed 1 element list test\n",function);
  35.         passall=FALSE;
  36.         pass=TRUE;
  37.     }
  38.     wl->DeleteAll();
  39.     //-----------------------------------------------------------------
  40.     // test with 2 nodes in list list
  41.     //-----------------------------------------------------------------
  42.     wlbuild(wl,2);
  43.  
  44.     if(!pass)
  45.     {
  46.         printf("\tfunction %s failed 2 element list test\n",function);
  47.         passall=FALSE;
  48.         pass=TRUE;
  49.     }
  50.     wl->DeleteAll();
  51.     //-----------------------------------------------------------------
  52.     // test with 3 nodes in list
  53.     //-----------------------------------------------------------------
  54.     wlbuild(wl,3);
  55.  
  56.  
  57.     if(!pass)
  58.     {
  59.         printf("\tfunction %s failed 3 element list test\n",function);
  60.         passall=FALSE;
  61.         pass=TRUE;
  62.     }
  63.     wl->DeleteAll();
  64.     return passall;
  65. }
  66.