Index: /branches/eam_branches/ipp-20130904/psLib/test/imageops/tap_psImageConvolve2dCache.c
===================================================================
--- /branches/eam_branches/ipp-20130904/psLib/test/imageops/tap_psImageConvolve2dCache.c	(revision 36278)
+++ /branches/eam_branches/ipp-20130904/psLib/test/imageops/tap_psImageConvolve2dCache.c	(revision 36279)
@@ -14,23 +14,49 @@
 #include "pstap.h"
 
+bool tap_convolve_delta (int Nx, int Ny, int Xo, int Yo, float sigma, float kappa);
+
 int main(int argc, char **argv) {
 
-    bool status;
-
-    plan_tests(62);
+    plan_tests(141);
 
     psMemId id = psMemGetId();
 
     // generate an image to convolve
+    tap_convolve_delta (301, 301, 150, 150, 2.0, 1.0);
+    tap_convolve_delta (301, 301, 100, 200, 2.0, 1.0);
+    tap_convolve_delta (301, 301, 200, 100, 2.0, 1.0);
+    tap_convolve_delta (301, 301, 200, 200, 2.0, 1.0);
+    tap_convolve_delta (301, 301, 100, 100, 2.0, 1.0);
 
-    int Nx = 301;
-    int Ny = 301;
+    tap_convolve_delta (301, 301, 150, 150, 3.0, 1.0);
+    tap_convolve_delta (301, 301, 100, 200, 3.0, 1.0);
+    tap_convolve_delta (301, 301, 200, 100, 3.0, 1.0);
+    tap_convolve_delta (301, 301, 200, 200, 3.0, 1.0);
+    tap_convolve_delta (301, 301, 100, 100, 3.0, 1.0);
 
-    int Xo = (Nx - 1) / 2;
-    int Yo = (Ny - 1) / 2;
+    tap_convolve_delta (301, 301, 150, 150, 1.0, 1.0);
+    tap_convolve_delta (301, 301, 100, 200, 1.0, 1.0);
+    tap_convolve_delta (301, 301, 200, 100, 1.0, 1.0);
+    tap_convolve_delta (301, 301, 200, 200, 1.0, 1.0);
+    tap_convolve_delta (301, 301, 100, 100, 1.0, 1.0);
+
+    tap_convolve_delta (301, 301, 150, 150, 2.0, 2.0);
+    tap_convolve_delta (301, 301, 100, 200, 2.0, 2.0);
+    tap_convolve_delta (301, 301, 200, 100, 2.0, 2.0);
+    tap_convolve_delta (301, 301, 200, 200, 2.0, 2.0);
+    tap_convolve_delta (301, 301, 100, 100, 2.0, 2.0);
+
+    ok(!psMemCheckLeaks (id, NULL, stdout, false), "no memory leaks");
+
+    return exit_status();
+}
+
+bool tap_convolve_delta (int Nx, int Ny, int Xo, int Yo, float sigma, float kappa) {
+
+    bool status;
 
     psImage *input = psImageAlloc (Nx, Ny, PS_TYPE_F32);
     psImageInit (input, 0.0);
-    input->data.F32[Xo][Yo] = 1.0;
+    input->data.F32[Yo][Xo] = 1.0;
 
     psImageSmooth2dCacheData *smdata = psImageSmooth2dCacheAlloc ();
@@ -39,6 +65,4 @@
     ok(smdata->Nsigma == 3, "init Nsigma to 3");
     
-    float sigma = 2.0;
-    float kappa = 1.0;
     status = psImageSmooth2dCacheKernel_PS1_V1 (smdata, sigma, kappa);
     ok(status, "generate a kernel");
@@ -80,20 +104,19 @@
     ok (fabs(max_df) < 1e-5, "minor deviations");
 
-    /*
-    psFits *fits = NULL;
-    fits = psFitsOpen ("input.fits", "w");
-    psFitsWriteImage (fits, NULL, input, 0, NULL);
-    psFitsClose (fits);
+    if ((fabs(min_df) >= 1e-5) || (fabs(max_df) >= 1e-5)) {
+	psFits *fits = NULL;
+	fits = psFitsOpen ("input.fits", "w");
+	psFitsWriteImage (fits, NULL, input, 0, NULL);
+	psFitsClose (fits);
 
-    fits = psFitsOpen ("model.fits", "w");
-    psFitsWriteImage (fits, NULL, model, 0, NULL);
-    psFitsClose (fits);
-    */
+	fits = psFitsOpen ("model.fits", "w");
+	psFitsWriteImage (fits, NULL, model, 0, NULL);
+	psFitsClose (fits);
+    }
 
     psFree (input);
     psFree (model);
     psFree (smdata);
-    ok(!psMemCheckLeaks (id, NULL, stdout, false), "no memory leaks");
 
-    return exit_status();
+    return true;
 }
