test/test_physfs.c
changeset 132 b53fa5093749
parent 108 90f7ad8a0ab5
child 153 36c89f1228a9
equal deleted inserted replaced
131:69b093825303 132:b53fa5093749
    39 
    39 
    40     printf("test_physfs version %d.%d.%d.\n"
    40     printf("test_physfs version %d.%d.%d.\n"
    41            " Compiled against PhysicsFS version %d.%d.%d,\n"
    41            " Compiled against PhysicsFS version %d.%d.%d,\n"
    42            " and linked against %d.%d.%d.\n\n",
    42            " and linked against %d.%d.%d.\n\n",
    43             TEST_VERSION_MAJOR, TEST_VERSION_MINOR, TEST_VERSION_PATCH,
    43             TEST_VERSION_MAJOR, TEST_VERSION_MINOR, TEST_VERSION_PATCH,
    44             compiled.major, compiled.minor, compiled.patch,
    44             (int) compiled.major, (int) compiled.minor, (int) compiled.patch,
    45             linked.major, linked.minor, linked.patch);
    45             (int) linked.major, (int) linked.minor, (int) linked.patch);
    46 } /* output_versions */
    46 } /* output_versions */
    47 
    47 
    48 
    48 
    49 static void output_archivers(void)
    49 static void output_archivers(void)
    50 {
    50 {
   334     else
   334     else
   335     {
   335     {
   336         while (1)
   336         while (1)
   337         {
   337         {
   338             char buffer[128];
   338             char buffer[128];
   339             int rc;
   339             PHYSFS_sint64 rc;
   340             int i;
   340             PHYSFS_sint64 i;
   341             rc = PHYSFS_read(f, buffer, 1, sizeof (buffer));
   341             rc = PHYSFS_read(f, buffer, 1, sizeof (buffer));
   342 
   342 
   343             for (i = 0; i < rc; i++)
   343             for (i = 0; i < rc; i++)
   344                 fputc((int) buffer[i], stdout);
   344                 fputc((int) buffer[i], stdout);
   345 
   345 
   346             if (rc < sizeof (buffer))
   346             if (rc < sizeof (buffer))
   347             {
   347             {
   348                 printf("\n\n");
   348                 printf("\n\n");
   349                 if (!PHYSFS_eof(f))
   349                 if (!PHYSFS_eof(f))
   350                     printf("\n (Error condition in reading.)\n\n");
   350                 {
       
   351                     printf("\n (Error condition in reading. Reason: [%s])\n\n",
       
   352                            PHYSFS_getLastError());
       
   353                 } /* if */
   351                 PHYSFS_close(f);
   354                 PHYSFS_close(f);
   352                 return(1);
   355                 return(1);
   353             } /* if */
   356             } /* if */
   354         } /* while */
   357         } /* while */
   355     } /* else */
   358     } /* else */