Index: trunk/ippdb/tests/alloc.c
===================================================================
--- trunk/ippdb/tests/alloc.c	(revision 9705)
+++ trunk/ippdb/tests/alloc.c	(revision 9783)
@@ -477,5 +477,5 @@
         p2PendingExpRow *object;
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32    );
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string"    );
 
         if (!object) {
@@ -499,4 +499,8 @@
             exit(EXIT_FAILURE);
         }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(object);
@@ -543,5 +547,5 @@
         p2ProcessedExpRow *object;
 
-        object = p2ProcessedExpRowAlloc("a string", -32, -32    );
+        object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string"    );
 
         if (!object) {
@@ -558,4 +562,25 @@
         }
         if (!object->p2_version == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        p2MaskRow       *object;
+
+        object = p2MaskRowAlloc("a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/createtable.c
===================================================================
--- trunk/ippdb/tests/createtable.c	(revision 9705)
+++ trunk/ippdb/tests/createtable.c	(revision 9783)
@@ -193,4 +193,19 @@
         }
 
+        if(!p2MaskCreateTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
         if(!p2ProcessedImfileCreateTable(dbh)) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/dbcleanup.c
===================================================================
--- trunk/ippdb/tests/dbcleanup.c	(revision 9705)
+++ trunk/ippdb/tests/dbcleanup.c	(revision 9783)
@@ -23,4 +23,5 @@
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2PendingImfile");
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedExp");
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2Mask");
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedImfile");
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3PendingExp");
Index: trunk/ippdb/tests/dbsetup.c
===================================================================
--- trunk/ippdb/tests/dbsetup.c	(revision 9705)
+++ trunk/ippdb/tests/dbsetup.c	(revision 9783)
@@ -48,4 +48,7 @@
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedExp");
     p2ProcessedExpCreateTable(dbh);
+
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2Mask");
+    p2MaskCreateTable(dbh);
 
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedImfile");
Index: trunk/ippdb/tests/droptable.c
===================================================================
--- trunk/ippdb/tests/droptable.c	(revision 9705)
+++ trunk/ippdb/tests/droptable.c	(revision 9783)
@@ -193,4 +193,19 @@
         }
 
+        if (!p2MaskDropTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
         if (!p2ProcessedImfileDropTable(dbh)) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/insert.c
===================================================================
--- trunk/ippdb/tests/insert.c	(revision 9705)
+++ trunk/ippdb/tests/insert.c	(revision 9783)
@@ -148,5 +148,5 @@
         }
 
-        if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32)) {
+        if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string")) {
             exit(EXIT_FAILURE);
         }
@@ -178,5 +178,20 @@
         }
 
-        if (!p2ProcessedExpInsert(dbh, "a string", -32, -32)) {
+        if (!p2ProcessedExpInsert(dbh, "a string", -32, -32, "a string")) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!p2MaskInsert(dbh, "a string")) {
             exit(EXIT_FAILURE);
         }
Index: trunk/ippdb/tests/insertfits.c
===================================================================
--- trunk/ippdb/tests/insertfits.c	(revision 9705)
+++ trunk/ippdb/tests/insertfits.c	(revision 9783)
@@ -336,4 +336,30 @@
         }
 
+        if (!p2MaskInsertFits(dbh, fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!psFitsClose(fits)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        // open a temp
+        fits = psFitsOpen(TMP_FILENAME, "r");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
         if (!p2ProcessedImfileInsertFits(dbh, fits)) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/insertobject.c
===================================================================
--- trunk/ippdb/tests/insertobject.c	(revision 9705)
+++ trunk/ippdb/tests/insertobject.c	(revision 9783)
@@ -212,5 +212,5 @@
         }
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32);
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -256,5 +256,5 @@
         }
 
-        object = p2ProcessedExpRowAlloc("a string", -32, -32);
+        object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -262,4 +262,26 @@
 
         if (!p2ProcessedExpInsertObject(dbh, object)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        p2MaskRow       *object;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        object = p2MaskRowAlloc("a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!p2MaskInsertObject(dbh, object)) {
             exit(EXIT_FAILURE);
         }
Index: trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- trunk/ippdb/tests/metadatafromobject.c	(revision 9705)
+++ trunk/ippdb/tests/metadatafromobject.c	(revision 9783)
@@ -551,5 +551,5 @@
         bool            status;
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32);
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -579,4 +579,8 @@
             exit(EXIT_FAILURE);
         }
+        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(md);
@@ -633,5 +637,5 @@
         bool            status;
 
-        object = p2ProcessedExpRowAlloc("a string", -32, -32);
+        object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -654,4 +658,33 @@
         }
         if (!psMetadataLookupS32(&status, md, "p2_version") == -32) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+    }
+
+    {
+        psMetadata      *md;
+        p2MaskRow       *object;
+        bool            status;
+
+        object = p2MaskRowAlloc("a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        md = p2MaskMetadataFromObject(object);
+        if (!md) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+
+        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
             psFree(md);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/objectfrommetadata.c
===================================================================
--- trunk/ippdb/tests/objectfrommetadata.c	(revision 9705)
+++ trunk/ippdb/tests/objectfrommetadata.c	(revision 9783)
@@ -889,4 +889,8 @@
             exit(EXIT_FAILURE);
         }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         object = p2PendingExpObjectFromMetadata(md);
@@ -914,4 +918,8 @@
             exit(EXIT_FAILURE);
         }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(object);
@@ -1001,4 +1009,8 @@
             exit(EXIT_FAILURE);
         }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         object = p2ProcessedExpObjectFromMetadata(md);
@@ -1019,4 +1031,34 @@
         }
         if (!object->p2_version == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        psMetadata      *md;
+        p2MaskRow       *object;
+
+        md = psMetadataAlloc();
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        object = p2MaskObjectFromMetadata(md);
+        if (!object) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(md);
+
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
             psFree(object);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/selectrowsfits.c
===================================================================
--- trunk/ippdb/tests/selectrowsfits.c	(revision 9705)
+++ trunk/ippdb/tests/selectrowsfits.c	(revision 9783)
@@ -285,4 +285,26 @@
         }
 
+        if (!p2MaskSelectRowsFits(dbh, fits, NULL, 1)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(fits);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        psFits          *fits;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        fits = psFitsOpen(TMP_FILENAME, "w");
+        if (!fits) {
+            exit(EXIT_FAILURE);
+        }
+
         if (!p2ProcessedImfileSelectRowsFits(dbh, fits, NULL, 1)) {
             exit(EXIT_FAILURE);
