Index: trunk/psModules/test/objects/tap_pmPeaks.c
===================================================================
--- trunk/psModules/test/objects/tap_pmPeaks.c	(revision 15726)
+++ trunk/psModules/test/objects/tap_pmPeaks.c	(revision 15985)
@@ -5,20 +5,7 @@
 #include "tap.h"
 #include "pstap.h"
-/* The following are tested:
-    pmPeakAlloc()
-    pmPeaksInVector()
-    pmPeaksInImage()
-    pmPeaksSubset()
-    pmPeaksCompareAscend()
-    pmPeaksCompareDescend()
-Must test
-    pmCullPeaks()
-	Doesn't exist
-    pmPeakTest()
-	Get rid of this
-    pmPeakSortBySN()
-	Easy
-    pmPeakSortByY()
-	Easy
+/* STATUS:
+    All functions are tested.
+        pmPeaksInImage(): Must debug tests for small images (1-by-1, N-by-1, 1-by-N)
 */
 
@@ -28,4 +15,6 @@
 #define TST02_NUM_ROWS 5
 #define TST02_NUM_COLS 5
+#define VERBOSE                 0
+#define ERR_TRACE_LEVEL         0
 
 /******************************************************************************
@@ -253,13 +242,13 @@
 
 
-
-
 int main(int argc, char* argv[])
 {
     psLogSetFormat("HLNM");
     psLogSetLevel(PS_LOG_INFO);
-    plan_tests(35);
-
-
+    psTraceSetLevel("err", ERR_TRACE_LEVEL);
+    plan_tests(69);
+
+
+    // ------------------------------------------------------------------------
     // Test pmPeakAlloc()
     {
@@ -295,5 +284,283 @@
 
 
-    // ----------------------------------------
+    // ------------------------------------------------------------------------
+    // Calling pmPeaksCompareAscend with NULL peak1
+    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareAscend()
+    if (0) {
+        psMemId id = psMemGetId();
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareAscend(NULL, (const void **) peak2);
+        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareAscend with NULL peak2
+    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareAscend()
+    if (0) {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareAscend((const void **)peak1, NULL);
+        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
+        psFree(*peak1);
+        psFree(peak1);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareAscend with NULL *peak1
+    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareAscend()
+    if (0) {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
+        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareAscend with NULL *peak2
+    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareAscend()
+    if (0) {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
+        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+    // Calling pmPeaksCompareAscend with peak1 < peak2
+    {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
+        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareAscend with peak1 > peak2
+    {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
+        ok(rc == 1, "pmPeaksCompareAscend() returned correct result (peak1 > peak2)");
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareAscend with peak1 == peak2
+    {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
+        ok(rc == 0, "pmPeaksCompareAscend() returned correct result (peak1 == peak2)", rc);
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ------------------------------------------------------------------------
+    // Calling pmPeaksCompareDescend with NULL peak1
+    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareDescend()
+    if (0) {
+        psMemId id = psMemGetId();
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareDescend(NULL, (const void **) peak2);
+        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareDescend with NULL peak2
+    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareDescend()
+    if (0) {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareDescend((const void **)peak1, NULL);
+        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
+        psFree(*peak1);
+        psFree(peak1);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareDescend with NULL *peak1
+    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareDescend()
+    if (0) {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
+        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareDescend with NULL *peak2
+    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareDescend()
+    if (0) {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
+        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+    // Calling pmPeaksCompareDescend with peak1 < peak2
+    {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
+        ok(rc == 1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareDescend with peak1 > peak2
+    {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
+        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 > peak2)");
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Calling pmPeaksCompareDescend with peak1 == peak2
+    {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
+        ok(rc == 0, "pmPeaksCompareDescend() returned correct result (peak1 == peak2)", rc);
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ------------------------------------------------------------------------
+    // pmPeakSortBySN() tests
+    // int pmPeakSortBySN (const void **a, const void **b)
+    // Call pmPeakSortBySN() with acceptable input parameters.
+    // XXX: We don't test with NULL input parameters since this functions has no PS_ASSERTS to protect
+    // against that.
+    {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        (*peak1)->SN = 10.0;
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        (*peak2)->SN = 20.0;
+        int rc = pmPeakSortBySN((const void **)peak1, (const void **) peak2);
+        ok(rc == 1, "pmPeakSortBySN() returned correct result (peak1 < peak2) (%d)", rc);
+        rc = pmPeakSortBySN((const void **)peak2, (const void **) peak1);
+        ok(rc == -1, "pmPeakSortBySN() returned correct result (peak2 < peak1) (%d)", rc);
+        rc = pmPeakSortBySN((const void **)peak1, (const void **) peak1);
+        ok(rc == 0, "pmPeakSortBySN() returned correct result (peak1 == peak2) (%d)", rc);
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ------------------------------------------------------------------------
+    // pmPeakSortByY() tests
+    // int pmPeakSortByY (const void **a, const void **b)
+    // Call pmPeakSortByY() with acceptable input parameters.
+    // XXX: We don't test with NULL input parameters since this functions has no PS_ASSERTS to protect
+    // against that.
+    {
+        psMemId id = psMemGetId();
+        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
+        (*peak1)->y = 10.0;
+        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
+        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
+        (*peak2)->y = 20.0;
+        int rc = pmPeakSortByY((const void **)peak1, (const void **) peak2);
+        ok(rc == -1, "pmPeakSortByY() returned correct result (peak1 < peak2) (%d)", rc);
+        rc = pmPeakSortByY((const void **)peak2, (const void **) peak1);
+        ok(rc == 1, "pmPeakSortByY() returned correct result (peak2 < peak1) (%d)", rc);
+        rc = pmPeakSortByY((const void **)peak1, (const void **) peak1);
+        ok(rc == 0, "pmPeakSortByY() returned correct result (peak1 == peak2) (%d)", rc);
+        psFree(*peak1);
+        psFree(peak1);
+        psFree(*peak2);
+        psFree(peak2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ------------------------------------------------------------------------
     // pmPeaksInVector() tests
     // Test pmPeaksInVector() with bad input parameters.
@@ -334,6 +601,5 @@
 
 
-
-    // ----------------------------------------
+    // ------------------------------------------------------------------------
     // pmPeaksInImage() tests
     // Calling pmPeaksInImage with NULL psImage.  Should generate error.
@@ -386,6 +652,5 @@
 
 
-
-    // ----------------------------------------
+    // ------------------------------------------------------------------------
     // Test pmPeaksSubset()
     // Calling pmPeaksSubset with NULL psList.  Should generate error.
@@ -476,233 +741,4 @@
         psFree(outData2);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // ----------------------------------------
-    // Calling pmPeaksCompareAscend with NULL peak1
-    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareAscend()
-    if (0) {
-        psMemId id = psMemGetId();
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareAscend(NULL, (const void **) peak2);
-        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareAscend with NULL peak2
-    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareAscend()
-    if (0) {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareAscend((const void **)peak1, NULL);
-        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
-        psFree(*peak1);
-        psFree(peak1);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareAscend with NULL *peak1
-    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareAscend()
-    if (0) {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
-        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
-        psFree(peak1);
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareAscend with NULL *peak2
-    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareAscend()
-    if (0) {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
-        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
-        psFree(*peak1);
-        psFree(peak1);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-    // Calling pmPeaksCompareAscend with peak1 < peak2
-    {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
-        ok(rc == -1, "pmPeaksCompareAscend() returned correct result (peak1 < peak2)");
-        psFree(*peak1);
-        psFree(peak1);
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareAscend with peak1 > peak2
-    {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
-        ok(rc == 1, "pmPeaksCompareAscend() returned correct result (peak1 > peak2)");
-        psFree(*peak1);
-        psFree(peak1);
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareAscend with peak1 == peak2
-    {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareAscend((const void **)peak1, (const void **) peak2);
-        ok(rc == 0, "pmPeaksCompareAscend() returned correct result (peak1 == peak2)", rc);
-        psFree(*peak1);
-        psFree(peak1);
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // ----------------------------------------
-    // Calling pmPeaksCompareDescend with NULL peak1
-    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareDescend()
-    if (0) {
-        psMemId id = psMemGetId();
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareDescend(NULL, (const void **) peak2);
-        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareDescend with NULL peak2
-    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareDescend()
-    if (0) {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareDescend((const void **)peak1, NULL);
-        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
-        psFree(*peak1);
-        psFree(peak1);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareDescend with NULL *peak1
-    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareDescend()
-    if (0) {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
-        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
-        psFree(peak1);
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareDescend with NULL *peak2
-    // XXX: This currently seg-faults because NULL args are not pretested in pmPeaksCompareDescend()
-    if (0) {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
-        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
-        psFree(*peak1);
-        psFree(peak1);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-    // Calling pmPeaksCompareDescend with peak1 < peak2
-    {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
-        ok(rc == 1, "pmPeaksCompareDescend() returned correct result (peak1 < peak2)");
-        psFree(*peak1);
-        psFree(peak1);
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareDescend with peak1 > peak2
-    {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 3.0, PM_PEAK_LONE);
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
-        ok(rc == -1, "pmPeaksCompareDescend() returned correct result (peak1 > peak2)");
-        psFree(*peak1);
-        psFree(peak1);
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Calling pmPeaksCompareDescend with peak1 == peak2
-    {
-        psMemId id = psMemGetId();
-        pmPeak **peak1 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak1 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        pmPeak **peak2 = (pmPeak **) psAlloc(sizeof(pmPeak *));
-        *peak2 = pmPeakAlloc(3, 4, 2.0, PM_PEAK_LONE);
-        int rc = pmPeaksCompareDescend((const void **)peak1, (const void **) peak2);
-        ok(rc == 0, "pmPeaksCompareDescend() returned correct result (peak1 == peak2)", rc);
-        psFree(*peak1);
-        psFree(peak1);
-        psFree(*peak2);
-        psFree(peak2);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
 }
-
