(file) Return to cabinet_fdi.c CVS log (file) (dir) Up to [RizwankCVS] / group3 / wine / dlls / cabinet / tests

Diff for /group3/wine/dlls/cabinet/tests/cabinet_fdi.c between version 1.2 and 1.5

version 1.2, 2005/02/04 08:51:51 version 1.5, 2005/02/04 09:37:43
Line 65 
Line 65 
         FDIDestroy         FDIDestroy
 */ */
  
   /* Currently mostly dummy function pointers */
  
   FNALLOC(debug_alloc) {
           printf("   FNALLOC just called with %d\n",cb);
           return malloc(cb);
   }
   
   FNFREE(debug_free) {
           printf("   FNFREE just called with %d\n",pv);
           free(pv);
           return;
   }
   
   /*
   It is not necessary for these functions to actually call _open etc.; these functions could instead call fopen, fread, fwrite, fclose, and fseek, or CreateFile, ReadFile, WriteFile, CloseHandle, and SetFilePointer, etc.  However, the parameters and return codes will have to be translated appropriately (e.g. the file open mode passed in to pfnopen).
   */
   
   FNOPEN(dummy_open) {
            printf("  FNOPEN just called with %d, %d, %d\n",pszFile, oflag, pmode);
           return 0;
   }
   
   FNREAD(dummy_read) {
            printf("   FNREAD just called with %d, %d, %d\n",hf, pv, cb);
           return 0;
   }
   
   FNWRITE(dummy_write) {
            printf("   FNWRITE just called with %d, %d, %d\n",hf, pv, cb);
           return 0;
   }
   
   
   FNCLOSE(dummy_close) {
            printf("   FNCLOSE just called with %d\n",hf);
           return 0;
   }
   
   FNSEEK(dummy_seek) {
            printf("   FNSEEK just called with %d, %d, %d\n",hf, dist, seektype);
           return 0;
   }
   
   HFDI hfdi_386, hfdi_286, hfdi_unknown;
   /* yes its global and ugly */
   
   static void TestDestroy(void) {
           printf("Starting TestDestroy()\n");
                   /* Only two things to check in FDIDestroy
              1=> Does it return T if its passed an hfdi
              2=> Does it return F if its passed a non hfdi
                   EDIT : Causes GPL if FDIDestroy is called on an invalid pointer.
                   ok( 0 == FDIDestroy(0), "Return true incorrectly in TestDestroy()!\n");
                   */
           ok(FDIDestroy(hfdi_386), "Failed on destroying 386 hfdi!\n");
           ok(FDIDestroy(hfdi_286), "Failed on destroying 286 hfdi!\n");
           ok(FDIDestroy(hfdi_unknown), "Failed on destroying unknown hfdi!\n");
           printf("Ending TestDestroy()\n");
   
   }
   
   static void TestCreate(void) {
   
           ERF error_structure;
  
           printf("Starting TestCreate()\n");
  
           hfdi_386 = FDICreate(
                   debug_alloc,
                   debug_free,
                   dummy_open,
                   dummy_read,
                   dummy_write,
                   dummy_close,
                   dummy_seek,
                   cpu80386,
                   &error_structure
           );
           ok(hfdi_386 != NULL,"FDICreate (CPU = cpu80386) failed!\n");
   
           hfdi_286 = FDICreate(
                   debug_alloc,
                   debug_free,
                   dummy_open,
                   dummy_read,
                   dummy_write,
                   dummy_close,
                   dummy_seek,
                   cpu80286,
                   &error_structure
           );
           ok(hfdi_286 != NULL,"FDICreate (CPU = cpu80286) failed!\n");
   
           hfdi_unknown = FDICreate(
                   debug_alloc,
                   debug_free,
                   dummy_open,
                   dummy_read,
                   dummy_write,
                   dummy_close,
                   dummy_seek,
                   cpuUNKNOWN,
                   &error_structure
           );
           ok(hfdi_unknown != NULL,"FDICreate (CPU = unknown) failed!\n");
   
   
   
   
           printf("Ending TestCreate()\n");
   }
  
 START_TEST(paths) START_TEST(paths)
 { {
         /*  
         TestCreate();         TestCreate();
           /*
         TestInfo();         TestInfo();
         TestCopy();         TestCopy();
         TestDestroy();  
         */         */
 }          TestDestroy();
   
   
  
   }


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

Rizwan Kassim
Powered by
ViewCVS 0.9.2