IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 26, 2005, 11:13:36 AM (21 years ago)
Author:
desonia
Message:

changed PS_META* datatypes to more generic PS_DATA* datatypes.

Location:
trunk/psLib/test/types
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/types/tst_psMetadataIO.c

    r4891 r5136  
    1313 *  @author  Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2005-08-27 01:33:41 $
     15 *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2005-09-26 21:13:33 $
    1717 *
    1818 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8888        "","","","A number",""
    8989    };
    90 const psMetadataType testConfig1TypeOverwrite[] =
    91     {
    92         PS_META_F64, PS_META_STR, PS_META_BOOL, PS_META_VEC, PS_META_STR,
    93         PS_META_STR, PS_META_STR, PS_META_STR, PS_META_STR,  PS_META_F64,
    94         PS_META_BOOL, PS_META_VEC, PS_META_VEC, PS_META_VEC, PS_META_VEC,
    95         PS_META_VEC, PS_META_VEC, PS_META_VEC, PS_META_VEC, PS_META_VEC,
    96         PS_META_META, PS_META_META, PS_META_META, PS_META_S32, PS_META_META
     90const psDataType testConfig1TypeOverwrite[] =
     91    {
     92        PS_DATA_F64, PS_DATA_STRING, PS_DATA_BOOL, PS_DATA_VECTOR, PS_DATA_STRING,
     93        PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING,  PS_DATA_F64,
     94        PS_DATA_BOOL, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR,
     95        PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR,
     96        PS_DATA_METADATA, PS_DATA_METADATA, PS_DATA_METADATA, PS_DATA_S32, PS_DATA_METADATA
    9797    };
    9898const psS32 testConfig1ValueS32Overwrite[] =
     
    201201        "EXTNAME","BIASSEC","CHIP"
    202202    };
    203 const psMetadataType testConfig1ValueMetaTypes1[] =
    204     {
    205         PS_META_STR, PS_META_STR, PS_META_STR
     203const psDataType testConfig1ValueMetaTypes1[] =
     204    {
     205        PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING
    206206    };
    207207const char* testConfig1ValueMetaValue1[] =
     
    214214        "EXTNAME","BIASSEC","CHIP"
    215215    };
    216 const psMetadataType testConfig1ValueMetaTypes2[] =
    217     {
    218         PS_META_STR, PS_META_STR, PS_META_STR
     216const psDataType testConfig1ValueMetaTypes2[] =
     217    {
     218        PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING
    219219    };
    220220const char* testConfig1ValueMetaValue2[] =
     
    227227        "EXTNAME","BIASSEC","CHIP","NCELL"
    228228    };
    229 const psMetadataType testConfig1ValueMetaTypes3[] =
    230     {
    231         PS_META_STR, PS_META_STR, PS_META_STR, PS_META_S32
     229const psDataType testConfig1ValueMetaTypes3[] =
     230    {
     231        PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING, PS_DATA_S32
    232232    };
    233233const char* testConfig1ValueMetaValueStr3[] =
     
    383383
    384384    switch(metadataItem->type) {
    385     case PS_META_BOOL:
     385    case PS_DATA_BOOL:
    386386        printf("%s%-25s BOOL  %40d",indentStr,metadataItem->name,metadataItem->data.B);
    387387        break;
    388     case PS_META_S32:
     388    case PS_DATA_S32:
    389389        printf("%s%-25s S32   %40d",indentStr,metadataItem->name,metadataItem->data.S32);
    390390        break;
    391     case PS_META_F32:
     391    case PS_DATA_F32:
    392392        printf("%s%-25s F32   %40f",indentStr,metadataItem->name,metadataItem->data.F32);
    393393        break;
    394     case PS_META_F64:
     394    case PS_DATA_F64:
    395395        printf("%s%-25s F64   %40lf",indentStr,metadataItem->name,metadataItem->data.F64);
    396396        break;
    397     case PS_META_VEC:
     397    case PS_DATA_VECTOR:
    398398        vecStr = (char*)vectorToConfigString((psVector*)metadataItem->data.V);
    399399        printf("%s@%-24s %s",indentStr,metadataItem->name,vecStr);
    400400        psFree(vecStr);
    401401        break;
    402     case PS_META_STR:
     402    case PS_DATA_STRING:
    403403        printf("%s%-25s STR   %40s",indentStr,metadataItem->name,(char*)metadataItem->data.V);
    404404        break;
    405     case PS_META_META:
     405    case PS_DATA_METADATA:
    406406        printf("%s%-25s METADATA\n",indentStr,metadataItem->name);
    407407        char nestedStr[256] = "    ";
     
    545545        // Compare values
    546546        switch(entryChild->type) {
    547         case PS_META_S32:
     547        case PS_DATA_S32:
    548548            if(entryChild->data.S32 != testConfig1ValueS32Overwrite[i]) {
    549549                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %d not as expected %d",
     
    552552            }
    553553            break;
    554         case PS_META_F32:
     554        case PS_DATA_F32:
    555555            if(fabs(entryChild->data.F32 - testConfig1ValueF32Overwrite[i]) > ERROR_TOL) {
    556556                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %f not as expected %f",
     
    559559            }
    560560            break;
    561         case PS_META_F64:
     561        case PS_DATA_F64:
    562562            if(fabs(entryChild->data.F64 - testConfig1ValueF64Overwrite[i]) > ERROR_TOL) {
    563563                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %lf not as expected %lf",
     
    566566            }
    567567            break;
    568         case PS_META_BOOL:
     568        case PS_DATA_BOOL:
    569569            if(entryChild->data.B != testConfig1ValueBoolOverwrite[i]) {
    570570                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %d not as expected %d",
     
    573573            }
    574574            break;
    575         case PS_META_STR:
     575        case PS_DATA_STRING:
    576576            if(strcmp(entryChild->data.V,testConfig1ValueStrOverwrite[i]) != 0) {
    577577                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %s not as expected %s",
     
    580580            }
    581581            break;
    582         case PS_META_VEC:
     582        case PS_DATA_VECTOR:
    583583            // Verify the correct number of entries
    584584            switch(((psVector*)(entryChild->data.V))->type.type) {
     
    809809            }
    810810            break;
    811         case PS_META_META:
     811        case PS_DATA_METADATA:
    812812            if(metaCounter == 0) {
    813813                // Check if number of items is as expected
     
    890890                    }
    891891                    switch(mdChild->type) {
    892                     case PS_META_STR:
     892                    case PS_DATA_STRING:
    893893                        if(strcmp((char*)mdChild->data.V,testConfig1ValueMetaValueStr3[mdCounter]) != 0) {
    894894                            psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 value[%d] %s not as expected %s",
     
    898898                        }
    899899                        break;
    900                     case PS_META_S32:
     900                    case PS_DATA_S32:
    901901                        if(mdChild->data.S32 != testConfig1ValueMetaValueS323[mdCounter]) {
    902902                            psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 value[%d] %d not as expected %d",
  • trunk/psLib/test/types/tst_psMetadata_01.c

    r4590 r5136  
    1818*  @author  Ross Harman, MHPCC
    1919*
    20 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    21 *  @date  $Date: 2005-07-21 02:39:57 $
     20*  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     21*  @date  $Date: 2005-09-26 21:13:33 $
    2222*
    2323*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7575
    7676    switch (metadataItem->type) {
    77     case PS_META_MULTI:
     77    case PS_DATA_METADATA_MULTI:
    7878        printf("Key Value: %17c", ' ');
    7979        break;
    80     case PS_META_BOOL:
     80    case PS_DATA_BOOL:
    8181        printf("Key Value: %15d  ", metadataItem->data.B);
    8282        break;
    83     case PS_META_S32:
     83    case PS_DATA_S32:
    8484        printf("Key Value: %15d  ", metadataItem->data.S32);
    8585        break;
    86     case PS_META_F32:
     86    case PS_DATA_F32:
    8787        printf("Key Value: %15.3f  ", metadataItem->data.F32);
    8888        break;
    89     case PS_META_F64:
     89    case PS_DATA_F64:
    9090        printf("Key Value: %15.3f  ", metadataItem->data.F64);
    9191        break;
    92     case PS_META_STR:
     92    case PS_DATA_STRING:
    9393        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
    9494        break;
     
    9898    printf("Key Comment: %s\n", metadataItem->comment);
    9999
    100     if(metadataItem->data.V && metadataItem->type==PS_META_MULTI) {
     100    if(metadataItem->data.V && metadataItem->type==PS_DATA_METADATA_MULTI) {
    101101        printMetadataList(metadataItem->data.V, "    ");
    102102    }
  • trunk/psLib/test/types/tst_psMetadata_02.c

    r4547 r5136  
    1515 *  @author  Robert DeSonia, MHPCC
    1616 *
    17  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    18  *  @date  $Date: 2005-07-13 02:47:01 $
     17 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     18 *  @date  $Date: 2005-09-26 21:13:33 $
    1919 *
    2020 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3232
    3333    switch (metadataItem->type) {
    34     case PS_META_MULTI:
     34    case PS_DATA_METADATA_MULTI:
    3535        printf("Key Value: %17c", ' ');
    3636        break;
    37     case PS_META_BOOL:
     37    case PS_DATA_BOOL:
    3838        printf("Key Value: %15d  ", metadataItem->data.B);
    3939        break;
    40     case PS_META_S32:
     40    case PS_DATA_S32:
    4141        printf("Key Value: %15d  ", metadataItem->data.S32);
    4242        break;
    43     case PS_META_F32:
     43    case PS_DATA_F32:
    4444        printf("Key Value: %15.3f  ", metadataItem->data.F32);
    4545        break;
    46     case PS_META_F64:
     46    case PS_DATA_F64:
    4747        printf("Key Value: %15.3f  ", metadataItem->data.F64);
    4848        break;
    49     case PS_META_STR:
     49    case PS_DATA_STRING:
    5050        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
    5151        break;
     
    7070    // Test A - Allocate metadata items
    7171    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
    72     item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
    73     item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a signed integer", 111);
    74     item3 = psMetadataItemAlloc("myItem3", PS_META_F32, "I am a single precision floating point", 222.222);
    75     item4 = psMetadataItemAlloc("myItem4", PS_META_F64, "I am a double precision floating point", 333.333);
    76     item5 = psMetadataItemAlloc("myItem5", PS_META_STR, "I am a string", "HELLO WORLD");
     72    item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
     73    item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a signed integer", 111);
     74    item3 = psMetadataItemAlloc("myItem3", PS_DATA_F32, "I am a single precision floating point", 222.222);
     75    item4 = psMetadataItemAlloc("myItem4", PS_DATA_F64, "I am a double precision floating point", 333.333);
     76    item5 = psMetadataItemAlloc("myItem5", PS_DATA_STRING, "I am a string", "HELLO WORLD");
    7777    printMetadataItem(item1);
    7878    printMetadataItem(item2);
     
    8787                            "Null value for name not allowed", 0);
    8888    psLogMsg(__func__,PS_LOG_INFO,"Following should produce error for null name.");
    89     badItem = psMetadataItemAlloc(NULL, PS_META_STR, "I am a string", "HELLO WORLD");
     89    badItem = psMetadataItemAlloc(NULL, PS_DATA_STRING, "I am a string", "HELLO WORLD");
    9090    if (badItem != NULL) {
    9191        psError(PS_ERR_UNKNOWN, true,"psMetadataItemAlloc did not return null with null name item.");
     
    9797    // Test C - Attempt to create metadata item with invalid type
    9898    printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to create metadata item with invalid type",
    99                             "Invalid psMetadataType: 6", 0);
     99                            "Invalid psDataType: 6", 0);
    100100    badItem = psMetadataItemAlloc("badItem", -1, "I am bad", "Bad comment");
    101101    printFooter(stdout, "psMetadata", "Test C - Attempt to create metadata item with invalid type", true);
  • trunk/psLib/test/types/tst_psMetadata_03.c

    r4590 r5136  
    1818*  @author  Ross Harman, MHPCC
    1919*
    20 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    21 *  @date  $Date: 2005-07-21 02:39:57 $
     20*  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     21*  @date  $Date: 2005-09-26 21:13:33 $
    2222*
    2323*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3535
    3636    switch (metadataItem->type) {
    37     case PS_META_MULTI:
     37    case PS_DATA_METADATA_MULTI:
    3838        printf("Key Value: %17c", ' ');
    3939        break;
    40     case PS_META_BOOL:
     40    case PS_DATA_BOOL:
    4141        printf("Key Value: %15d  ", metadataItem->data.B);
    4242        break;
    43     case PS_META_S32:
     43    case PS_DATA_S32:
    4444        printf("Key Value: %15d  ", metadataItem->data.S32);
    4545        break;
    46     case PS_META_F32:
     46    case PS_DATA_F32:
    4747        printf("Key Value: %15.3f  ", metadataItem->data.F32);
    4848        break;
    49     case PS_META_F64:
     49    case PS_DATA_F64:
    5050        printf("Key Value: %15.3f  ", metadataItem->data.F64);
    5151        break;
    52     case PS_META_STR:
     52    case PS_DATA_STRING:
    5353        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
    5454        break;
     
    7676    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
    7777    metadata = psMetadataAlloc();
    78     item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
    79     item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
    80     item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
    81     item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
    82     errItem = psMetadataItemAlloc("errItem", PS_META_S32, "I am a integer", 99);
     78    item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
     79    item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55);
     80    item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false);
     81    item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66);
     82    errItem = psMetadataItemAlloc("errItem", PS_DATA_S32, "I am a integer", 99);
    8383    printMetadataItem(item1);
    8484    printMetadataItem(item2);
     
    9494        return 10;
    9595    }
    96     if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_META_S32, "I am S32 integer",77)) {
     96    if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_DATA_S32, "I am S32 integer",77)) {
    9797        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name.");
    9898        return 11;
     
    115115        return 14;
    116116    }
    117     if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_META_S32, "I am S32 integer",88) ) {
     117    if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_DATA_S32, "I am S32 integer",88) ) {
    118118        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index.");
    119119        return 15;
     
    210210    mdTable = errMetadata->hash;
    211211    errMetadata->hash = NULL;
    212     if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_META_S32, "Integer",22) ) {
     212    if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_DATA_S32, "Integer",22) ) {
    213213        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table.");
    214214        return 24;
  • trunk/psLib/test/types/tst_psMetadata_04.c

    r5057 r5136  
    2525*  @author  Ross Harman, MHPCC
    2626*
    27 *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
    28 *  @date  $Date: 2005-09-15 21:22:22 $
     27*  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
     28*  @date  $Date: 2005-09-26 21:13:33 $
    2929*
    3030*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4242
    4343    switch (metadataItem->type) {
    44     case PS_META_MULTI:
     44    case PS_DATA_METADATA_MULTI:
    4545        printf("Key Value: %17c", ' ');
    4646        break;
    47     case PS_META_BOOL:
     47    case PS_DATA_BOOL:
    4848        printf("Key Value: %15d  ", metadataItem->data.B);
    4949        break;
    50     case PS_META_S32:
     50    case PS_DATA_S32:
    5151        printf("Key Value: %15d  ", metadataItem->data.S32);
    5252        break;
    53     case PS_META_F32:
     53    case PS_DATA_F32:
    5454        printf("Key Value: %15.3f  ", metadataItem->data.F32);
    5555        break;
    56     case PS_META_F64:
     56    case PS_DATA_F64:
    5757        printf("Key Value: %15.3f  ", metadataItem->data.F64);
    5858        break;
    59     case PS_META_STR:
     59    case PS_DATA_STRING:
    6060        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
    6161        break;
     
    9393    strncpy(string, "String was here", 50);
    9494    psMetadataAddF64(newMD, PS_LIST_HEAD, "yourItem1", 0, "I am a psF64", 4.14);
    95     item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
    96     item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
    97     item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
    98     item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
    99     item5 = psMetadataItemAlloc("myItem5", PS_META_F64, "I am a double", 3.14);
    100     item6 = psMetadataItemAlloc("myItem6", PS_META_VEC, "I am a vector", vec);
    101     item7 = psMetadataItemAlloc("myItem7", PS_META_META, "I am a metadata", newMD);
    102     item8 = psMetadataItemAlloc("myItem8", PS_META_STR, "I am a string", string);
     95    item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
     96    item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55);
     97    item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false);
     98    item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66);
     99    item5 = psMetadataItemAlloc("myItem5", PS_DATA_F64, "I am a double", 3.14);
     100    item6 = psMetadataItemAlloc("myItem6", PS_DATA_VECTOR, "I am a vector", vec);
     101    item7 = psMetadataItemAlloc("myItem7", PS_DATA_METADATA, "I am a metadata", newMD);
     102    item8 = psMetadataItemAlloc("myItem8", PS_DATA_STRING, "I am a string", string);
    103103    printMetadataItem(item1);
    104104    printMetadataItem(item2);
  • trunk/psLib/test/types/tst_psMetadata_05.c

    r4547 r5136  
    2222*  @author  Ross Harman, MHPCC
    2323*
    24 *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    25 *  @date  $Date: 2005-07-13 02:47:01 $
     24*  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     25*  @date  $Date: 2005-09-26 21:13:33 $
    2626*
    2727*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3939
    4040    switch (metadataItem->type) {
    41     case PS_META_MULTI:
     41    case PS_DATA_METADATA_MULTI:
    4242        printf("Key Value: %17c", ' ');
    4343        break;
    44     case PS_META_BOOL:
     44    case PS_DATA_BOOL:
    4545        printf("Key Value: %15d  ", metadataItem->data.B);
    4646        break;
    47     case PS_META_S32:
     47    case PS_DATA_S32:
    4848        printf("Key Value: %15d  ", metadataItem->data.S32);
    4949        break;
    50     case PS_META_F32:
     50    case PS_DATA_F32:
    5151        printf("Key Value: %15.3f  ", metadataItem->data.F32);
    5252        break;
    53     case PS_META_F64:
     53    case PS_DATA_F64:
    5454        printf("Key Value: %15.3f  ", metadataItem->data.F64);
    5555        break;
    56     case PS_META_STR:
     56    case PS_DATA_STRING:
    5757        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
    5858        break;
     
    8080    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
    8181    metadata = psMetadataAlloc();
    82     item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
    83     item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
    84     item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
    85     item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
    86     item5 = psMetadataItemAlloc("myItem5", PS_META_F32, "I am a float", 3.14);
    87     item6 = psMetadataItemAlloc("myItem6", PS_META_F64,"I am a double", 6.28);
    88     item7 = psMetadataItemAlloc("myItem7", PS_META_STR, "I am a string", "GNIRTS");
     82    item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
     83    item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55);
     84    item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false);
     85    item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66);
     86    item5 = psMetadataItemAlloc("myItem5", PS_DATA_F32, "I am a float", 3.14);
     87    item6 = psMetadataItemAlloc("myItem6", PS_DATA_F64,"I am a double", 6.28);
     88    item7 = psMetadataItemAlloc("myItem7", PS_DATA_STRING, "I am a string", "GNIRTS");
    8989    //    item8 = psMetadataItemAlloc("myItem8", PS_TYPE_PTR, PS_META_UNKNOWN, "I am unknown");
    9090    printMetadataItem(item1);
  • trunk/psLib/test/types/tst_psMetadata_06.c

    r4547 r5136  
    1313*  @author  Ross Harman, MHPCC
    1414*
    15 *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    16 *  @date  $Date: 2005-07-13 02:47:01 $
     15*  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     16*  @date  $Date: 2005-09-26 21:13:33 $
    1717*
    1818*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3030
    3131    switch (metadataItem->type) {
    32     case PS_META_MULTI:
     32    case PS_DATA_METADATA_MULTI:
    3333        printf("Key Value: %17c", ' ');
    3434        break;
    35     case PS_META_LIST:
     35    case PS_DATA_LIST:
    3636        printf("Key Value: %15s  ", "psList");
    3737        break;
    38     case PS_META_BOOL:
     38    case PS_DATA_BOOL:
    3939        printf("Key Value: %15d  ", metadataItem->data.B);
    4040        break;
    41     case PS_META_S32:
     41    case PS_DATA_S32:
    4242        printf("Key Value: %15d  ", metadataItem->data.S32);
    4343        break;
    44     case PS_META_F32:
     44    case PS_DATA_F32:
    4545        printf("Key Value: %15.3f  ", metadataItem->data.F32);
    4646        break;
    47     case PS_META_F64:
     47    case PS_DATA_F64:
    4848        printf("Key Value: %15.3f  ", metadataItem->data.F64);
    4949        break;
    50     case PS_META_STR:
     50    case PS_DATA_STRING:
    5151        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
    5252        break;
     
    7070    // Test A - Allocate metadata and items
    7171    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata and items");
    72     item1a = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
    73     item1b = psMetadataItemAlloc("myItem1", PS_META_S32, "I am a signed integer", 111);
    74     item1c = psMetadataItemAlloc("myItem1", PS_META_S32, "I am a signed integer", 222);
    75     item2a = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a signed integer", 333);
    76     item2b = psMetadataItemAlloc("myItem2", PS_META_LIST, "I am a list", NULL);
     72    item1a = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
     73    item1b = psMetadataItemAlloc("myItem1", PS_DATA_S32, "I am a signed integer", 111);
     74    item1c = psMetadataItemAlloc("myItem1", PS_DATA_S32, "I am a signed integer", 222);
     75    item2a = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a signed integer", 333);
     76    item2b = psMetadataItemAlloc("myItem2", PS_DATA_LIST, "I am a list", NULL);
    7777    metadata = psMetadataAlloc();
    7878    printMetadataItem(item1a);
     
    118118
    119119    tempItem = psMetadataLookup(metadata, item1a->name);
    120     if (tempItem == NULL || tempItem->type != PS_META_MULTI) {
     120    if (tempItem == NULL || tempItem->type != PS_DATA_METADATA_MULTI) {
    121121        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add additional metadata entry of same key.");
    122122        return 22;
     
    137137    printFooter(stdout, "psMetadata", "Test D - Add folder node on top of existing leaf node", true);
    138138    tempItem = psMetadataLookup(metadata, item1a->name);
    139     if (tempItem == NULL || tempItem->type != PS_META_MULTI) {
     139    if (tempItem == NULL || tempItem->type != PS_DATA_METADATA_MULTI) {
    140140        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add additional metadata entry of same key.");
    141141        return 24;
  • trunk/psLib/test/types/verified/tst_psMetadata_01.stdout

    r4547 r5136  
    99 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:               8  Key Comment: number of bits per data pixel
    1010 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               0  Key Comment: number of data axes
    11  Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     11 Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    1212
    1313Contents of metadata table:
     
    1515 Key Name:   SIMPLE  Key mdType: 0x00001301  Key Value:               1  Key Comment: file does conform to FITS standard
    1616 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:               8  Key Comment: number of bits per data pixel
    17  Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     17 Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    1818
    1919---> TESTPOINT PASSED (psMetadata{Test A - Read 1st hdr from simple FITS file} | tst_psMetadata_01.c)
     
    2626
    2727Contents of metadata list:
    28  Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     28 Key Name: XTENSION  Key mdType: 0x00010000  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    2929 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
    3030 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     
    3333 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
    3434 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
    35  Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_1'  Key Comment:
    36  Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    37  Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    38  Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    39  Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     35 Key Name:  EXTNAME  Key mdType: 0x00010000  Key Value:     'MY_DATA_1'  Key Comment:
     36 Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     37 Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     38 Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     39 Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    4040
    4141Contents of metadata table:
     
    4343 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
    4444 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
    45  Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    46  Key Name:   BITPIX  Key mdType: 0x0001000a  Key Value:                  Key Comment:
     45 Key Name: XTENSION  Key mdType: 0x00010000  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     46 Key Name:   BITPIX  Key mdType: 0x00010023  Key Value:                  Key Comment:
    4747    Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
    4848    Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
    4949 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
    50  Key Name:  HISTORY  Key mdType: 0x0001000a  Key Value:                  Key Comment:
    51     Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    52     Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    53     Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    54     Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    55  Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_1'  Key Comment:
     50 Key Name:  HISTORY  Key mdType: 0x00010023  Key Value:                  Key Comment:
     51    Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     52    Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     53    Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     54    Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     55 Key Name:  EXTNAME  Key mdType: 0x00010000  Key Value:     'MY_DATA_1'  Key Comment:
    5656
    5757---> TESTPOINT PASSED (psMetadata{Test B - Read 2nd hdr from complex FITS file} | tst_psMetadata_01.c)
     
    6464
    6565Contents of metadata list:
    66  Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     66 Key Name: XTENSION  Key mdType: 0x00010000  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    6767 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
    6868 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     
    7070 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
    7171 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
    72  Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_2'  Key Comment:
    73  Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    74  Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     72 Key Name:  EXTNAME  Key mdType: 0x00010000  Key Value:     'MY_DATA_2'  Key Comment:
     73 Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     74 Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    7575
    7676Contents of metadata table:
     
    7878 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
    7979 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
    80  Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     80 Key Name: XTENSION  Key mdType: 0x00010000  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    8181 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
    8282 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
    83  Key Name:  HISTORY  Key mdType: 0x0001000a  Key Value:                  Key Comment:
    84     Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    85     Key Name:  HISTORY  Key mdType: 0x00010001  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
    86  Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_2'  Key Comment:
     83 Key Name:  HISTORY  Key mdType: 0x00010023  Key Value:                  Key Comment:
     84    Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     85    Key Name:  HISTORY  Key mdType: 0x00010000  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
     86 Key Name:  EXTNAME  Key mdType: 0x00010000  Key Value:     'MY_DATA_2'  Key Comment:
    8787
    8888---> TESTPOINT PASSED (psMetadata{Test C - Read named hdr from complex FITS file} | tst_psMetadata_01.c)
     
    9797
    9898Contents of metadata list:
    99  Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     99 Key Name: XTENSION  Key mdType: 0x00010000  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    100100 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
    101101 Key Name:    NAXIS  Key mdType: 0x00000104  Key Value:               1  Key Comment: number of data axes
     
    103103 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
    104104 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
    105  Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_2'  Key Comment:
     105 Key Name:  EXTNAME  Key mdType: 0x00010000  Key Value:     'MY_DATA_2'  Key Comment:
    106106
    107107Contents of metadata table:
     
    109109 Key Name:   NAXIS1  Key mdType: 0x00000104  Key Value:              64  Key Comment: length of data axis 1
    110110 Key Name:   PCOUNT  Key mdType: 0x00000104  Key Value:               0  Key Comment: required keyword; must = 0
    111  Key Name: XTENSION  Key mdType: 0x00010001  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
     111 Key Name: XTENSION  Key mdType: 0x00010000  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
    112112 Key Name:   GCOUNT  Key mdType: 0x00000104  Key Value:               1  Key Comment: required keyword; must = 1
    113113 Key Name:   BITPIX  Key mdType: 0x00000104  Key Value:             -64  Key Comment: number of bits per data pixel
    114  Key Name:  EXTNAME  Key mdType: 0x00010001  Key Value:     'MY_DATA_2'  Key Comment:
     114 Key Name:  EXTNAME  Key mdType: 0x00010000  Key Value:     'MY_DATA_2'  Key Comment:
    115115
    116116---> TESTPOINT PASSED (psMetadata{Test D - Remove items with same name from all metadata} | tst_psMetadata_01.c)
  • trunk/psLib/test/types/verified/tst_psMetadata_02.stdout

    r4547 r5136  
    99Key Name:  myItem3  Key mdType: 0x00000404  Key Value:         222.222  Key Comment: I am a single precision floating point
    1010Key Name:  myItem4  Key mdType: 0x00000408  Key Value:         333.333  Key Comment: I am a double precision floating point
    11 Key Name:  myItem5  Key mdType: 0x00010001  Key Value:     HELLO WORLD  Key Comment: I am a string
     11Key Name:  myItem5  Key mdType: 0x00010000  Key Value:     HELLO WORLD  Key Comment: I am a string
    1212
    1313---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_02.c)
     
    2828*            TestPoint: psMetadata{Test C - Attempt to create metadata item with invalid type} *
    2929*             TestType: Negative                                                   *
    30 *    ExpectedErrorText: Invalid psMetadataType: 6                                  *
     30*    ExpectedErrorText: Invalid psDataType: 6                                      *
    3131*  ExpectedStatusValue: 0                                                          *
    3232\**********************************************************************************/
  • trunk/psLib/test/types/verified/tst_psMetadata_06.stdout

    r4547 r5136  
    99Key Name:  myItem1  Key mdType: 0x00000104  Key Value:             222  Key Comment: I am a signed integer
    1010Key Name:  myItem2  Key mdType: 0x00000104  Key Value:             333  Key Comment: I am a signed integer
    11 Key Name:  myItem2  Key mdType: 0x00010000  Key Value:          psList  Key Comment: I am a list
     11Key Name:  myItem2  Key mdType: 0x0001000b  Key Value:          psList  Key Comment: I am a list
    1212
    1313---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata and items} | tst_psMetadata_06.c)
Note: See TracChangeset for help on using the changeset viewer.