IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42500


Ignore:
Timestamp:
Aug 15, 2023, 4:43:48 PM (3 years ago)
Author:
eugene
Message:

fix print type for rowcount in psDB.h

Location:
branches/eam_branches/ipp-20230313/psLib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/psLib/src/db/psDB.c

    r42378 r42500  
    10401040    fieldCount = mysql_num_fields(result);
    10411041
    1042     psTrace("psLib.db", PS_LOG_INFO, "query returned %lld rows with %d fields",             rowCount, fieldCount);
     1042    psTrace("psLib.db", PS_LOG_INFO, "query returned %lu rows with %d fields",             rowCount, fieldCount);
    10431043
    10441044    while ((row = mysql_fetch_row(result))) {
  • branches/eam_branches/ipp-20230313/psLib/test/math/tap_psMatrix08.c

    r24087 r42500  
    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
  • branches/eam_branches/ipp-20230313/psLib/test/math/tap_psPolyFit_IRLS.c

    r42497 r42500  
    8484        ok(rc == true, "fit succeeded mechanically");
    8585
     86# if (0)
    8687        // XXX test:
    8788        FILE *ftest = fopen ("irls.ft.dat", "w");
     
    9091        }
    9192        fclose (ftest);
     93# endif
    9294    } else {
    9395        diag ("ORD fits with %f outliers: sigma = %f", outfrac, sigma);
  • branches/eam_branches/ipp-20230313/psLib/test/math/tap_psSpline1D.c

    r42336 r42500  
    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");
  • branches/eam_branches/ipp-20230313/psLib/test/types/tap_psMetadataConfigFormat.c

    r17515 r42500  
    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.");
  • branches/eam_branches/ipp-20230313/psLib/test/types/tap_psMetadataConfigWrite.c

    r29929 r42500  
    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.