Index: /trunk/psLib/test/astronomy/tst_psAstrometry01.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psAstrometry01.c	(revision 2060)
+++ /trunk/psLib/test/astronomy/tst_psAstrometry01.c	(revision 2060)
@@ -0,0 +1,180 @@
+/** @file  tst_psImageManip.c
+*
+*  @brief The code in this file will test the code in psAstrometry.[ch]
+*
+*  @author GLG, MHPCC
+*
+*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-12 20:54:17 $
+*
+*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+*/
+
+#include "psTest.h"
+#include "pslib.h"
+
+static int test1( void );
+static int test2( void );
+static int test3( void );
+
+#define X_NUM_ROWS 4
+#define X_NUM_COLS 5
+#define Y_NUM_ROWS 6
+#define Y_NUM_COLS 7
+#define X_SCALE  1.0
+#define Y_SCALE  2.0
+#define X0  50.0
+#define Y0  60.0
+
+
+// test descrription consists of:
+//    * test function
+//
+//    * testpoint number (item number in gforge testpoint log)
+//
+//    * name of the testpoint
+//
+//    * expected return value (negative numbers are signal types, e.g.,
+//      -6 for aborts).  Usually either -6 (psAbort called) or 0.
+//
+//    * boolean to signify if the test function is already in list, i.e., if
+//      the test function covers multiple testpoints.  If true, the line is
+//      ignored by runTestSuite if the user didn't explicitly specify the
+//      testpoint with the -n or -t option, as to not run a test function
+//      multiple times.
+//
+testDescription tests[] = {
+                              {
+                                  test1, 1118, "psFunctionBar", 0, false
+                              },
+                              {
+                                  test2, 1113, "psFunctionFoo", 0, false
+                              },
+                              {
+                                  test3, 1114, "psFunctionFunk", 0, false
+                              },
+
+                              // A null terminates the testDescription list
+                              {
+                                  NULL
+                              }
+                          };
+
+int main( int argc, char* argv[] )
+{
+    psLogSetLevel( PS_LOG_INFO );
+
+    return ( ! runTestSuite( stderr, "psImage", tests, argc, argv ) );
+}
+
+int test1( void )
+{
+    int i;
+    int j;
+    psFixedPattern *tmp = NULL;
+    float x0 = X0;
+    float y0 = Y0;
+    float xScale = X_SCALE;
+    float yScale = Y_SCALE;
+    psImage *x = psImageAlloc(X_NUM_COLS, X_NUM_ROWS, PS_TYPE_F64);
+    psImage *y = psImageAlloc(Y_NUM_COLS, Y_NUM_ROWS, PS_TYPE_F64);
+    int testStatus = 0;
+    int numPixels = 0;
+
+    for (i=0;i<X_NUM_ROWS;i++) {
+        for (j=0;j<X_NUM_COLS;j++) {
+            x->data.F64[i][j] = (double) (i + j);
+        }
+    }
+    for (i=0;i<Y_NUM_ROWS;i++) {
+        for (j=0;j<Y_NUM_COLS;j++) {
+            y->data.F64[i][j] = (double) (i - j);
+        }
+    }
+
+    tmp = psFixedPatternAlloc(x0, y0, xScale, yScale, x, y);
+
+    // Test the x pattern
+    for (i=0;i<X_NUM_ROWS;i++) {
+        for (j=0;j<X_NUM_COLS;j++) {
+            if ((tmp->x)[i][j] != x->data.F64[i][j]) {
+                printf("ERROR: (tmp->x)[%d][%d] is %f, should be %f\n", i, j,
+                       (tmp->x)[i][j], x->data.F64[i][j]);
+                testStatus = 1;
+                numPixels++;
+            }
+        }
+    }
+    if (numPixels != 0) {
+        printf("ERROR: x: %d incorrect pixels\n", numPixels);
+    }
+
+    // Test the y pattern
+    numPixels = 0;
+    for (i=0;i<Y_NUM_ROWS;i++) {
+        for (j=0;j<Y_NUM_COLS;j++) {
+            if ((tmp->y)[i][j] != y->data.F64[i][j]) {
+                printf("ERROR: (tmp->y)[%d][%d] is %f, should be %f\n", i, j,
+                       (tmp->y)[i][j], y->data.F64[i][j]);
+
+                testStatus = 1;
+                numPixels++;
+            }
+        }
+    }
+    if (numPixels != 0) {
+        printf("ERROR: y: %d incorrect pixels\n", numPixels);
+    }
+
+    // Test the x variables
+    if (tmp->nX != (X_NUM_ROWS * X_NUM_COLS)) {
+        printf("ERROR: tmp->nX is %d, should be %d\n", tmp->nX, (X_NUM_ROWS * X_NUM_COLS));
+        testStatus = 1;
+    }
+    if (tmp->x0 != X0) {
+        printf("ERROR: tmp->x0 is %f, should be %f\n", tmp->x0, X0);
+        testStatus = 1;
+    }
+    if (tmp->xScale != X_SCALE) {
+        printf("ERROR: tmp->xScale is %f, should be %f\n", tmp->xScale, X_SCALE);
+        testStatus = 1;
+    }
+
+    // Test the y variables
+    if (tmp->nY != (Y_NUM_ROWS * Y_NUM_COLS)) {
+        printf("ERROR: tmp->nY is %d, should be %d\n", tmp->nY, (Y_NUM_ROWS * Y_NUM_COLS));
+        testStatus = 1;
+    }
+    if (tmp->y0 != Y0) {
+        printf("ERROR: tmp->y0 is %f, should be %f\n", tmp->y0, Y0);
+        testStatus = 1;
+    }
+    if (tmp->yScale != Y_SCALE) {
+        printf("ERROR: tmp->yScale is %f, should be %f\n", tmp->yScale, Y_SCALE);
+        testStatus = 1;
+    }
+
+    psFree(tmp);
+    psFree(x);
+    psFree(y);
+
+    return 0;
+}
+
+int test2( void )
+{
+    // no need to check for memory leaks, as the runTestSuite does that for you.
+
+    // here is where one implements the tests for generally a single testpoint.
+
+    return 0;  // the value that indicates success is part of the testDescription
+}
+
+int test3( void )
+{
+    // no need to check for memory leaks, as the runTestSuite does that for you.
+
+    // here is where one implements the tests for generally a single testpoint.
+
+    return 0;  // the value that indicates success is part of the testDescription
+}
Index: /trunk/psLib/test/dataManip/Makefile
===================================================================
--- /trunk/psLib/test/dataManip/Makefile	(revision 2059)
+++ /trunk/psLib/test/dataManip/Makefile	(revision 2060)
@@ -3,6 +3,6 @@
 ##  Makefile:   test/sysUtils
 ##
-##  $Revision: 1.50 $  $Name: not supported by cvs2svn $
-##  $Date: 2004-10-12 20:53:40 $
+##  $Revision: 1.51 $  $Name: not supported by cvs2svn $
+##  $Date: 2004-10-12 20:59:07 $
 ##
 ##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -26,5 +26,4 @@
 tst_psFunc05 \
 tst_psFunc07 \
-tst_psFuncxx \
 tst_psHist00 \
 tst_psHist01 \
