IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42822 for trunk/psLib/test


Ignore:
Timestamp:
May 8, 2025, 4:42:12 PM (12 months ago)
Author:
eugene
Message:

remove old deprecated tests, add some new ones

Location:
trunk/psLib/test
Files:
39 deleted
33 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test

    • Property svn:ignore
      •  

        old new  
        66*.da
        77gmon.out
         8test.00.jpg
         9test.01.jpg
         10test.02.jpg
         11test.03.jpg
         12test.04.jpg
         13test.05.jpg
         14test.06.jpg
         15test.07.jpg
         16test.08.jpg
         17test.09.jpg
         18test.10.jpg
         19test.11.jpg
         20test.12.jpg
         21test.im.fits
         22test.mk.fits
         23test.sm1.fits
         24test.sm2.fits
         25test.sm3.fits
         26test.sm4.fits
         27tmpImages
         28tst_psTrace02_OUT
  • trunk/psLib/test/astro

    • Property svn:ignore
      •  

        old new  
        1010test.psTime.config4
        1111test.ser7.dat
        12 tst_psCoord
        13 tst_psCoord01
        14 tst_psSphereOps
        15 tst_psTime_01
        16 tst_psTime_02
        17 tst_psTime_03
        18 tst_psTime_04
        19 tst_psEarthOrientation
        20 tst_psCoord02
        2112*.bb
        2213*.bbg
         
        3223tap_psTime_03
        3324tap_psTime_04
         25test-suite.log
  • trunk/psLib/test/astro/tap_psCoord.c

    r13623 r42822  
    4848    {
    4949        psMemId id = psMemGetId();
    50         psPlaneTransform *myPT = psPlaneTransformAlloc(ORDER_X, ORDER_Y);
     50        psPlaneTransform *myPT = psPlaneTransformAlloc(ORDER_X, ORDER_Y, PS_POLYNOMIAL_ORD);
    5151        ok(myPT != NULL, "psPlaneTransformAlloc() returned non-NULL");
    5252        skip_start(myPT == NULL, 4, "Skipping tests because psPlaneTransformAlloc() returned NULL");
     
    5959        // Attempt to specify negative x order and verify NULL returned and
    6060        // errror message generated
    61         myPT = psPlaneTransformAlloc(-1, 1);
     61        myPT = psPlaneTransformAlloc(-1, 1, PS_POLYNOMIAL_ORD);
    6262        ok(myPT == NULL, "psPlaneTransformAlloc(-1, 1) returned NULL");
    6363        psFree(myPT);
    6464
    65         myPT = psPlaneTransformAlloc(1, -1);
     65        myPT = psPlaneTransformAlloc(1, -1, PS_POLYNOMIAL_ORD);
    6666        ok(myPT == NULL, "psPlaneTransformAlloc(1, -1) returned NULL");
    6767        psFree(myPT);
     
    110110        ok(in != NULL, "psPlaneAlloc() returned non-NULL");
    111111        skip_start(in == NULL, 2, "Skipping tests because psPlaneAlloc() returned NULL");
    112         psPlaneTransform* pt = psPlaneTransformAlloc(2,2);
     112        psPlaneTransform* pt = psPlaneTransformAlloc(2, 2, PS_POLYNOMIAL_ORD);
    113113        ok(pt != NULL, "psPlaneTransformAlloc() returned non-NULL");
    114114        skip_start(pt == NULL, 1, "Skipping tests because psPlaneTransformAlloc() returned NULL");
     
    169169        psMemId id = psMemGetId();
    170170        psPlane *in = psPlaneAlloc();
    171         psPlaneTransform *pt = psPlaneTransformAlloc(2,2);
     171        psPlaneTransform *pt = psPlaneTransformAlloc(2, 2, PS_POLYNOMIAL_ORD);
    172172        psFree(pt->x);
    173173        pt->x = NULL;
     
    184184        psMemId id = psMemGetId();
    185185        psPlane* in = psPlaneAlloc();
    186         psPlaneTransform* pt = psPlaneTransformAlloc(2,2);
     186        psPlaneTransform* pt = psPlaneTransformAlloc(2,2, PS_POLYNOMIAL_ORD);
    187187        psFree(pt->y);
    188188        pt->y = NULL;
     
    198198    {
    199199        psMemId id = psMemGetId();
    200         psPlaneTransform* pt = psPlaneTransformAlloc(2,2);
     200        psPlaneTransform* pt = psPlaneTransformAlloc(2,2, PS_POLYNOMIAL_ORD);
    201201        psPlane *tmpPL = psPlaneTransformApply(NULL, pt, NULL);
    202202        ok(tmpPL == NULL, "psPlaneTransformApply(NULL, pt, NULL) did not return NULL");
     
    314314    {
    315315        psMemId id = psMemGetId();
    316         psPlaneTransform *trans = psPlaneTransformAlloc(1, 3);
     316        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3, PS_POLYNOMIAL_ORD);
    317317        psPixels *output = psPixelsTransform(NULL, NULL, trans);
    318318        ok(output == NULL, "psPixelsTransform(NULL, NULL, trans) returned NULL");
     
    342342        input->data[1].x = 1.0;
    343343        input->data[1].y = 6.0;
    344         psPlaneTransform *trans = psPlaneTransformAlloc(1, 3);
     344        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3, PS_POLYNOMIAL_ORD);
    345345        trans->x->coeff[0][0] = 0;
    346346        trans->x->coeff[1][0] = 1.0;
  • trunk/psLib/test/astro/tap_psCoord02.c

    r13623 r42822  
    189189                                    for (psS32 t2yy = 0 ; t2yy < TST04_T2_Y_Y ; t2yy++) {
    190190                                        //printf("(%d %d %d %d %d %d %d %d)\n", t1xx, t1xy, t1yx, t1yy, t2xx, t2xy, t2yx, t2yy);
    191                                         psPlaneTransform *trans1 = psPlaneTransformAlloc(PS_MAX(t1xx, t1yx), PS_MAX(t1xy, t1yy));
    192                                         psPlaneTransform *trans2 = psPlaneTransformAlloc(PS_MAX(t2xx, t2yx), PS_MAX(t2xy, t2yy));
     191                                        psPlaneTransform *trans1 = psPlaneTransformAlloc(PS_MAX(t1xx, t1yx), PS_MAX(t1xy, t1yy), PS_POLYNOMIAL_ORD);
     192                                        psPlaneTransform *trans2 = psPlaneTransformAlloc(PS_MAX(t2xx, t2yx), PS_MAX(t2xy, t2yy), PS_POLYNOMIAL_ORD);
    193193                                        psPlaneTransform *trans3 = NULL;
    194194                                        setCoeffs(trans1, trans2);
     
    228228    {
    229229        psMemId id = psMemGetId();
    230         psPlaneTransform *trans2 = psPlaneTransformAlloc(2, 2);
     230        psPlaneTransform *trans2 = psPlaneTransformAlloc(2, 2, PS_POLYNOMIAL_ORD);
    231231        psPlaneTransform *trans3 = psPlaneTransformCombine(NULL, NULL, trans2, psRegionSet(0,0,0,0), 10);
    232232        ok(trans3 == NULL, "psPlaneTransformCombine() returned NULL with NULL trans1 input");
     
    241241    {
    242242        psMemId id = psMemGetId();
    243         psPlaneTransform *trans1 = psPlaneTransformAlloc(2, 2);
     243        psPlaneTransform *trans1 = psPlaneTransformAlloc(2, 2, PS_POLYNOMIAL_ORD);
    244244        psPlaneTransform *trans3 = psPlaneTransformCombine(NULL, trans1, NULL, psRegionSet(0,0,0,0), 10);
    245245        ok(trans3 == NULL, "psPlaneTransformCombine() returned NULL with NULL trans2 input");
     
    281281    {
    282282        psMemId id = psMemGetId();
    283         psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
     283        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER, PS_POLYNOMIAL_ORD);
    284284        psArray *dst = psArrayAlloc((int) TST05_NUM_DATA);
    285285        ok(!psPlaneTransformFit(trans, NULL, dst, 100, 100.0), "psPlaneTransformFit() returned FALSE with NULL src psArray");
     
    295295    {
    296296        psMemId id = psMemGetId();
    297         psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
     297        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER, PS_POLYNOMIAL_ORD);
    298298        psArray *src = psArrayAlloc((int) TST05_NUM_DATA);
    299299        ok(!psPlaneTransformFit(trans, src, NULL, 100, 100.0), "psPlaneTransformFit() returned FALSE with NULL dst psArray");
     
    309309    {
    310310        psMemId id = psMemGetId();
    311         psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
    312         psPlaneTransform *transInit = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
     311        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER, PS_POLYNOMIAL_ORD);
     312        psPlaneTransform *transInit = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER, PS_POLYNOMIAL_ORD);
    313313        psArray *src = psArrayAlloc((int) TST05_NUM_DATA);
    314314        psArray *dst = psArrayAlloc((int) TST05_NUM_DATA);
     
    403403        psMemId id = psMemGetId();
    404404        psRegion myRegion = psRegionSet(1.0, 5.0, 1.0, 5.0);
    405         psPlaneTransform *transInverse = psPlaneTransformInvert(NULL, NULL, myRegion, 10);
     405        psPlaneTransform *transInverse = psPlaneTransformInvert(NULL, NULL, myRegion, 10, 2);
    406406        ok(transInverse == NULL, "psPlaneTransformInvert() returned NULL with NULL trans");
    407407        psFree(transInverse);
     
    416416    {
    417417        psMemId id = psMemGetId();
    418         psPlaneTransform *trans = psPlaneTransformAlloc(1, 1);
     418        psPlaneTransform *trans = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD);
    419419        psRegion myRegion = psRegionSet(1.0, 5.0, 1.0, 5.0);
    420         psPlaneTransform *transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 0);
     420        psPlaneTransform *transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 0, 2);
    421421        ok(transInverse == NULL, "psPlaneTransformInvert() returned NULL with zero nSamples");
    422422        psFree(trans);
     
    434434        psMemId id = psMemGetId();
    435435        bool errorFlag = false;
    436         psPlaneTransform *trans = psPlaneTransformAlloc(1, 1);
     436        psPlaneTransform *trans = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD);
    437437        psPlaneTransform *transInverse = NULL;
    438438        psRegion myRegion = psRegionSet(1.0, 5.0, 1.0, 5.0);
     
    473473            }
    474474
    475             transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 10);
     475            transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 10, 2);
    476476            if (transInverse == NULL) {
    477477                diag("TEST ERROR: psPlaneTransformInvert() returned a NULL psPlaneTransform.\n");
     
    514514    {
    515515        psMemId id = psMemGetId();
    516         psPlaneTransform *trans = psPlaneTransformAlloc(1, 3);
     516        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3, PS_POLYNOMIAL_ORD);
    517517        psPlane *deriv = psPlaneTransformDeriv(NULL, trans, NULL);
    518518        ok(deriv == NULL, "psPlaneTransformDeriv(NULL, trans, NULL) returned NULL");
     
    532532        coord->x = 3.0;
    533533        coord->y = 1.0;
    534         trans = psPlaneTransformAlloc(1, 3);
     534        trans = psPlaneTransformAlloc(1, 3, PS_POLYNOMIAL_ORD);
    535535        //Set Polynomials.  f(x) = x, f(y) = 0.5*y^2  -->  f'(x) = 1, f'(y) = y
    536536        //So for 1,1  -> f'(1) = 1, f'(1) = 1
  • trunk/psLib/test/db

    • Property svn:ignore
      •  

        old new  
        1010gmon.out
        1111tap_psDB
         12test-suite.log
  • trunk/psLib/test/fft

    • Property svn:ignore
      •  

        old new  
        1414tap_psImageFFT
        1515tap_psVectorFFT
         16test-suite.log
  • trunk/psLib/test/fits

    • Property svn:ignore
      •  

        old new  
        1414tap_psFits
        1515tap_psFitsImage
         16test-suite.log
  • trunk/psLib/test/fits/tap_psFits.c

    r15709 r42822  
    717717            ok(vecItem != NULL, "Retrieved psVector metadata item from file (row=%d)", row);
    718718
    719             ok(vecItem->type.type == PS_DATA_S32 &&
     719            ok(vecItem->type.type == PS_TYPE_S32 &&
    720720               vecItem->data.S32[0] == row &&
    721721               vecItem->data.S32[3] == row+30,
  • trunk/psLib/test/imageops

    • Property svn:ignore
      •  

        old new  
        3838tap_psImageMapFit
        3939tap_psImageMapFit2
         40tap_psImageCovariance
         41tap_psImageSmoothMask_Threaded
         42test-suite.log
  • trunk/psLib/test/imageops/Makefile.am

    r36375 r42822  
    1818        tap_psImageSmooth \
    1919        tap_psImageSmoothMask_Threaded \
    20         tap_psImageSmooth_PreAlloc \
    2120        tap_psImageStructManip \
    2221        tap_psImageConvolve \
     
    3231        tap_psImageCovariance
    3332
     33#       tap_psImageSmooth_PreAlloc
    3434#       tap_psImageShiftKernel
    3535#       tap_psImageInterpolate
  • trunk/psLib/test/imageops/convolutionBench.c

    r23259 r42822  
    5656    }
    5757
    58     char size[16];
     58    char size[32];
    5959    sprintf(size, "%dx%d", imageCols, imageRows);
    6060    printf("%15s", size);
  • trunk/psLib/test/imageops/tap_psImageGeomManip.c

    r21169 r42822  
    528528
    529529        psImage *in;
    530         psImage *out;
    531         psImage *out2;
    532530        psS32 rows = 64;
    533531        psS32 cols = 64;
     
    544542        // Verify the returned psImage structure pointer is NULL and program
    545543        // execution doesn't stop, if input parameter input is NULL.
    546         out2 = psImageRoll(NULL,NULL,0,0);
     544        psImage *out2 = psImageRoll(NULL,NULL,0,0);
    547545        if (out2 != NULL) {
    548546            psError(PS_ERR_UNKNOWN, true,"psImageRoll did not return NULL though input image was NULL!?");
     
    551549
    552550        psFree(in);
    553         psFree(out);
    554 
    555         #define testRollType(DATATYPE) \
     551        psFree(out2);
     552
     553#define testRollType(DATATYPE) {                          \
    556554        in = psImageAlloc(rows1,cols1,PS_TYPE_##DATATYPE); \
    557555        \
     
    564562        \
    565563        errorFlag = false; \
    566         out = psImageRoll(NULL,in,rows1/4,cols1/4); \
     564        psImage *out = psImageRoll(NULL,in,rows1/4,cols1/4);    \
    567565        for (psS32 row=0;row<rows1;row++) { \
    568566            ps##DATATYPE *inRow = in->data.DATATYPE[(row+rows1/4)%rows1]; \
     
    579577        psFree(in); \
    580578        psFree(out); \
    581         ok(!errorFlag, "psImageRoll() produced the correct data values");
     579        ok(!errorFlag, "psImageRoll() produced the correct data values"); }
    582580
    583581        testRollType(U8);
     
    636634        system("mkdir temp");
    637635        psS32 index = 0;
    638         psBool fail = false;
    639636        psF32 radianRot;
    640637
     
    711708                diag("verified psF32 image failed to be read (%d deg. rotation)", rot);
    712709                errorFlag = true;
    713                 fail = true;
    714710            } else {
    715711                if(fTruth->numRows != fOut->numRows || fTruth->numCols != fOut->numCols) {
     
    788784                     "(%d deg. rotation) BILINEAR",rot);
    789785                errorFlag = true;
    790                 fail = true;
    791786            } else {
    792787                if (sBiTruth->numRows != sBiOut->numRows ||
  • trunk/psLib/test/imageops/tap_psImageInterpolate3.c

    r29929 r42822  
    7474        // point (1) : center of center pixel
    7575        interpOK = psImageInterpolate(&imageVal, NULL, NULL, xCenter + 0.5, yCenter + 0.5, interp);
     76        ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
    7677        pt1->data.F32[i] = imageVal;
    7778
    7879        // point (2) : edge of center pixel
    7980        interpOK = psImageInterpolate(&imageVal, NULL, NULL, xCenter + 0.5, yCenter, interp);
     81        ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
    8082        pt2->data.F32[i] = imageVal;
    8183
    8284        // point (3) : corner of center pixel
    8385        interpOK = psImageInterpolate(&imageVal, NULL, NULL, xCenter, yCenter, interp);
     86        ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
    8487        pt3->data.F32[i] = imageVal;
    8588
     
    102105
    103106        interpOK = psImageInterpolate(&imageVal, &varianceVal, NULL, xCenter + 0.5, yCenter + 0.5, interp);
     107        ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
    104108        psStatsInit(stats);
    105109        psVectorStats(stats, pt1, NULL, NULL, 0);
     
    107111       
    108112        interpOK = psImageInterpolate(&imageVal, &varianceVal, NULL, xCenter + 0.5, yCenter, interp);
     113        ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
    109114        psStatsInit(stats);
    110115        psVectorStats(stats, pt2, NULL, NULL, 0);
     
    112117       
    113118        interpOK = psImageInterpolate(&imageVal, &varianceVal, NULL, xCenter, yCenter, interp);
     119        ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
    114120        psStatsInit(stats);
    115121        psVectorStats(stats, pt3, NULL, NULL, 0);
  • trunk/psLib/test/imageops/tap_psImageMapFit.c

    r20767 r42822  
    7979
    8080        // fit the data to the map
    81         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     81        bool status;
     82        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     83        ok (status, "ok fit");
    8284
    8385        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    153155
    154156        // fit the data to the map
    155         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     157        bool status;
     158        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     159        ok (status, "ok fit");
    156160
    157161        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    235239
    236240        // fit the data to the map
    237         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     241        bool status;
     242        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     243        ok (status, "ok fit");
    238244
    239245        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    318324
    319325        // fit the data to the map
    320         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     326        bool status;
     327        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     328        ok (status, "ok fit");
    321329
    322330        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    384392
    385393        // fit the data to the map
    386         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     394        bool status;
     395        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     396        ok (status, "ok fit");
    387397
    388398        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    445455
    446456        // fit the data to the map
    447         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     457        bool status;
     458        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     459        ok (status, "ok fit");
    448460
    449461        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    526538
    527539        // fit the data to the map
    528         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     540        bool status;
     541        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     542        ok (status, "ok fit");
    529543
    530544        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    595609
    596610        // fit the data to the map
    597         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     611        bool status;
     612        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     613        ok (status, "ok fit");
    598614
    599615        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    686702
    687703        // fit the data to the map
    688         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     704        bool status;
     705        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     706        ok (status, "ok fit");
    689707
    690708        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    753771
    754772        // fit the data to the map
    755         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     773        bool status;
     774        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     775        ok (status, "ok fit");
    756776
    757777        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
     
    814834
    815835        // fit the data to the map
    816         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     836        bool status;
     837        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     838        ok (status, "ok fit");
    817839
    818840        psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
  • trunk/psLib/test/imageops/tap_psImageMapFit2.c

    r20767 r42822  
    6161
    6262        // fit the data to the map
    63         psImageMapFit (map, x, y, f, NULL);
     63        bool status;
     64        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     65        ok (status, "ok fit");
     66        // psImageMapFit (map, x, y, f, NULL);
    6467
    6568        psImage *field = psImageAlloc(1000, 1000, PS_TYPE_F32);
     
    124127        for (int ix = 0; ix < 1000; ix += 20) {
    125128            for (int iy = 0; iy < 1000; iy += 20) {
    126                 x->data.F32[x->n] = ix + 0,5;
     129                x->data.F32[x->n] = ix + 0.5;
    127130                y->data.F32[y->n] = iy + 0.5;
    128131                f->data.F32[f->n] = PS_SQR(x->data.F32[x->n]) + PS_SQR(y->data.F32[x->n]);
     
    141144        // XXX this function needs to correct for the mean superpixel position
    142145        // which is sampled...
    143         psImageMapFit (map, NULL, 0, x, y, f, NULL);
     146        bool status;
     147        psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
     148        ok (status, "ok fit");
     149        // psImageMapFit (map, NULL, 0, x, y, f, NULL);
    144150        psFree (binning);
    145151
  • trunk/psLib/test/imageops/tap_psImageMaskOps.c

    r13123 r42822  
    121121        }
    122122        psImageMaskRegion(img, reg, "=", maskVal);
    123         psBool errorFlag = false;
     123        errorFlag = false;
    124124        for (int i = 0 ; i < numRows ; i++) {
    125125            for (int j = 0 ; j < numCols ; j++) {
     
    149149        maskVal = 0xf;
    150150        psImageMaskRegion(img, reg, "&", maskVal);
    151         psBool errorFlag = false;
     151        errorFlag = false;
    152152        for (int i = 0 ; i < numRows ; i++) {
    153153            for (int j = 0 ; j < numCols ; j++) {
     
    177177        maskVal = 0xf;
    178178        psImageMaskRegion(img, reg, "^", maskVal);
    179         psBool errorFlag = false;
     179        errorFlag = false;
    180180        for (int i = 0 ; i < numRows ; i++) {
    181181            for (int j = 0 ; j < numCols ; j++) {
     
    250250        }
    251251        psImageKeepRegion(img, reg, "=", maskVal);
    252         psBool errorFlag = false;
     252        errorFlag = false;
    253253        for (int i = 0 ; i < numRows ; i++) {
    254254            for (int j = 0 ; j < numCols ; j++) {
     
    278278        maskVal = 0xf;
    279279        psImageKeepRegion(img, reg, "&", maskVal);
    280         psBool errorFlag = false;
     280        errorFlag = false;
    281281        for (int i = 0 ; i < numRows ; i++) {
    282282            for (int j = 0 ; j < numCols ; j++) {
     
    306306        maskVal = 0xf;
    307307        psImageKeepRegion(img, reg, "^", maskVal);
    308         psBool errorFlag = false;
     308        errorFlag = false;
    309309        for (int i = 0 ; i < numRows ; i++) {
    310310            for (int j = 0 ; j < numCols ; j++) {
     
    381381        }
    382382        psImageMaskCircle(img, (psF64) x, (psF64) y, (psF64) radius, "=", maskVal);
    383         psBool errorFlag = false;
     383        errorFlag = false;
    384384        for (int i = 0 ; i < numRows ; i++) {
    385385            for (int j = 0 ; j < numCols ; j++) {
     
    409409        maskVal = 0xf;
    410410        psImageMaskCircle(img, (psF64) x, (psF64) y, (psF64) radius, "&", maskVal);
    411         psBool errorFlag = false;
     411        errorFlag = false;
    412412        for (int i = 0 ; i < numRows ; i++) {
    413413            for (int j = 0 ; j < numCols ; j++) {
     
    437437        maskVal = 0xf;
    438438        psImageMaskCircle(img, (psF64) x, (psF64) y, (psF64) radius, "^", maskVal);
    439         psBool errorFlag = false;
     439        errorFlag = false;
    440440        for (int i = 0 ; i < numRows ; i++) {
    441441            for (int j = 0 ; j < numCols ; j++) {
     
    504504        }
    505505        psImageKeepCircle(img, (psF64) x, (psF64) y, (psF64) radius, "=", maskVal);
    506         psBool errorFlag = false;
     506        errorFlag = false;
    507507        for (int i = 0 ; i < numRows ; i++) {
    508508            for (int j = 0 ; j < numCols ; j++) {
     
    532532        maskVal = 0xf;
    533533        psImageKeepCircle(img, (psF64) x, (psF64) y, (psF64) radius, "&", maskVal);
    534         psBool errorFlag = false;
     534        errorFlag = false;
    535535        for (int i = 0 ; i < numRows ; i++) {
    536536            for (int j = 0 ; j < numCols ; j++) {
     
    560560        maskVal = 0xf;
    561561        psImageKeepCircle(img, (psF64) x, (psF64) y, (psF64) radius, "^", maskVal);
    562         psBool errorFlag = false;
     562        errorFlag = false;
    563563        for (int i = 0 ; i < numRows ; i++) {
    564564            for (int j = 0 ; j < numCols ; j++) {
  • trunk/psLib/test/jpeg

    • Property svn:ignore
      •  

        old new  
        99gmon.out
        1010tap_psImageJpeg
         11test-suite.log
  • trunk/psLib/test/jpeg/tap_psImageJpeg.c

    r29542 r42822  
    8282
    8383    // add elements to bDraw buffer
    84     bDrawSetBuffer(bdbuf);
     84    // XXX deprecated: bDrawSetBuffer(bdbuf);
    8585    bDrawColor red = KapaColorByName("red");
    86     bDrawSetStyle (red, 1, 0);
    87     bDrawCircle(40.0, 20.0, 3.0);
     86    bDrawSetStyle (bdbuf, red, 1, 0, 1.0);
     87    bDrawCircle(bdbuf, 40.0, 20.0, 3.0);
    8888
    8989    options->min = ZMIN;
  • trunk/psLib/test/math

    • Property svn:ignore
      •  

        old new  
        5353tap_psSpline1D
        5454tap_psPolynomialMD
         55tap_psMinimizeLMM
         56tap_psMinimizeLMM_Alt
         57tap_psMinimizeLMM_Trail
         58tap_psPolyFit_IRLS_1D
         59tap_psPolyFit_IRLS_2D
         60tap_psPolynomialMD_sampleDark
         61test-suite.log
  • trunk/psLib/test/math/Makefile.am

    r35767 r42822  
    2323        tap_psMatrix07 \
    2424        tap_psMatrix08 \
    25         tap_psPolyFit1D \
    26         tap_psPolyFit2D \
    27         tap_psPolyFit3D \
    28         tap_psPolyFit4D \
    2925        tap_psPolynomial \
    3026        tap_psPolynomialEval1D \
     
    3329        tap_psPolynomialEval4D \
    3430        tap_psPolynomialUtils_Derivatives \
     31        tap_psPolyFit1D \
     32        tap_psPolyFit2D \
     33        tap_psPolyFit3D \
     34        tap_psPolyFit4D \
     35        tap_psPolyFit_IRLS_1D \
     36        tap_psPolyFit_IRLS_2D \
    3537        tap_psSparse \
    3638        tap_psStats00 \
  • trunk/psLib/test/math/tap_psMatrix08.c

    r24087 r42822  
    2020psS32 main( psS32 argc, char* argv[] )
    2121{
     22    fprintf (stderr, "path: %s\n", argv[0]);
     23
     24    char imApath[1024];
     25    char imBpath[1024];
     26    char topPath[1024];
     27    char *libpath = strstr (argv[0], ".libs/");
     28    if (!libpath) {
     29        fprintf (stderr, "ERROR: cannot find input data\n");
     30        exit (2);
     31    }
     32
     33    // if (strncmp(argv[0], ".libs/", 6))
     34    int nTopPath = libpath - argv[0]; //
     35    if (nTopPath) {
     36        ps_strncpy_nowarn (topPath, argv[0], nTopPath); topPath[nTopPath] = 0;
     37        ps_snprintf_nowarn (imApath, 1024, "%s/%s", topPath, "data/Agj.fits");
     38        ps_snprintf_nowarn (imBpath, 1024, "%s/%s", topPath, "data/Bgj.fits");
     39    } else {
     40        ps_snprintf_nowarn (imApath, 1024, "%s", "data/Agj.fits");
     41        ps_snprintf_nowarn (imBpath, 1024, "%s", "data/Bgj.fits");
     42    }
     43
    2244    plan_tests(23);
    2345    // psTraceSetLevel("psLib.math.psMatrixGJSolve", 4);
     
    3254        // XXX this is an ill-conditioned matrix.  LU Decomposition does not inform us that it is ill-conditioned. 
    3355        // the result solves the equation, but what are the errors on the values?
    34         fits = psFitsOpen ("data/Agj.fits", "r");
     56        fits = psFitsOpen (imApath, "r");
    3557        ok(fits, "opened test image Agj.fits");
    3658
     
    4365        psFitsClose (fits);
    4466
    45         fits = psFitsOpen ("data/Bgj.fits", "r");
     67        fits = psFitsOpen (imBpath, "r");
    4668        ok(fits, "opened test image Bgj.fits");
    4769
     
    98120
    99121        // we have a specific ill-conditioned matrix in Agj.fits. psMatrixGJSolve detects this and reports a failure.
    100         fits = psFitsOpen ("data/Agj.fits", "r");
     122        fits = psFitsOpen (imApath, "r");
    101123        ok(fits, "opened test image Agj.fits");
    102124
     
    106128        psFitsClose (fits);
    107129
    108         fits = psFitsOpen ("data/Bgj.fits", "r");
     130        fits = psFitsOpen (imBpath, "r");
    109131        ok(fits, "opened test image Bgj.fits");
    110132
     
    147169
    148170        // we have a specific ill-conditioned matrix in Agj.fits. psMatrixGJSolve detects this and reports a failure.
    149         fits = psFitsOpen ("data/Agj.fits", "r");
     171        fits = psFitsOpen (imApath, "r");
    150172        ok(fits, "opened test image Agj.fits");
    151173
     
    158180        psFitsClose (fits);
    159181
    160         fits = psFitsOpen ("data/Bgj.fits", "r");
     182        fits = psFitsOpen (imBpath, "r");
    161183        ok(fits, "opened test image Bgj.fits");
    162184
  • trunk/psLib/test/math/tap_psMinimizeLMM.c

    r23259 r42822  
    5353
    5454#define NUM_ITER 10
    55 #define TOL  20.0
     55#define MIN_TOL  20.0
     56#define MAX_TOL  40.0
    5657psS32 main(psS32 argc, char* argv[])
    5758{
     
    6465    {
    6566        psMemId id = psMemGetId();
    66         psMinimization *tmp = psMinimizationAlloc(NUM_ITER, TOL);
     67        psMinimization *tmp = psMinimizationAlloc(NUM_ITER, MIN_TOL, MAX_TOL);
    6768        ok(tmp != NULL, "psMinimizationAlloc() returned non-NULL");
    6869        skip_start(tmp == NULL, 5, "Skipping tests because psMinimizationAlloc() failed");
    6970        ok(tmp->maxIter == NUM_ITER, "psMinimizationAlloc() properly set ->maxIter");
    70         ok(tmp->tol == TOL, "psMinimizationAlloc() properly set ->tol");
     71        ok(tmp->minTol == MIN_TOL, "psMinimizationAlloc() properly set ->tol");
     72        ok(tmp->maxTol == MAX_TOL, "psMinimizationAlloc() properly set ->tol");
    7173        ok(tmp->value == 0.0, "psMinimizationAlloc() properly set ->value");
    7274        ok(tmp->iter == 0, "psMinimizationAlloc() properly set ->iter (%d)", tmp->iter);
     
    9698        psMemId id = psMemGetId();
    9799        psRandom *rng = psRandomAllocSpecific(PS_RANDOM_TAUS, 1); // Random number generator; using known seed
    98         psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL);
     100        psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL, 100);
    99101        psArray *ordinates = psArrayAlloc(NUM_DATA_POINTS);
    100102        psVector *coordinates = psVectorAlloc(NUM_DATA_POINTS, PS_TYPE_F32);
     
    204206        psMemId id = psMemGetId();
    205207        psRandom *rng = psRandomAllocSpecific(PS_RANDOM_TAUS, 1); // Random number generator; using known seed
    206         psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL);
     208        psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL, 100);
    207209        psArray *ordinates = psArrayAlloc(NUM_DATA_POINTS);
    208210        psVector *coordinates = psVectorAlloc(NUM_DATA_POINTS, PS_TYPE_F32);
  • trunk/psLib/test/math/tap_psMinimizePowell.c

    r13124 r42822  
    8181        psVector *myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32);
    8282        psVector *myParamMask = psVectorAlloc(NUM_PARAMS, PS_TYPE_U8);
    83         psMinimization *min = psMinimizationAlloc(100, 0.01);
     83        psMinimization *min = psMinimizationAlloc(100, 0.01, 0.1);
    8484        psArray *myCoords = psArrayAlloc(N);
    8585
     
    136136        psMemId id = psMemGetId();
    137137        psVector *myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32);
    138         psMinimization *min = psMinimizationAlloc(100, 0.01);
     138        psMinimization *min = psMinimizationAlloc(100, 0.01, 0.1);
    139139        psArray *myCoords = psArrayAlloc(N);
    140140        psVector *myParamMask = psVectorAlloc(NUM_PARAMS, PS_TYPE_U8);
  • trunk/psLib/test/math/tap_psPolyFit1D.c

    r23259 r42822  
    88 
    99XXX: Try null stats.
     10
     11XXX: this function is confused about POLY_ORDER (5 should have x^5, but setData stops at x^4)
    1012 *****************************************************************************/
    1113#include <stdio.h>
     
    350352    plan_tests(104);
    351353
     354    // psTraceSetLevel ("psLib.math.psMatrixGJSolve", 4);
    352355
    353356    // psVectorFitPolynomial1D()
  • trunk/psLib/test/math/tap_psSparse.c

    r13124 r42822  
    1     #include <stdio.h>
     1#include <stdio.h>
    22#include <string.h>
    33#include <pslib.h>
     
    227227        // test the support functions: LowerProduct
    228228        fVec = psSparseBorderLowerProduct(NULL, border, xRef);
    229         is_float(fVec->n, 1.0, "f dimen: %d", fVec->n);
     229        is_int(fVec->n, 1.0, "f dimen: %d", fVec->n);
    230230        is_float(fVec->data.F32[0], 0.3, "f(0): %f", fVec->data.F32[0]);
    231231        psFree(fVec);
     
    233233        // test the support functions: Upper Product
    234234        fVec = psSparseBorderUpperProduct(NULL, border, yRef);
    235         is_float(fVec->n, 2.0, "f dimen: %d", fVec->n);
     235        is_int(fVec->n, 2.0, "f dimen: %d", fVec->n);
    236236        is_float(fVec->data.F32[0], 0.05, "f(0): %f", fVec->data.F32[0]);
    237237        is_float(fVec->data.F32[1], 0.10, "f(0): %f", fVec->data.F32[1]);
     
    240240        // test the support functions: Square Product
    241241        fVec = psSparseBorderSquareProduct(NULL, border, yRef);
    242         is_float(fVec->n, 1.0, "f dimen: %d", fVec->n);
     242        is_int(fVec->n, 1.0, "f dimen: %d", fVec->n);
    243243        is_float(fVec->data.F32[0], 0.25, "f(0): %f", fVec->data.F32[0]);
    244244        psFree(fVec);
  • trunk/psLib/test/math/tap_psSpline1D.c

    r42336 r42822  
    107107        psSpline1D *tmpSpline = NULL;
    108108        if (!xNull) {
    109             tmpSpline = psSpline1DFitVector(xF32, yF32);
     109            tmpSpline = psSpline1DFitVector(xF32, yF32, NAN, NAN);
    110110        } else {
    111             tmpSpline = psSpline1DFitVector(NULL, yF32);
     111            tmpSpline = psSpline1DFitVector(NULL, yF32, NAN, NAN);
    112112        }
    113113
     
    120120                testStatus = false;
    121121            }
    122             if(tmpSpline->spline == NULL) {
    123                 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline member.");
    124                 testStatus = false;
    125             }
    126             for (psS32 i = 0 ; i < NumSplines ; i++) {
    127                 if (tmpSpline->spline[i] == NULL) {
    128                     diag("psSpline1DFitVector() returned a NULL psSpline1D->spline[%d] member.", i);
    129                     testStatus = false;
    130                 }
    131             }
    132             if (tmpSpline->knots == NULL) {
     122            if (tmpSpline->xKnots == NULL) {
    133123                diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member");
    134124                testStatus = false;
    135125            }
    136             if (tmpSpline->p_psDeriv2 == NULL) {
     126            if (tmpSpline->yKnots == NULL) {
     127                diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member");
     128                testStatus = false;
     129            }
     130            if (tmpSpline->d2yKnots == NULL) {
    137131                diag("psSpline1DFitVector()returned a NULL psSpline1D->p_psDeriv2 member");
    138132                testStatus = false;
    139             }
    140 
    141             // Test psSpline1DEval()
    142             for (psS32 i=0;i<NumSplines;i++) {
    143                 psF32 x = 0.5 + (float) i;
    144                 psF32 y = psSpline1DEval(tmpSpline, x);
    145                 if (CheckErrorF32(y, func(x))) {
    146                     testStatus = false;
    147                     diag("TEST ERROR: f(%f) is %f, should be %f", x, y, myFunc00(x));
    148                     // XXX EAM : the truth value above should be 'func' not myFunc00
    149                 }
    150133            }
    151134
     
    196179        psSpline1D *tmpSpline = NULL;
    197180        if (!xNull) {
    198             tmpSpline = psSpline1DFitVector(xF64, yF64);
     181            tmpSpline = psSpline1DFitVector(xF64, yF64, NAN, NAN);
    199182        } else {
    200             tmpSpline = psSpline1DFitVector(NULL, yF64);
     183            tmpSpline = psSpline1DFitVector(NULL, yF64, NAN, NAN);
    201184        }
    202185        if(tmpSpline == NULL) {
     
    208191                testStatus = false;
    209192            }
    210             if(tmpSpline->spline == NULL) {
    211                 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline member.");
    212                 testStatus = false;
    213             }
    214             for (psS32 i = 0 ; i < NumSplines ; i++) {
    215                 if (tmpSpline->spline[i] == NULL) {
    216                     diag("psSpline1DFitVector() returned a NULL psSpline1D->spline[%d] member.", i);
    217                     testStatus = false;
    218                 }
    219             }
    220             if (tmpSpline->knots == NULL) {
    221                 diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member");
    222                 testStatus = false;
    223             }
    224             if (tmpSpline->p_psDeriv2 == NULL) {
    225                 diag("psSpline1DFitVector()returned a NULL psSpline1D->p_psDeriv2 member");
     193            if (tmpSpline->xKnots == NULL) {
     194                diag("psSpline1DFitVector() returned a NULL psSpline1D->xKnots member");
     195                testStatus = false;
     196            }
     197            if (tmpSpline->yKnots == NULL) {
     198                diag("psSpline1DFitVector() returned a NULL psSpline1D->yKnots member");
     199                testStatus = false;
     200            }
     201            if (tmpSpline->d2yKnots == NULL) {
     202                diag("psSpline1DFitVector()returned a NULL psSpline1D->d2yKnots member");
    226203                testStatus = false;
    227204            }
     
    278255        skip_start(tmpSpline == NULL, 4, "Skipping tests because psSpline1DAlloc() failed");
    279256        ok(tmpSpline->n == 0, "psSpline1DAlloc() properly set the psSpline1D->n member");
    280         ok(tmpSpline->spline == NULL, "psSpline1DAlloc() properly set the psSpline1D->spline member");
    281         ok(tmpSpline->knots == NULL, "psSpline1DAlloc() properly set the psSpline1D->knots member");
    282         ok(tmpSpline->p_psDeriv2 == NULL, "psSpline1DAlloc() properly set the psSpline1D->p_psDeriv2 member");
     257        ok(tmpSpline->xKnots   == NULL, "psSpline1DAlloc() properly set the psSpline1D->xKnots member");
     258        ok(tmpSpline->yKnots   == NULL, "psSpline1DAlloc() properly set the psSpline1D->yKnots member");
     259        ok(tmpSpline->d2yKnots == NULL, "psSpline1DAlloc() properly set the psSpline1D->d2yKnots member");
    283260        psFree(tmpSpline);
    284261        skip_end();
     
    289266    {
    290267        psMemId id = psMemGetId();
    291         psSpline1D *tmpSpline = psSpline1DFitVector(NULL, NULL);
     268        psSpline1D *tmpSpline = psSpline1DFitVector(NULL, NULL, NAN, NAN);
    292269        ok(tmpSpline == NULL, "psSpline1DFitVector() returns NULL with NULL arguments");
    293270        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
  • trunk/psLib/test/mathtypes

    • Property svn:ignore
      •  

        old new  
        2222tap_psVectorSortIndex
        2323tap_psVectorSelect
         24test-suite.log
  • trunk/psLib/test/optime

    • Property svn:ignore
      •  

        old new  
        33.deps
        44tap_psStatsTiming
         5test-suite.log
  • trunk/psLib/test/sys

    • Property svn:ignore
      •  

        old new  
        2929tap_psString
        3030tap_psTrace
         31test-suite.log
  • trunk/psLib/test/sys/tap_psMemory.c

    r41171 r42822  
    428428
    429429        psPlaneTransform *planeTransform;
    430         planeTransform = psPlaneTransformAlloc(1, 1);
     430        planeTransform = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD);
    431431        okay = psMemCheckType(PS_DATA_PLANETRANSFORM, planeTransform);
    432432        if (!okay ) psFree(planeTransform);
  • trunk/psLib/test/types

    • Property svn:ignore
      •  

        old new  
        1919test4.config
        2020test5.config
        21 tst_psArray
        22 tst_psBitSet
        23 tst_psHash00
        24 tst_psHash01
        25 tst_psHash02
        26 tst_psHash03
        27 tst_psHash04
        28 tst_psHash05
        29 tst_psList
        30 tst_psLookupTable_01
        31 tst_psMetadataIO
        32 tst_psMetadata_01
        33 tst_psMetadata_02
        34 tst_psMetadata_03
        35 tst_psMetadata_04
        36 tst_psMetadata_05
        37 tst_psMetadata_06
        38 tst_psMetadata_07
        39 tst_psPixels
        4021MDCopy.in
        4122MDCopy.out
         
        7657tap_psTree
        7758tap_psBits_all
         59test-suite.log
  • trunk/psLib/test/types/tap_psMetadataConfigFormat.c

    r17515 r42822  
    101101            "containing a NULL time.");
    102102        char configTest[32];
    103         strncpy(configTest, "time             TAI       NULL", 31);
     103        ps_strncpy_nowarn(configTest, "time             TAI       NULL", 31);
    104104        is_strn(configTest, out, 31,
    105105                "psMetadataConfigFormat:         return correct output string.");
  • trunk/psLib/test/types/tap_psMetadataConfigWrite.c

    r29929 r42822  
    7474        FILE *mdcfg = fopen("mdcfg.wrt", "r");
    7575        fgets(fileStr, 61, mdcfg);
    76         strncpy(configTest,
    77                 "item1-1          BOOL      T                # I am a boolean", 60);
     76        ps_strncpy_nowarn(configTest, "item1-1          BOOL      T                # I am a boolean", 60);
    7877        is_strn(configTest, fileStr, 60,
    7978                "return correct output.");
Note: See TracChangeset for help on using the changeset viewer.