Index: trunk/ippdb/tests/alloc.c
===================================================================
--- trunk/ippdb/tests/alloc.c	(revision 9783)
+++ trunk/ippdb/tests/alloc.c	(revision 9788)
@@ -650,5 +650,5 @@
         p3PendingExpRow *object;
 
-        object = p3PendingExpRowAlloc("a string", -32, -32    );
+        object = p3PendingExpRowAlloc("a string", -32, -32, "a string"    );
 
         if (!object) {
@@ -668,4 +668,8 @@
             exit(EXIT_FAILURE);
         }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(object);
@@ -675,5 +679,5 @@
         p3ProcessedExpRow *object;
 
-        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32    );
+        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string"    );
 
         if (!object) {
@@ -738,4 +742,25 @@
         }
         if (!object->p3_version == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+    }
+
+    {
+        p3MaskRow       *object;
+
+        object = p3MaskRowAlloc("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 9783)
+++ trunk/ippdb/tests/createtable.c	(revision 9788)
@@ -253,4 +253,19 @@
         }
 
+        if(!p3MaskCreateTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
         if(!detRunCreateTable(dbh)) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/dbcleanup.c
===================================================================
--- trunk/ippdb/tests/dbcleanup.c	(revision 9783)
+++ trunk/ippdb/tests/dbcleanup.c	(revision 9788)
@@ -27,4 +27,5 @@
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3PendingExp");
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3ProcessedExp");
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3Mask");
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detRun");
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detInputExp");
Index: trunk/ippdb/tests/dbsetup.c
===================================================================
--- trunk/ippdb/tests/dbsetup.c	(revision 9783)
+++ trunk/ippdb/tests/dbsetup.c	(revision 9788)
@@ -61,4 +61,7 @@
     p3ProcessedExpCreateTable(dbh);
 
+    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3Mask");
+    p3MaskCreateTable(dbh);
+
     p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detRun");
     detRunCreateTable(dbh);
Index: trunk/ippdb/tests/droptable.c
===================================================================
--- trunk/ippdb/tests/droptable.c	(revision 9783)
+++ trunk/ippdb/tests/droptable.c	(revision 9788)
@@ -253,4 +253,19 @@
         }
 
+        if (!p3MaskDropTable(dbh)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
         if (!detRunDropTable(dbh)) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/insert.c
===================================================================
--- trunk/ippdb/tests/insert.c	(revision 9783)
+++ trunk/ippdb/tests/insert.c	(revision 9788)
@@ -223,20 +223,35 @@
         }
 
-        if (!p3PendingExpInsert(dbh, "a string", -32, -32)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p3ProcessedExpInsert(dbh, "a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32)) {
+        if (!p3PendingExpInsert(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 (!p3ProcessedExpInsert(dbh, "a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string")) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!p3MaskInsert(dbh, "a string")) {
             exit(EXIT_FAILURE);
         }
Index: trunk/ippdb/tests/insertfits.c
===================================================================
--- trunk/ippdb/tests/insertfits.c	(revision 9783)
+++ trunk/ippdb/tests/insertfits.c	(revision 9788)
@@ -440,4 +440,30 @@
         }
 
+        if (!p3MaskInsertFits(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 (!detRunInsertFits(dbh, fits)) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/insertobject.c
===================================================================
--- trunk/ippdb/tests/insertobject.c	(revision 9783)
+++ trunk/ippdb/tests/insertobject.c	(revision 9788)
@@ -322,5 +322,5 @@
         }
 
-        object = p3PendingExpRowAlloc("a string", -32, -32);
+        object = p3PendingExpRowAlloc("a string", -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -344,5 +344,5 @@
         }
 
-        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32);
+        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -350,4 +350,26 @@
 
         if (!p3ProcessedExpInsertObject(dbh, object)) {
+            exit(EXIT_FAILURE);
+        }
+
+        psFree(object);
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+        p3MaskRow       *object;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        object = p3MaskRowAlloc("a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!p3MaskInsertObject(dbh, object)) {
             exit(EXIT_FAILURE);
         }
Index: trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- trunk/ippdb/tests/metadatafromobject.c	(revision 9783)
+++ trunk/ippdb/tests/metadatafromobject.c	(revision 9788)
@@ -764,5 +764,5 @@
         bool            status;
 
-        object = p3PendingExpRowAlloc("a string", -32, -32);
+        object = p3PendingExpRowAlloc("a string", -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -788,4 +788,8 @@
             exit(EXIT_FAILURE);
         }
+        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(md);
@@ -797,5 +801,5 @@
         bool            status;
 
-        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32);
+        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -866,4 +870,33 @@
         }
         if (!psMetadataLookupS32(&status, md, "p3_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;
+        p3MaskRow       *object;
+        bool            status;
+
+        object = p3MaskRowAlloc("a string");
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        md = p3MaskMetadataFromObject(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 9783)
+++ trunk/ippdb/tests/objectfrommetadata.c	(revision 9788)
@@ -1191,4 +1191,8 @@
             exit(EXIT_FAILURE);
         }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         object = p3PendingExpObjectFromMetadata(md);
@@ -1212,4 +1216,8 @@
             exit(EXIT_FAILURE);
         }
+        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
 
         psFree(object);
@@ -1281,4 +1289,8 @@
             exit(EXIT_FAILURE);
         }
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         object = p3ProcessedExpObjectFromMetadata(md);
@@ -1347,4 +1359,34 @@
         }
         if (!object->p3_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;
+        p3MaskRow       *object;
+
+        md = psMetadataAlloc();
+        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
+
+        object = p3MaskObjectFromMetadata(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 9783)
+++ trunk/ippdb/tests/selectrowsfits.c	(revision 9788)
@@ -373,4 +373,26 @@
         }
 
+        if (!p3MaskSelectRowsFits(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 (!detRunSelectRowsFits(dbh, fits, NULL, 1)) {
             exit(EXIT_FAILURE);
