IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3445


Ignore:
Timestamp:
Mar 17, 2005, 9:44:44 AM (21 years ago)
Author:
desonia
Message:

updated test to force psMetadataItemPrint to cast float<->int before printing.

Location:
trunk/psLib/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astronomy/tst_psMetadata_05.c

    r3407 r3445  
    2222*  @author  Ross Harman, MHPCC
    2323*
    24 *  @version $Revision: 1.22 $  $Name: not supported by cvs2svn $
    25 *  @date  $Date: 2005-03-11 20:38:56 $
     24*  @version $Revision: 1.23 $  $Name: not supported by cvs2svn $
     25*  @date  $Date: 2005-03-17 19:44:44 $
    2626*
    2727*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    164164    }
    165165
     166    if (psMetadataItemPrint(fd, "S32 = %+06.1f\n", item2) == false) {
     167        printf("ERROR: Return type should be true\n");
     168        return 10;
     169    }
     170
    166171    if (psMetadataItemPrint(fd, "BOL = %ld\n", item3) == false) {
    167172        printf("ERROR: Return type should be true\n");
     
    170175
    171176    if (psMetadataItemPrint(fd, "F32 = %g\n", item5) == false) {
     177        printf("ERROR: Return type should be true\n");
     178        return 12;
     179    }
     180
     181    if (psMetadataItemPrint(fd, "F32 = % #i\n", item5) == false) {
    172182        printf("ERROR: Return type should be true\n");
    173183        return 12;
     
    203213    }
    204214
     215    char truth1b[] = "S32 = +055.0";
     216    fgets(line, 256, fd);
     217    if(strncmp(line, truth1b, 12)) {
     218        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth1b);
     219    }
     220
    205221    char truth2[] = "BOL = 0";
    206222    fgets(line, 256, fd);
     
    213229    if(strncmp(line, truth3, 10)) {
    214230        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth3);
     231    }
     232
     233    char truth3b[] = "F32 =  3";
     234    fgets(line, 256, fd);
     235    if(strncmp(line, truth3b, 8)) {
     236        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth3b);
    215237    }
    216238
  • trunk/psLib/test/collections/tst_psMetadata_05.c

    r3407 r3445  
    2222*  @author  Ross Harman, MHPCC
    2323*
    24 *  @version $Revision: 1.22 $  $Name: not supported by cvs2svn $
    25 *  @date  $Date: 2005-03-11 20:38:56 $
     24*  @version $Revision: 1.23 $  $Name: not supported by cvs2svn $
     25*  @date  $Date: 2005-03-17 19:44:44 $
    2626*
    2727*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    164164    }
    165165
     166    if (psMetadataItemPrint(fd, "S32 = %+06.1f\n", item2) == false) {
     167        printf("ERROR: Return type should be true\n");
     168        return 10;
     169    }
     170
    166171    if (psMetadataItemPrint(fd, "BOL = %ld\n", item3) == false) {
    167172        printf("ERROR: Return type should be true\n");
     
    170175
    171176    if (psMetadataItemPrint(fd, "F32 = %g\n", item5) == false) {
     177        printf("ERROR: Return type should be true\n");
     178        return 12;
     179    }
     180
     181    if (psMetadataItemPrint(fd, "F32 = % #i\n", item5) == false) {
    172182        printf("ERROR: Return type should be true\n");
    173183        return 12;
     
    203213    }
    204214
     215    char truth1b[] = "S32 = +055.0";
     216    fgets(line, 256, fd);
     217    if(strncmp(line, truth1b, 12)) {
     218        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth1b);
     219    }
     220
    205221    char truth2[] = "BOL = 0";
    206222    fgets(line, 256, fd);
     
    213229    if(strncmp(line, truth3, 10)) {
    214230        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth3);
     231    }
     232
     233    char truth3b[] = "F32 =  3";
     234    fgets(line, 256, fd);
     235    if(strncmp(line, truth3b, 8)) {
     236        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth3b);
    215237    }
    216238
Note: See TracChangeset for help on using the changeset viewer.