(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 2.7 and 2.10

version 2.7, 2005/02/26 04:24:51 version 2.10, 2005/02/27 08:31:36
Line 102 
Line 102 
         return 0;         return 0;
 } }
  
 FNFDINOTIFY(dummy_notification){  
         printf("   FNFDINOTIFY just called with %d, %d \n",fdint,pfdin);  
         return 0;  
 }  
  
   /*Possible non trivial addition:
   Notify receives some information about the cab file(see FDI documentation).
   Since this info is different depending on the value of fdint, and Notify should
   be generic, it is not simple or nice to check this information.
   */
 FNFDINOTIFY(notification_function) FNFDINOTIFY(notification_function)
 { {
         printf("   FNFDINOTIFY real just called with %d, %d \n",fdint,pfdin);  
         switch (fdint)         switch (fdint)
         {         {
                 case fdintCABINET_INFO:                 case fdintCABINET_INFO:
                 {                 {
                         printf("fdintCABINET_INFO\n");  
                         return 0;                         return 0;
                 }                 }
                 case fdintPARTIAL_FILE:                 case fdintPARTIAL_FILE:
                 {                 {
                         printf("dintPARTIAL_FILE\n");  
                         return 0;                         return 0;
                 }                 }
                 case fdintCOPY_FILE:                 case fdintCOPY_FILE:
                 {                 {
                         int fih = 0;                         int fih = 0;
                         char target[256];                         char target[256];
   
                         printf("fdintCOPY_FILE\n");  
                         printf("  file name: %s\n",     pfdin->psz1);  
                         sprintf(target, "./%s",pfdin->psz1);                         sprintf(target, "./%s",pfdin->psz1);
                         printf("%s\n",target);  
 #ifdef TVFS  
                                 fih = tvfs_open (target,                                 fih = tvfs_open (target,
                                         _O_BINARY | _O_CREAT | _O_WRONLY | _O_SEQUENTIAL,                                         _O_BINARY | _O_CREAT | _O_WRONLY | _O_SEQUENTIAL,
                                         _S_IREAD | _S_IWRITE                                         _S_IREAD | _S_IWRITE
                                                                 );                                                                 );
                         return fih;                         return fih;
 #else  
                                 fih = real_open (target,  
                                         _O_BINARY | _O_CREAT | _O_WRONLY | _O_SEQUENTIAL,  
                                         _S_IREAD | _S_IWRITE  
                                                                 );  
                         return fih;  
 #endif  
                 }                 }
                 case fdintCLOSE_FILE_INFO:                 case fdintCLOSE_FILE_INFO:
                 {                 {
                         char filebuf[256];                         char filebuf[256];
                         int result;                         int result;
  
   /*
         printf("Testing direct file compare and lseek of %s\n", name_simple_txt);         printf("Testing direct file compare and lseek of %s\n", name_simple_txt);
         printf("Reading and comparing file\n");         printf("Reading and comparing file\n");
         result = tvfs_read(7, filebuf, size_simple_txt);         result = tvfs_read(7, filebuf, size_simple_txt);
         result = tvfs_compare( filebuf , file_simple_txt, size_simple_txt);         result = tvfs_compare( filebuf , file_simple_txt, size_simple_txt);
         if (result)  
                 printf ("File compare failed!\n");  
  
                         return 0;  */
                           tvfs_close(pfdin->hf);
                           return TRUE;
                 }                 }
                 case fdintNEXT_CABINET:                 case fdintNEXT_CABINET:
                 {                 {
   
                         printf("fdintNEXT_CABINET\n");  
                         return 0;                         return 0;
                 }                 }
                 case fdintENUMERATE:                 case fdintENUMERATE:
                 {                 {
                                 printf("fdintENUMERATE\n");  
                                 return 0;                                 return 0;
                 }                 }
         }         }
Line 313 
Line 296 
                 CheckCabInfo("complex.cab",fdi_cabinfo_complex,12918,1,2,0,0,0,0,0);                 CheckCabInfo("complex.cab",fdi_cabinfo_complex,12918,1,2,0,0,0,0,0);
  
         tvfs_close(fd);         tvfs_close(fd);
           tvfs_free();
  
         printf("Ending TestInfo()\n");         printf("Ending TestInfo()\n");
 #endif #endif
 } }
  
 static void TestCopy(void){ static void TestCopy(void){
   
           char name_file_path[256];
           int result;
   
         printf("Starting TestCopy()\n");         printf("Starting TestCopy()\n");
         printf("---simple.cab\n");         printf("---simple.cab\n");
   #ifdef TVFS
           tvfs_create( name_simple_cab, file_simple_cab, size_simple_cab);
   #endif
           FDICopy(hfdi_unknown_tvfs,
                           "simple.cab",
                           "",
                           0,
                           notification_function,
                           NULL,
                           NULL);
   
   #ifdef TVFS
           /* Filename when extracted is ./<filename> */
           sprintf(name_file_path, "./%s", name_simple_txt);
           result = tvfs_compare(name_file_path, file_simple_txt, size_simple_txt);
           if (result)
                   printf ("File compare failed!\n");
           tvfs_free();
   #endif
   
   
           printf("---complex.cab\n");
   #ifdef TVFS
           tvfs_create( name_complex_cab, file_complex_cab, size_complex_cab);
   #endif
         FDICopy(hfdi_unknown_tvfs,         FDICopy(hfdi_unknown_tvfs,
                         "complex.cab",                         "complex.cab",
                         "",                         "",
Line 329 
Line 342 
                         NULL,                         NULL,
                         NULL);                         NULL);
  
   #ifdef TVFS
           /* Filename when extracted is ./<filename> */
           sprintf(name_file_path, "./%s", name_README);
           result = tvfs_compare(name_file_path, file_README, size_README);
           if (result)
                   printf ("File compare failed!\n");
           tvfs_free();
   #endif
   
   
   
         printf("Ending TestCopy()\n");         printf("Ending TestCopy()\n");
 } }
  


Legend:
Removed from v.2.7  
changed lines
  Added in v.2.10

Rizwan Kassim
Powered by
ViewCVS 0.9.2