IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 4, 2007, 3:10:22 PM (19 years ago)
Author:
gusciora
Message:

Improved test coverage, added memory leak checks, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astro/tap_psEarthOrientation_motion.c

    r12607 r13623  
    1111 *
    1212 */
    13 
    1413#include <pslib.h>
    1514#include <string.h>
    16 
    1715#include "tap.h"
    1816#include "pstap.h"
     
    2220static void testSphereRots(void);
    2321static void testSpherePrecess(void);
    24 
    2522#define MJD_1900  15021.0        // Modified Julian Day 1/1/1900 00:00:00
    2623#define MJD_2100  88069.0        // Modified Julian Day 1/1/2100 00:00:00
     
    3027    psLogSetFormat("HLNM");
    3128    psLogSetLevel(PS_LOG_INFO);
    32     plan_tests(48);
    33 
    34 //    diag("Tests for psEarthOrientation Motion Functions");
    35 
     29    plan_tests(78);
     30
     31    // Tests for psEarthOrientation Motion Functions
    3632    // Initialize library internal structures
    3733    psLibInit("pslib.config");
     
    4238    testSpherePrecess();
    4339
    44     // Cleanup library
    4540    psLibFinalize();
    46 
    4741    done();
    4842}
     
    5044void testPrecessionModel(void)
    5145{
    52 //    diag("  >>>Test 1:  psEOC_PrecessionModel");
     46    // psEOC_PrecessionModel
    5347
    5448    psEarthPole *ep = NULL;
    5549    psTime *testTime = NULL;
    5650
     51
    5752    //Test for psEarthPoleAlloc
    5853    //Return properly allocated psEarthPole
    5954    {
     55        psMemId id = psMemGetId();
    6056        ep = psEarthPoleAlloc();
    61         ok( ep != NULL,
    62             "psEarthPoleAlloc:               return properly allocated psEarthPole.");
     57        ok( ep != NULL, "psEarthPoleAlloc: return properly allocated psEarthPole.");
    6358        psFree(ep);
    6459        ep = NULL;
    65     }
     60        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     61    }
     62
     63
    6664    //Tests for psEOC_PrecessionModel
    6765    //Return NULL for NULL time input.
    6866    {
     67        psMemId id = psMemGetId();
    6968        ep = psEOC_PrecessionModel(NULL);
    70         ok( ep == NULL,
    71             "psEOC_PrecessionModel:          return NULL for NULL time input.");
    72     }
     69        ok( ep == NULL, "psEOC_PrecessionModel: return NULL for NULL time input.");
     70        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     71    }
     72
     73
    7374    //Return NULL for UT1 time input.
    7475    {
     76        psMemId id = psMemGetId();
    7577        testTime = psTimeAlloc(PS_TIME_UT1);
    7678        ep = psEOC_PrecessionModel(testTime);
    77         ok( ep == NULL,
    78             "psEOC_PrecessionModel:          return NULL for UT1 time input.");
    79     }
     79        ok( ep == NULL, "psEOC_PrecessionModel: return NULL for UT1 time input.");
     80        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     81    }
     82
     83
    8084    //Return NULL for invalid time input.
    8185    {
     86        psMemId id = psMemGetId();
    8287        psFree(testTime);
    8388        testTime = psTimeAlloc(PS_TIME_UTC);
     
    8792            "psEOC_PrecessionModel:          return NULL for invalid time input.");
    8893        testTime->nsec = 0;
    89     }
     94        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     95    }
     96
     97
    9098    //Return NULL for failed eoc init - missing file
    9199    //printf("\n filename = '%s' \n", p_psGetConfigFileName());
     
    93101    //to define where the real pslib config is.
    94102    {
     103        psMemId id = psMemGetId();
    95104        testTime->sec = 1049160600;
    96105        testTime->nsec = 0;
     
    103112        rename("../../etc/pslib/pslib_config.bak", "../../etc/pslib/pslib.config");
    104113        skip_end();
    105     }
     114        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     115    }
     116
    106117
    107118    //Return valid EarthPole for valid time input
    108119    {
     120        psMemId id = psMemGetId();
    109121        double x, y, s;
    110122        x = 2.857175590089105e-4;
     
    121133                      "psEOC_PrecessionModel:          return valid EarthPole for valid inputs (s).");
    122134        skip_end();
     135        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    123136    }
    124137
     
    147160void testPolarMotion(void)
    148161{
    149 //    diag("  >>>Test 2:  psEOC_GetPolarMotion ");
     162    // psEOC_GetPolarMotion()
    150163
    151164    psTime *in = psTimeAlloc(PS_TIME_UTC);
     
    155168    psEarthPole *polarMotion = NULL;
    156169
     170
    157171    //Tests for psEOC_GetPolarMotion
    158172    //Return NULL for NULL time input.
    159173    {
     174        psMemId id = psMemGetId();
    160175        polarMotion = psEOC_GetPolarMotion(NULL, PS_IERS_B);
    161         ok( polarMotion == NULL,
    162             "psEOC_GetPolarMotion:           return NULL for NULL time input.");
    163     }
     176        ok( polarMotion == NULL, "psEOC_GetPolarMotion: return NULL for NULL time input.");
     177        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     178    }
     179
     180
    164181    //Return NULL for invalid IERS table input
    165182    {
     183        psMemId id = psMemGetId();
    166184        polarMotion = psEOC_GetPolarMotion(NULL, PS_IERS_B+1);
    167         ok( polarMotion == NULL,
    168             "psEOC_GetPolarMotion:          return NULL for invalid IERS table input.");
    169     }
     185        ok( polarMotion == NULL, "psEOC_GetPolarMotion: return NULL for invalid IERS table input.");
     186        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     187    }
     188
     189
    170190    //Return NULL for invalid time input.
    171191    {
     192        psMemId id = psMemGetId();
    172193        in->nsec = 2e9;
    173194        polarMotion = psEOC_GetPolarMotion(in, PS_IERS_B);
    174         ok( polarMotion == NULL,
    175             "psEOC_GetPolarMotion:          return NULL for invalid time input.");
     195        ok( polarMotion == NULL, "psEOC_GetPolarMotion: return NULL for invalid time input.");
    176196        in->nsec = 0;
    177     }
     197        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     198    }
     199
     200
    178201    //Return NULL for failed eoc init - missing file
    179202    //XXX: Use the PS_CONFIG_FILE_DEFAULT macro, or PS_CONFIG_FILE environment variable
    180203    //to define where the real pslib config is.
    181204    {
     205        psMemId id = psMemGetId();
    182206        p_psEOCFinalize();
    183207        skip_start(rename("../../etc/pslib/pslib.config", "../../etc/pslib/pslib_config.bak"),
    184208                   1, "Skipping 1 tests because file rename failed!");
    185209        polarMotion = psEOC_GetPolarMotion(in, PS_IERS_B);
    186         ok( polarMotion == NULL,
    187             "psEOC_GetPolarMotion:          return NULL for failed eoc init.");
     210        ok( polarMotion == NULL, "psEOC_GetPolarMotion: return NULL for failed eoc init.");
    188211        rename("../../etc/pslib/pslib_config.bak", "../../etc/pslib/pslib.config");
    189212        skip_end();
    190     }
     213        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     214    }
     215
     216
    191217    //Return valid EarthPole for valid time input - IERS B
    192218    {
     219        psMemId id = psMemGetId();
    193220        double x, y, s;
    194221        x = -6.454389659777e-07;
     
    199226                     "Skipping 3 tests because psEarthPole is NULL!");
    200227        is_double_tol(polarMotion->x, x, 0.1,
    201                       "psEOC_GetPolarMotion:          return valid EarthPole for valid inputs "
     228                      "psEOC_GetPolarMotion: return valid EarthPole for valid inputs "
    202229                      "(x) - IERS B.");
    203230        is_double_tol(polarMotion->y, y, 0.1,
    204                       "psEOC_GetPolarMotion:          return valid EarthPole for valid inputs "
     231                      "psEOC_GetPolarMotion: return valid EarthPole for valid inputs "
    205232                      "(y) - IERS B.");
    206233        is_double_tol(polarMotion->s, s, 0.1,
    207                       "psEOC_GetPolarMotion:          return valid EarthPole for valid inputs "
     234                      "psEOC_GetPolarMotion: return valid EarthPole for valid inputs "
    208235                      "(s) - IERS B.");
    209236        skip_end();
    210237        psFree(polarMotion);
    211     }
     238        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     239    }
     240
     241
    212242    //Return valid EarthPole for valid time input - IERS A
    213243    {
     244        psMemId id = psMemGetId();
    214245        double x, y, s;
    215246        x = -6.45381397904e-07;
     
    220251                     "Skipping 3 tests because psEarthPole is NULL!");
    221252        is_double_tol(polarMotion->x, x, 0.1,
    222                       "psEOC_GetPolarMotion:          return valid EarthPole for valid inputs "
     253                      "psEOC_GetPolarMotion: return valid EarthPole for valid inputs "
    223254                      "(x) - IERS A.");
    224255        is_double_tol(polarMotion->y, y, 0.1,
    225                       "psEOC_GetPolarMotion:          return valid EarthPole for valid inputs "
     256                      "psEOC_GetPolarMotion: return valid EarthPole for valid inputs "
    226257                      "(y) - IERS A.");
    227258        is_double_tol(polarMotion->s, s, 0.1,
    228                       "psEOC_GetPolarMotion:          return valid EarthPole for valid inputs "
     259                      "psEOC_GetPolarMotion: return valid EarthPole for valid inputs "
    229260                      "(s) - IERS A.");
    230261        skip_end();
    231262        psFree(polarMotion);
    232     }
     263        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     264    }
     265
     266
    233267    //Return valid EarthPole for valid time input - IERS A
    234268    {
     269        psMemId id = psMemGetId();
    235270        psTime *firstTime = psTimeFromMJD(41684.50);
    236271        polarMotion = psEOC_GetPolarMotion(firstTime, PS_IERS_B);
    237272        ok( polarMotion != NULL,
    238             "psEOC_GetPolarMotion:          return valid EarthPole for valid inputs.");
     273            "psEOC_GetPolarMotion: return valid EarthPole for valid inputs.");
    239274        psFree(firstTime);
     275        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    240276    }
    241277
     
    264300void testSphereRots(void)
    265301{
    266 //    diag("  >>>Test 3:  psSphereRot Functions");
     302    // psSphereRot Functions
    267303    psSphereRot *out = NULL;
    268304    psEarthPole *in = NULL;
     
    276312    //Return NULL for NULL earthPole input
    277313    {
     314        psMemId id = psMemGetId();
    278315        out = psSphereRot_CEOtoGCRS(in);
    279         ok( out == NULL,
    280             "psSphereRot_CEOtoGCRS:         return NULL for NULL earthPole input.");
     316        ok( out == NULL, "psSphereRot_CEOtoGCRS: return NULL for NULL earthPole input.");
    281317        in = psEarthPoleAlloc();
    282     }
     318        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     319    }
     320
     321
    283322    in->x = 2.857175590089105e-4;
    284323    in->y = 2.3968739377734732e-5;
     
    286325    //Return correct psSphereRot for valid input
    287326    {
     327        psMemId id = psMemGetId();
    288328        out = psSphereRot_CEOtoGCRS(in);
    289329        skip_start(  out == NULL, 4,
    290330                     "Skipping 4 tests because psSphereRot output is NULL!");
    291331        is_double_tol( out->q0, q0, 0.0001,
    292                        "psSphereRot_CEOtoGCRS:         return correct psSphereRot for valid input (q0).");
     332                       "psSphereRot_CEOtoGCRS: return correct psSphereRot for valid input (q0).");
    293333        is_double_tol( out->q1, q1, 0.0001,
    294                        "psSphereRot_CEOtoGCRS:         return correct psSphereRot for valid input (q1).");
     334                       "psSphereRot_CEOtoGCRS: return correct psSphereRot for valid input (q1).");
    295335        is_double_tol( out->q2, q2, 0.0001,
    296                        "psSphereRot_CEOtoGCRS:         return correct psSphereRot for valid input (q2).");
     336                       "psSphereRot_CEOtoGCRS: return correct psSphereRot for valid input (q2).");
    297337        is_double_tol( out->q3, -q3, 0.0001,
    298                        "psSphereRot_CEOtoGCRS:         return correct psSphereRot for valid input (q3).");
    299         skip_end();
    300     }
     338                       "psSphereRot_CEOtoGCRS: return correct psSphereRot for valid input (q3).");
     339        skip_end();
     340        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     341    }
     342
    301343
    302344    //Tests for psSphereRot_TEOtoCEO
     
    311353    //Return NULL for NULL time input
    312354    {
     355        psMemId id = psMemGetId();
    313356        out = psSphereRot_TEOtoCEO(NULL, NULL);
    314         ok( out == NULL,
    315             "psSphereRot_TEOtoCEO:          return NULL for NULL time input.");
    316     }
     357        ok( out == NULL, "psSphereRot_TEOtoCEO: return NULL for NULL time input.");
     358        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     359    }
     360
     361
    317362    //Return NULL for invalid time input - large nsec, UTC time type
    318363    {
     364        psMemId id = psMemGetId();
    319365        time2->nsec = 3e9;
    320366        out = psSphereRot_TEOtoCEO(time2, NULL);
    321         ok( out == NULL,
    322             "psSphereRot_TEOtoCEO:          return NULL for invalid time input.");
    323     }
     367        ok( out == NULL, "psSphereRot_TEOtoCEO: return NULL for invalid time input.");
     368        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     369    }
     370
     371
    324372    //Return NULL for invalid time input - UT1 time type, large nsec
    325373    {
     374        psMemId id = psMemGetId();
    326375        psFree(time2);
    327376        time2 = psTimeAlloc(PS_TIME_UT1);
     
    329378        temp->s = 1.0;
    330379        out = psSphereRot_TEOtoCEO(time2, temp);
    331         ok( out == NULL,
    332             "psSphereRot_TEOtoCEO:          return NULL for invalid time input.");
    333     }
     380        ok( out == NULL, "psSphereRot_TEOtoCEO: return NULL for invalid time input.");
     381        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     382    }
     383
     384
    334385    //Return NULL for invalid earthPole input
    335386    {
     387        psMemId id = psMemGetId();
    336388        time2->nsec = 0;
    337389        psEarthPole *temp = psEarthPoleAlloc();
    338390        temp->s = -2.0;
    339391        out = psSphereRot_TEOtoCEO(time2, temp);
    340         ok( out == NULL,
    341             "psSphereRot_TEOtoCEO:          return NULL for invalid earthPole input.");
    342     }
     392        ok( out == NULL, "psSphereRot_TEOtoCEO: return NULL for invalid earthPole input.");
     393        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     394    }
     395
     396
    343397    //Return correct psSphereRot for valid inputs
    344398    double x, y, z;
     
    347401    z = 0.7496183628158023;
    348402    {
     403        psMemId id = psMemGetId();
    349404        psEarthPole *polarTideCorr = psEOC_PolarTideCorr(time);
    350405        out = psSphereRot_TEOtoCEO(time, polarTideCorr);
     
    356411        psCube *cube = psSphereToCube(result);
    357412        is_double_tol( cube->x, x, 0.0001,
    358                        "psSphereRot_TEOtoCEO:          return NULL for NULL time input. (x)");
     413                       "psSphereRot_TEOtoCEO: return NULL for NULL time input. (x)");
    359414        is_double_tol( cube->y, y, 0.0001,
    360                        "psSphereRot_TEOtoCEO:          return NULL for NULL time input. (y)");
    361         is_double_tol( cube->z, z, 0.0001,
    362                        "psSphereRot_TEOtoCEO:          return NULL for NULL time input. (z)");
     415                       "psSphereRot_TEOtoCEO: return NULL for NULL time input. (y)");
     416        is_double_tol( cube->z, z, 0.0001, "psSphereRot_TEOtoCEO: return NULL for NULL time input. (z)");
    363417        psFree(earthRot);
    364418        psFree(result);
     
    367421        skip_end();
    368422        psFree(polarTideCorr);
    369     }
     423        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     424    }
     425
    370426
    371427    //Tests for psSphereRot_ITRStoTEO
    372428    //Return NULL for NULL earthPole input
    373429    {
     430        psMemId id = psMemGetId();
    374431        psFree(out);
    375432        out = psSphereRot_ITRStoTEO(NULL);
     
    377434            "psSphereRot_ITRStoTEO:         return NULL for NULL earthPole input.");
    378435        in = psEarthPoleAlloc();
    379     }
     436        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     437    }
     438
     439
    380440    //Return correct psSphereRot for valid input
    381441    {
     442        psMemId id = psMemGetId();
    382443        q0 = -1.0567571848664005e-6;
    383444        q1 = 3.218036562931509e-7;
     
    391452                     "Skipping 4 tests because psSphereRot output is NULL!");
    392453        is_double_tol( out->q0, q0, 0.0001,
    393                        "psSphereRot_ITRStoTEO:         return correct psSphereRot for valid input (q0).");
     454                       "psSphereRot_ITRStoTEO: return correct psSphereRot for valid input (q0).");
    394455        is_double_tol( out->q1, q1, 0.0001,
    395                        "psSphereRot_ITRStoTEO:         return correct psSphereRot for valid input (q1).");
     456                       "psSphereRot_ITRStoTEO: return correct psSphereRot for valid input (q1).");
    396457        is_double_tol( out->q2, q2, 0.0001,
    397                        "psSphereRot_ITRStoTEO:         return correct psSphereRot for valid input (q2).");
     458                       "psSphereRot_ITRStoTEO: return correct psSphereRot for valid input (q2).");
    398459        is_double_tol( out->q3, q3, 0.0001,
    399                        "psSphereRot_ITRStoTEO:         return correct psSphereRot for valid input (q3).");
    400         skip_end();
     460                       "psSphereRot_ITRStoTEO: return correct psSphereRot for valid input (q3).");
     461        skip_end();
     462        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    401463    }
    402464
     
    428490void testSpherePrecess(void)
    429491{
    430 //    diag("  >>>Test 4:  psSpherePrecess");
     492    // psSpherePrecess
    431493    psSphereRot *rot = NULL;
    432494    psTime *fromTime = NULL;
     
    435497    psSphere* outputCoord = NULL;
    436498
     499
    437500    //Return NULL for NULL time inputs
    438501    {
     502        psMemId id = psMemGetId();
    439503        rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_ROUGH);
    440         ok( rot == NULL,
    441             "psSpherePrecess:               return NULL for NULL time inputs.");
    442     }
     504        ok( rot == NULL, "psSpherePrecess: return NULL for NULL time inputs.");
     505        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     506    }
     507
     508
    443509    //Return NULL for invalid mode input
    444510    {
     511        psMemId id = psMemGetId();
    445512        fromTime    = psTimeFromMJD(MJD_2100);
    446513        toTime      = psTimeFromMJD(MJD_1900);
    447514        rot = psSpherePrecess(fromTime, toTime, -1);
    448         ok( rot == NULL,
    449             "psSpherePrecess:               return NULL for invalid mode input.");
    450     }
     515        ok( rot == NULL, "psSpherePrecess: return NULL for invalid mode input.");
     516        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     517    }
     518
     519
    451520    //Return correct psSphereRot for valid inputs, mode = ROUGH
    452521    {
     522        psMemId id = psMemGetId();
    453523        inputCoord->r = SPHERE_PRECESS_TP1_R;
    454524        inputCoord->d = SPHERE_PRECESS_TP1_D;
     
    463533                    "Skipping 2 tests because psSphereRot output is NULL!");
    464534        is_double_tol( outputCoord->r, SPHERE_PRECESS_TP1_EXPECT_R, ERROR_TOL,
    465                        "psSpherePrecess:               return correct psSphereRot for valid"
     535                       "psSpherePrecess: return correct psSphereRot for valid"
    466536                       " inputs and PS_PRECESS_ROUGH mode. (r)");
    467537        is_double_tol( outputCoord->d, SPHERE_PRECESS_TP1_EXPECT_D, ERROR_TOL,
    468                        "psSpherePrecess:               return correct psSphereRot for valid"
     538                       "psSpherePrecess: return correct psSphereRot for valid"
    469539                       " inputs and PS_PRECESS_ROUGH mode. (d)");
    470540        skip_end();
    471541        psFree(outputCoord);
    472542        psFree(rot);
    473     }
     543        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     544    }
     545
     546
    474547    //Return correct psSphereRot for valid inputs, mode = ROUGH
    475548    {
     549        psMemId id = psMemGetId();
    476550        inputCoord->r = SPHERE_PRECESS_TP2_R;
    477551        inputCoord->d = SPHERE_PRECESS_TP2_D;
     
    486560                    "Skipping 2 tests because psSphereRot output is NULL!");
    487561        is_double_tol( outputCoord->r, SPHERE_PRECESS_TP2_EXPECT_R, ERROR_TOL,
    488                        "psSpherePrecess:               return correct psSphereRot for valid"
     562                       "psSpherePrecess: return correct psSphereRot for valid"
    489563                       " inputs and PS_PRECESS_ROUGH mode. (r)");
    490564        is_double_tol( outputCoord->d, SPHERE_PRECESS_TP2_EXPECT_D, ERROR_TOL,
    491                        "psSpherePrecess:               return correct psSphereRot for valid"
     565                       "psSpherePrecess: return correct psSphereRot for valid"
    492566                       " inputs and PS_PRECESS_ROUGH mode. (d)");
    493567        skip_end();
    494568        psFree(outputCoord);
    495569        psFree(rot);
    496     }
     570        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     571    }
     572
     573
    497574    //Return correct psSphereRot for valid inputs, mode = ROUGH
    498575    {
     576        psMemId id = psMemGetId();
    499577        inputCoord->r = SPHERE_PRECESS_TP3_R;
    500578        inputCoord->d = SPHERE_PRECESS_TP3_D;
     
    509587                    "Skipping 2 tests because psSphereRot output is NULL!");
    510588        is_double_tol( outputCoord->r, SPHERE_PRECESS_TP3_EXPECT_R, ERROR_TOL,
    511                        "psSpherePrecess:               return correct psSphereRot for valid"
     589                       "psSpherePrecess: return correct psSphereRot for valid"
    512590                       " inputs and PS_PRECESS_ROUGH mode. (r)");
    513591        is_double_tol( outputCoord->d, SPHERE_PRECESS_TP3_EXPECT_D, ERROR_TOL,
    514                        "psSpherePrecess:               return correct psSphereRot for valid"
     592                       "psSpherePrecess: return correct psSphereRot for valid"
    515593                       " inputs and PS_PRECESS_ROUGH mode. (d)");
    516594        skip_end();
    517595        psFree(outputCoord);
    518596        psFree(rot);
    519     }
     597        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     598    }
     599
     600
    520601    //Return correct psSphereRot for valid inputs, mode = COMPLETE_A
    521602    {
     603        psMemId id = psMemGetId();
    522604        rot = psSpherePrecess(NULL, toTime, PS_PRECESS_COMPLETE_A);
    523605        outputCoord = psSphereRotApply(NULL, rot, inputCoord);
    524606        ok( outputCoord != NULL && rot != NULL,
    525             "psSpherePrecess:               return correct psSphereRot for valid"
     607            "psSpherePrecess: return correct psSphereRot for valid"
    526608            " inputs and PS_PRECESS_COMPLETE_A mode.");
    527609        psFree(outputCoord);
    528610        psFree(rot);
    529     }
     611        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     612    }
     613
     614
    530615    //Return correct psSphereRot for valid inputs, mode = COMPLETE_B
    531616    {
     617        psMemId id = psMemGetId();
    532618        rot = psSpherePrecess(NULL, toTime, PS_PRECESS_COMPLETE_B);
    533619        outputCoord = psSphereRotApply(NULL, rot, inputCoord);
    534620        ok( outputCoord != NULL && rot != NULL,
    535             "psSpherePrecess:               return correct psSphereRot for valid"
     621            "psSpherePrecess: return correct psSphereRot for valid"
    536622            " inputs and PS_PRECESS_COMPLETE_B mode.");
    537623        psFree(outputCoord);
    538624        psFree(rot);
    539     }
     625        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     626    }
     627
     628
    540629    //Return correct psSphereRot for valid inputs, mode = IAU2000A
    541630    {
     631        psMemId id = psMemGetId();
    542632        rot = psSpherePrecess(NULL, toTime, PS_PRECESS_IAU2000A);
    543633        outputCoord = psSphereRotApply(NULL, rot, inputCoord);
    544634        ok( outputCoord != NULL && rot != NULL,
    545             "psSpherePrecess:               return correct psSphereRot for valid"
     635            "psSpherePrecess: return correct psSphereRot for valid"
    546636            " inputs and PS_PRECESS_IAU2000A mode.");
     637        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    547638    }
    548639
Note: See TracChangeset for help on using the changeset viewer.