Index: /trunk/psLib/test/astronomy/Makefile
===================================================================
--- /trunk/psLib/test/astronomy/Makefile	(revision 1407)
+++ /trunk/psLib/test/astronomy/Makefile	(revision 1408)
@@ -3,6 +3,6 @@
 ##  Makefile:   test/astronomy
 ##
-##  $Revision: 1.5 $  $Name: not supported by cvs2svn $
-##  $Date: 2004-08-06 20:33:08 $
+##  $Revision: 1.6 $  $Name: not supported by cvs2svn $
+##  $Date: 2004-08-07 00:16:01 $
 ##
 ##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -21,5 +21,6 @@
 
 TARGET = tst_psMetadata_01 \
-         tst_psMetadata_02
+         tst_psMetadata_02 \
+         tst_psMetadata_03
 
 DEPENDENCIES = $(addprefix builddir/,$(addsuffix .d,$(TARGET)))
Index: /trunk/psLib/test/astronomy/tst_psMetadata_03.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_03.c	(revision 1408)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_03.c	(revision 1408)
@@ -0,0 +1,101 @@
+/** @file  tst_psMetadata_03.c
+*
+*  @brief Test driver for psMetadata functions
+*
+*  This test driver contains the following tests for psMetadata:
+*     Test A - Allocate metadata and items
+*     Test B -
+*     Test C -
+*     Test D -
+*     Test E -
+*     Test F -
+*     Test G -
+*     Test H - Free psMetadata
+*
+*  @author  Ross Harman, MHPCC
+*
+*  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2004-08-07 00:16:21 $
+*
+*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+*
+*/
+
+#include "pslib.h"
+#include "psTest.h"
+#include <string.h>
+
+static void printMetadataItem(psMetadataItem *item)
+{
+    printf("Key Name: %8s  ", item->name);
+    printf("Key Type: %2d  ", item->type);
+
+    switch (item->type ) {
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", item->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", item->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", item->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", item->data.F64);
+        break;
+    case PS_META_STR:
+        printf("Key Value: %15s  ", (char*)item->data.V);
+        break;
+    case PS_META_IMG:
+    case PS_META_JPEG:
+    case PS_META_PNG:
+    case PS_META_ASTROM:
+    case PS_META_UNKNOWN:
+        printf("Value: unknown ");
+        break;
+    default:
+        printf("Bad type: %d ", item->type);
+    }
+    printf("Key Comment: %s\n", item->comment);
+}
+
+
+int main( int argc, char* argv[] )
+{
+    psMetadataItem *item1 = NULL;
+    psMetadataItem *item2 = NULL;
+    psMetadata *metadata = NULL;
+
+
+    // Test A - Allocate metadata and items
+    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
+    metadata = psMetadataAlloc();
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
+    printMetadataItem(item1);
+    printMetadataItem(item2);
+    printf("References = %d\n", (int)(((psMemBlock*)item1)-1)->refCounter);
+    psMetadataAddItem(metadata, PS_LIST_HEAD, item1);
+    psMetadataAddItem(metadata, PS_LIST_HEAD, item2);
+    printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true);
+    printf("References = %d\n", (int)(((psMemBlock*)item1)-1)->refCounter);
+
+
+    // Test B - Remove items from metadata by name
+    psMetadataRemove(metadata, 0, "myItem1" );
+    psMetadataRemove(metadata, 0, "myItem2" );
+
+
+    // Test C - Free psMetadata
+    printPositiveTestHeader(stdout, "psMetadata", "Test - Free psMetadata");
+    psFree(metadata);
+    psMemCheckLeaks(0, NULL, stdout);
+    psMemCheckCorruption(0);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psMetadata", "Test - Free psMetadata", true);
+
+    return 0;
+}
Index: /trunk/psLib/test/collections/tst_psMetadata_03.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_03.c	(revision 1408)
+++ /trunk/psLib/test/collections/tst_psMetadata_03.c	(revision 1408)
@@ -0,0 +1,101 @@
+/** @file  tst_psMetadata_03.c
+*
+*  @brief Test driver for psMetadata functions
+*
+*  This test driver contains the following tests for psMetadata:
+*     Test A - Allocate metadata and items
+*     Test B -
+*     Test C -
+*     Test D -
+*     Test E -
+*     Test F -
+*     Test G -
+*     Test H - Free psMetadata
+*
+*  @author  Ross Harman, MHPCC
+*
+*  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2004-08-07 00:16:21 $
+*
+*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+*
+*/
+
+#include "pslib.h"
+#include "psTest.h"
+#include <string.h>
+
+static void printMetadataItem(psMetadataItem *item)
+{
+    printf("Key Name: %8s  ", item->name);
+    printf("Key Type: %2d  ", item->type);
+
+    switch (item->type ) {
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", item->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", item->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", item->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", item->data.F64);
+        break;
+    case PS_META_STR:
+        printf("Key Value: %15s  ", (char*)item->data.V);
+        break;
+    case PS_META_IMG:
+    case PS_META_JPEG:
+    case PS_META_PNG:
+    case PS_META_ASTROM:
+    case PS_META_UNKNOWN:
+        printf("Value: unknown ");
+        break;
+    default:
+        printf("Bad type: %d ", item->type);
+    }
+    printf("Key Comment: %s\n", item->comment);
+}
+
+
+int main( int argc, char* argv[] )
+{
+    psMetadataItem *item1 = NULL;
+    psMetadataItem *item2 = NULL;
+    psMetadata *metadata = NULL;
+
+
+    // Test A - Allocate metadata and items
+    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
+    metadata = psMetadataAlloc();
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
+    printMetadataItem(item1);
+    printMetadataItem(item2);
+    printf("References = %d\n", (int)(((psMemBlock*)item1)-1)->refCounter);
+    psMetadataAddItem(metadata, PS_LIST_HEAD, item1);
+    psMetadataAddItem(metadata, PS_LIST_HEAD, item2);
+    printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true);
+    printf("References = %d\n", (int)(((psMemBlock*)item1)-1)->refCounter);
+
+
+    // Test B - Remove items from metadata by name
+    psMetadataRemove(metadata, 0, "myItem1" );
+    psMetadataRemove(metadata, 0, "myItem2" );
+
+
+    // Test C - Free psMetadata
+    printPositiveTestHeader(stdout, "psMetadata", "Test - Free psMetadata");
+    psFree(metadata);
+    psMemCheckLeaks(0, NULL, stdout);
+    psMemCheckCorruption(0);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psMetadata", "Test - Free psMetadata", true);
+
+    return 0;
+}
