Changeset 5136 for trunk/psLib/test/types
- Timestamp:
- Sep 26, 2005, 11:13:36 AM (21 years ago)
- Location:
- trunk/psLib/test/types
- Files:
-
- 10 edited
-
tst_psMetadataIO.c (modified) (15 diffs)
-
tst_psMetadata_01.c (modified) (3 diffs)
-
tst_psMetadata_02.c (modified) (5 diffs)
-
tst_psMetadata_03.c (modified) (6 diffs)
-
tst_psMetadata_04.c (modified) (3 diffs)
-
tst_psMetadata_05.c (modified) (3 diffs)
-
tst_psMetadata_06.c (modified) (5 diffs)
-
verified/tst_psMetadata_01.stdout (modified) (11 diffs)
-
verified/tst_psMetadata_02.stdout (modified) (2 diffs)
-
verified/tst_psMetadata_06.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/types/tst_psMetadataIO.c
r4891 r5136 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-0 8-27 01:33:41$15 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-09-26 21:13:33 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 88 88 "","","","A number","" 89 89 }; 90 const ps MetadataType 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_META90 const 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 97 97 }; 98 98 const psS32 testConfig1ValueS32Overwrite[] = … … 201 201 "EXTNAME","BIASSEC","CHIP" 202 202 }; 203 const ps MetadataType testConfig1ValueMetaTypes1[] =204 { 205 PS_ META_STR, PS_META_STR, PS_META_STR203 const psDataType testConfig1ValueMetaTypes1[] = 204 { 205 PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING 206 206 }; 207 207 const char* testConfig1ValueMetaValue1[] = … … 214 214 "EXTNAME","BIASSEC","CHIP" 215 215 }; 216 const ps MetadataType testConfig1ValueMetaTypes2[] =217 { 218 PS_ META_STR, PS_META_STR, PS_META_STR216 const psDataType testConfig1ValueMetaTypes2[] = 217 { 218 PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING 219 219 }; 220 220 const char* testConfig1ValueMetaValue2[] = … … 227 227 "EXTNAME","BIASSEC","CHIP","NCELL" 228 228 }; 229 const ps MetadataType testConfig1ValueMetaTypes3[] =230 { 231 PS_ META_STR, PS_META_STR, PS_META_STR, PS_META_S32229 const psDataType testConfig1ValueMetaTypes3[] = 230 { 231 PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING, PS_DATA_S32 232 232 }; 233 233 const char* testConfig1ValueMetaValueStr3[] = … … 383 383 384 384 switch(metadataItem->type) { 385 case PS_ META_BOOL:385 case PS_DATA_BOOL: 386 386 printf("%s%-25s BOOL %40d",indentStr,metadataItem->name,metadataItem->data.B); 387 387 break; 388 case PS_ META_S32:388 case PS_DATA_S32: 389 389 printf("%s%-25s S32 %40d",indentStr,metadataItem->name,metadataItem->data.S32); 390 390 break; 391 case PS_ META_F32:391 case PS_DATA_F32: 392 392 printf("%s%-25s F32 %40f",indentStr,metadataItem->name,metadataItem->data.F32); 393 393 break; 394 case PS_ META_F64:394 case PS_DATA_F64: 395 395 printf("%s%-25s F64 %40lf",indentStr,metadataItem->name,metadataItem->data.F64); 396 396 break; 397 case PS_ META_VEC:397 case PS_DATA_VECTOR: 398 398 vecStr = (char*)vectorToConfigString((psVector*)metadataItem->data.V); 399 399 printf("%s@%-24s %s",indentStr,metadataItem->name,vecStr); 400 400 psFree(vecStr); 401 401 break; 402 case PS_ META_STR:402 case PS_DATA_STRING: 403 403 printf("%s%-25s STR %40s",indentStr,metadataItem->name,(char*)metadataItem->data.V); 404 404 break; 405 case PS_ META_META:405 case PS_DATA_METADATA: 406 406 printf("%s%-25s METADATA\n",indentStr,metadataItem->name); 407 407 char nestedStr[256] = " "; … … 545 545 // Compare values 546 546 switch(entryChild->type) { 547 case PS_ META_S32:547 case PS_DATA_S32: 548 548 if(entryChild->data.S32 != testConfig1ValueS32Overwrite[i]) { 549 549 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %d not as expected %d", … … 552 552 } 553 553 break; 554 case PS_ META_F32:554 case PS_DATA_F32: 555 555 if(fabs(entryChild->data.F32 - testConfig1ValueF32Overwrite[i]) > ERROR_TOL) { 556 556 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %f not as expected %f", … … 559 559 } 560 560 break; 561 case PS_ META_F64:561 case PS_DATA_F64: 562 562 if(fabs(entryChild->data.F64 - testConfig1ValueF64Overwrite[i]) > ERROR_TOL) { 563 563 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %lf not as expected %lf", … … 566 566 } 567 567 break; 568 case PS_ META_BOOL:568 case PS_DATA_BOOL: 569 569 if(entryChild->data.B != testConfig1ValueBoolOverwrite[i]) { 570 570 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %d not as expected %d", … … 573 573 } 574 574 break; 575 case PS_ META_STR:575 case PS_DATA_STRING: 576 576 if(strcmp(entryChild->data.V,testConfig1ValueStrOverwrite[i]) != 0) { 577 577 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %s not as expected %s", … … 580 580 } 581 581 break; 582 case PS_ META_VEC:582 case PS_DATA_VECTOR: 583 583 // Verify the correct number of entries 584 584 switch(((psVector*)(entryChild->data.V))->type.type) { … … 809 809 } 810 810 break; 811 case PS_ META_META:811 case PS_DATA_METADATA: 812 812 if(metaCounter == 0) { 813 813 // Check if number of items is as expected … … 890 890 } 891 891 switch(mdChild->type) { 892 case PS_ META_STR:892 case PS_DATA_STRING: 893 893 if(strcmp((char*)mdChild->data.V,testConfig1ValueMetaValueStr3[mdCounter]) != 0) { 894 894 psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 value[%d] %s not as expected %s", … … 898 898 } 899 899 break; 900 case PS_ META_S32:900 case PS_DATA_S32: 901 901 if(mdChild->data.S32 != testConfig1ValueMetaValueS323[mdCounter]) { 902 902 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 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $21 * @date $Date: 2005-0 7-21 02:39:57$20 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-09-26 21:13:33 $ 22 22 * 23 23 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 75 75 76 76 switch (metadataItem->type) { 77 case PS_ META_MULTI:77 case PS_DATA_METADATA_MULTI: 78 78 printf("Key Value: %17c", ' '); 79 79 break; 80 case PS_ META_BOOL:80 case PS_DATA_BOOL: 81 81 printf("Key Value: %15d ", metadataItem->data.B); 82 82 break; 83 case PS_ META_S32:83 case PS_DATA_S32: 84 84 printf("Key Value: %15d ", metadataItem->data.S32); 85 85 break; 86 case PS_ META_F32:86 case PS_DATA_F32: 87 87 printf("Key Value: %15.3f ", metadataItem->data.F32); 88 88 break; 89 case PS_ META_F64:89 case PS_DATA_F64: 90 90 printf("Key Value: %15.3f ", metadataItem->data.F64); 91 91 break; 92 case PS_ META_STR:92 case PS_DATA_STRING: 93 93 printf("Key Value: %15s ", (char*)metadataItem->data.V); 94 94 break; … … 98 98 printf("Key Comment: %s\n", metadataItem->comment); 99 99 100 if(metadataItem->data.V && metadataItem->type==PS_ META_MULTI) {100 if(metadataItem->data.V && metadataItem->type==PS_DATA_METADATA_MULTI) { 101 101 printMetadataList(metadataItem->data.V, " "); 102 102 } -
trunk/psLib/test/types/tst_psMetadata_02.c
r4547 r5136 15 15 * @author Robert DeSonia, MHPCC 16 16 * 17 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $18 * @date $Date: 2005-0 7-13 02:47:01$17 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2005-09-26 21:13:33 $ 19 19 * 20 20 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 33 33 switch (metadataItem->type) { 34 case PS_ META_MULTI:34 case PS_DATA_METADATA_MULTI: 35 35 printf("Key Value: %17c", ' '); 36 36 break; 37 case PS_ META_BOOL:37 case PS_DATA_BOOL: 38 38 printf("Key Value: %15d ", metadataItem->data.B); 39 39 break; 40 case PS_ META_S32:40 case PS_DATA_S32: 41 41 printf("Key Value: %15d ", metadataItem->data.S32); 42 42 break; 43 case PS_ META_F32:43 case PS_DATA_F32: 44 44 printf("Key Value: %15.3f ", metadataItem->data.F32); 45 45 break; 46 case PS_ META_F64:46 case PS_DATA_F64: 47 47 printf("Key Value: %15.3f ", metadataItem->data.F64); 48 48 break; 49 case PS_ META_STR:49 case PS_DATA_STRING: 50 50 printf("Key Value: %15s ", (char*)metadataItem->data.V); 51 51 break; … … 70 70 // Test A - Allocate metadata items 71 71 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"); 77 77 printMetadataItem(item1); 78 78 printMetadataItem(item2); … … 87 87 "Null value for name not allowed", 0); 88 88 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"); 90 90 if (badItem != NULL) { 91 91 psError(PS_ERR_UNKNOWN, true,"psMetadataItemAlloc did not return null with null name item."); … … 97 97 // Test C - Attempt to create metadata item with invalid type 98 98 printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to create metadata item with invalid type", 99 "Invalid ps MetadataType: 6", 0);99 "Invalid psDataType: 6", 0); 100 100 badItem = psMetadataItemAlloc("badItem", -1, "I am bad", "Bad comment"); 101 101 printFooter(stdout, "psMetadata", "Test C - Attempt to create metadata item with invalid type", true); -
trunk/psLib/test/types/tst_psMetadata_03.c
r4590 r5136 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $21 * @date $Date: 2005-0 7-21 02:39:57$20 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-09-26 21:13:33 $ 22 22 * 23 23 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 35 35 36 36 switch (metadataItem->type) { 37 case PS_ META_MULTI:37 case PS_DATA_METADATA_MULTI: 38 38 printf("Key Value: %17c", ' '); 39 39 break; 40 case PS_ META_BOOL:40 case PS_DATA_BOOL: 41 41 printf("Key Value: %15d ", metadataItem->data.B); 42 42 break; 43 case PS_ META_S32:43 case PS_DATA_S32: 44 44 printf("Key Value: %15d ", metadataItem->data.S32); 45 45 break; 46 case PS_ META_F32:46 case PS_DATA_F32: 47 47 printf("Key Value: %15.3f ", metadataItem->data.F32); 48 48 break; 49 case PS_ META_F64:49 case PS_DATA_F64: 50 50 printf("Key Value: %15.3f ", metadataItem->data.F64); 51 51 break; 52 case PS_ META_STR:52 case PS_DATA_STRING: 53 53 printf("Key Value: %15s ", (char*)metadataItem->data.V); 54 54 break; … … 76 76 printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items"); 77 77 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); 83 83 printMetadataItem(item1); 84 84 printMetadataItem(item2); … … 94 94 return 10; 95 95 } 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)) { 97 97 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name."); 98 98 return 11; … … 115 115 return 14; 116 116 } 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) ) { 118 118 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index."); 119 119 return 15; … … 210 210 mdTable = errMetadata->hash; 211 211 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) ) { 213 213 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table."); 214 214 return 24; -
trunk/psLib/test/types/tst_psMetadata_04.c
r5057 r5136 25 25 * @author Ross Harman, MHPCC 26 26 * 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 $ 29 29 * 30 30 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 42 42 43 43 switch (metadataItem->type) { 44 case PS_ META_MULTI:44 case PS_DATA_METADATA_MULTI: 45 45 printf("Key Value: %17c", ' '); 46 46 break; 47 case PS_ META_BOOL:47 case PS_DATA_BOOL: 48 48 printf("Key Value: %15d ", metadataItem->data.B); 49 49 break; 50 case PS_ META_S32:50 case PS_DATA_S32: 51 51 printf("Key Value: %15d ", metadataItem->data.S32); 52 52 break; 53 case PS_ META_F32:53 case PS_DATA_F32: 54 54 printf("Key Value: %15.3f ", metadataItem->data.F32); 55 55 break; 56 case PS_ META_F64:56 case PS_DATA_F64: 57 57 printf("Key Value: %15.3f ", metadataItem->data.F64); 58 58 break; 59 case PS_ META_STR:59 case PS_DATA_STRING: 60 60 printf("Key Value: %15s ", (char*)metadataItem->data.V); 61 61 break; … … 93 93 strncpy(string, "String was here", 50); 94 94 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); 103 103 printMetadataItem(item1); 104 104 printMetadataItem(item2); -
trunk/psLib/test/types/tst_psMetadata_05.c
r4547 r5136 22 22 * @author Ross Harman, MHPCC 23 23 * 24 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $25 * @date $Date: 2005-0 7-13 02:47:01$24 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2005-09-26 21:13:33 $ 26 26 * 27 27 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 39 39 40 40 switch (metadataItem->type) { 41 case PS_ META_MULTI:41 case PS_DATA_METADATA_MULTI: 42 42 printf("Key Value: %17c", ' '); 43 43 break; 44 case PS_ META_BOOL:44 case PS_DATA_BOOL: 45 45 printf("Key Value: %15d ", metadataItem->data.B); 46 46 break; 47 case PS_ META_S32:47 case PS_DATA_S32: 48 48 printf("Key Value: %15d ", metadataItem->data.S32); 49 49 break; 50 case PS_ META_F32:50 case PS_DATA_F32: 51 51 printf("Key Value: %15.3f ", metadataItem->data.F32); 52 52 break; 53 case PS_ META_F64:53 case PS_DATA_F64: 54 54 printf("Key Value: %15.3f ", metadataItem->data.F64); 55 55 break; 56 case PS_ META_STR:56 case PS_DATA_STRING: 57 57 printf("Key Value: %15s ", (char*)metadataItem->data.V); 58 58 break; … … 80 80 printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items"); 81 81 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"); 89 89 // item8 = psMetadataItemAlloc("myItem8", PS_TYPE_PTR, PS_META_UNKNOWN, "I am unknown"); 90 90 printMetadataItem(item1); -
trunk/psLib/test/types/tst_psMetadata_06.c
r4547 r5136 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-0 7-13 02:47:01$15 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-09-26 21:13:33 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 30 30 31 31 switch (metadataItem->type) { 32 case PS_ META_MULTI:32 case PS_DATA_METADATA_MULTI: 33 33 printf("Key Value: %17c", ' '); 34 34 break; 35 case PS_ META_LIST:35 case PS_DATA_LIST: 36 36 printf("Key Value: %15s ", "psList"); 37 37 break; 38 case PS_ META_BOOL:38 case PS_DATA_BOOL: 39 39 printf("Key Value: %15d ", metadataItem->data.B); 40 40 break; 41 case PS_ META_S32:41 case PS_DATA_S32: 42 42 printf("Key Value: %15d ", metadataItem->data.S32); 43 43 break; 44 case PS_ META_F32:44 case PS_DATA_F32: 45 45 printf("Key Value: %15.3f ", metadataItem->data.F32); 46 46 break; 47 case PS_ META_F64:47 case PS_DATA_F64: 48 48 printf("Key Value: %15.3f ", metadataItem->data.F64); 49 49 break; 50 case PS_ META_STR:50 case PS_DATA_STRING: 51 51 printf("Key Value: %15s ", (char*)metadataItem->data.V); 52 52 break; … … 70 70 // Test A - Allocate metadata and items 71 71 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); 77 77 metadata = psMetadataAlloc(); 78 78 printMetadataItem(item1a); … … 118 118 119 119 tempItem = psMetadataLookup(metadata, item1a->name); 120 if (tempItem == NULL || tempItem->type != PS_ META_MULTI) {120 if (tempItem == NULL || tempItem->type != PS_DATA_METADATA_MULTI) { 121 121 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add additional metadata entry of same key."); 122 122 return 22; … … 137 137 printFooter(stdout, "psMetadata", "Test D - Add folder node on top of existing leaf node", true); 138 138 tempItem = psMetadataLookup(metadata, item1a->name); 139 if (tempItem == NULL || tempItem->type != PS_ META_MULTI) {139 if (tempItem == NULL || tempItem->type != PS_DATA_METADATA_MULTI) { 140 140 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add additional metadata entry of same key."); 141 141 return 24; -
trunk/psLib/test/types/verified/tst_psMetadata_01.stdout
r4547 r5136 9 9 Key Name: BITPIX Key mdType: 0x00000104 Key Value: 8 Key Comment: number of bits per data pixel 10 10 Key Name: NAXIS Key mdType: 0x00000104 Key Value: 0 Key Comment: number of data axes 11 Key Name: HISTORY Key mdType: 0x0001000 1Key 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> 12 12 13 13 Contents of metadata table: … … 15 15 Key Name: SIMPLE Key mdType: 0x00001301 Key Value: 1 Key Comment: file does conform to FITS standard 16 16 Key Name: BITPIX Key mdType: 0x00000104 Key Value: 8 Key Comment: number of bits per data pixel 17 Key Name: HISTORY Key mdType: 0x0001000 1Key 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> 18 18 19 19 ---> TESTPOINT PASSED (psMetadata{Test A - Read 1st hdr from simple FITS file} | tst_psMetadata_01.c) … … 26 26 27 27 Contents of metadata list: 28 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension28 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 29 29 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 30 30 Key Name: NAXIS Key mdType: 0x00000104 Key Value: 1 Key Comment: number of data axes … … 33 33 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 34 34 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 35 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_1' Key Comment:36 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>37 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>38 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>39 Key Name: HISTORY Key mdType: 0x0001000 1Key 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> 40 40 41 41 Contents of metadata table: … … 43 43 Key Name: NAXIS1 Key mdType: 0x00000104 Key Value: 64 Key Comment: length of data axis 1 44 44 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 45 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension46 Key Name: BITPIX Key mdType: 0x000100 0aKey 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: 47 47 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 48 48 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 49 49 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 50 Key Name: HISTORY Key mdType: 0x000100 0aKey Value: Key Comment:51 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>52 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>53 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>54 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>55 Key Name: EXTNAME Key mdType: 0x0001000 1Key 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: 56 56 57 57 ---> TESTPOINT PASSED (psMetadata{Test B - Read 2nd hdr from complex FITS file} | tst_psMetadata_01.c) … … 64 64 65 65 Contents of metadata list: 66 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension66 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 67 67 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 68 68 Key Name: NAXIS Key mdType: 0x00000104 Key Value: 1 Key Comment: number of data axes … … 70 70 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 71 71 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 72 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_2' Key Comment:73 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>74 Key Name: HISTORY Key mdType: 0x0001000 1Key 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> 75 75 76 76 Contents of metadata table: … … 78 78 Key Name: NAXIS1 Key mdType: 0x00000104 Key Value: 64 Key Comment: length of data axis 1 79 79 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 80 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension80 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 81 81 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 82 82 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 83 Key Name: HISTORY Key mdType: 0x000100 0aKey Value: Key Comment:84 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>85 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>86 Key Name: EXTNAME Key mdType: 0x0001000 1Key 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: 87 87 88 88 ---> TESTPOINT PASSED (psMetadata{Test C - Read named hdr from complex FITS file} | tst_psMetadata_01.c) … … 97 97 98 98 Contents of metadata list: 99 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension99 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 100 100 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 101 101 Key Name: NAXIS Key mdType: 0x00000104 Key Value: 1 Key Comment: number of data axes … … 103 103 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 104 104 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 105 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_2' Key Comment:105 Key Name: EXTNAME Key mdType: 0x00010000 Key Value: 'MY_DATA_2' Key Comment: 106 106 107 107 Contents of metadata table: … … 109 109 Key Name: NAXIS1 Key mdType: 0x00000104 Key Value: 64 Key Comment: length of data axis 1 110 110 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 111 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension111 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 112 112 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 113 113 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 114 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_2' Key Comment:114 Key Name: EXTNAME Key mdType: 0x00010000 Key Value: 'MY_DATA_2' Key Comment: 115 115 116 116 ---> 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 9 9 Key Name: myItem3 Key mdType: 0x00000404 Key Value: 222.222 Key Comment: I am a single precision floating point 10 10 Key Name: myItem4 Key mdType: 0x00000408 Key Value: 333.333 Key Comment: I am a double precision floating point 11 Key Name: myItem5 Key mdType: 0x0001000 1Key Value: HELLO WORLD Key Comment: I am a string11 Key Name: myItem5 Key mdType: 0x00010000 Key Value: HELLO WORLD Key Comment: I am a string 12 12 13 13 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_02.c) … … 28 28 * TestPoint: psMetadata{Test C - Attempt to create metadata item with invalid type} * 29 29 * TestType: Negative * 30 * ExpectedErrorText: Invalid ps MetadataType: 6*30 * ExpectedErrorText: Invalid psDataType: 6 * 31 31 * ExpectedStatusValue: 0 * 32 32 \**********************************************************************************/ -
trunk/psLib/test/types/verified/tst_psMetadata_06.stdout
r4547 r5136 9 9 Key Name: myItem1 Key mdType: 0x00000104 Key Value: 222 Key Comment: I am a signed integer 10 10 Key Name: myItem2 Key mdType: 0x00000104 Key Value: 333 Key Comment: I am a signed integer 11 Key Name: myItem2 Key mdType: 0x0001000 0Key Value: psList Key Comment: I am a list11 Key Name: myItem2 Key mdType: 0x0001000b Key Value: psList Key Comment: I am a list 12 12 13 13 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata and items} | tst_psMetadata_06.c)
Note:
See TracChangeset
for help on using the changeset viewer.
