IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9187 for trunk/ippdb/tests


Ignore:
Timestamp:
Oct 3, 2006, 6:32:18 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.43

Location:
trunk/ippdb/tests
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/tests/alloc.c

    r9173 r9187  
    496496        rawDetrendExpRow *object;
    497497
    498         object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64    );
     498        object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"    );
    499499
    500500        if (!object) {
     
    570570            exit(EXIT_FAILURE);
    571571        }
     572        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
     573            psFree(object);
     574            exit(EXIT_FAILURE);
     575        }
    572576
    573577        psFree(object);
     
    577581        rawScienceExpRow *object;
    578582
    579         object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64    );
     583        object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"    );
    580584
    581585        if (!object) {
     
    651655            exit(EXIT_FAILURE);
    652656        }
     657        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
     658            psFree(object);
     659            exit(EXIT_FAILURE);
     660        }
    653661
    654662        psFree(object);
     
    658666        rawImfileRow    *object;
    659667
    660         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64    );
     668        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"    );
    661669
    662670        if (!object) {
     
    729737        }
    730738        if (!object->posang == 64.64) {
     739            psFree(object);
     740            exit(EXIT_FAILURE);
     741        }
     742        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
    731743            psFree(object);
    732744            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r9173 r9187  
    208208        }
    209209
    210         if (!rawDetrendExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64)) {
    211             exit(EXIT_FAILURE);
    212         }
    213 
    214         psDBCleanup(dbh);
    215     }
    216 
    217     {
    218         psDB            *dbh;
    219 
    220         dbh = psDBInit("localhost", "test", NULL, "test");
    221         if (!dbh) {
    222             exit(EXIT_FAILURE);
    223         }
    224 
    225         if (!rawScienceExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64)) {
    226             exit(EXIT_FAILURE);
    227         }
    228 
    229         psDBCleanup(dbh);
    230     }
    231 
    232     {
    233         psDB            *dbh;
    234 
    235         dbh = psDBInit("localhost", "test", NULL, "test");
    236         if (!dbh) {
    237             exit(EXIT_FAILURE);
    238         }
    239 
    240         if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64)) {
     210        if (!rawDetrendExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) {
     211            exit(EXIT_FAILURE);
     212        }
     213
     214        psDBCleanup(dbh);
     215    }
     216
     217    {
     218        psDB            *dbh;
     219
     220        dbh = psDBInit("localhost", "test", NULL, "test");
     221        if (!dbh) {
     222            exit(EXIT_FAILURE);
     223        }
     224
     225        if (!rawScienceExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) {
     226            exit(EXIT_FAILURE);
     227        }
     228
     229        psDBCleanup(dbh);
     230    }
     231
     232    {
     233        psDB            *dbh;
     234
     235        dbh = psDBInit("localhost", "test", NULL, "test");
     236        if (!dbh) {
     237            exit(EXIT_FAILURE);
     238        }
     239
     240        if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) {
    241241            exit(EXIT_FAILURE);
    242242        }
  • trunk/ippdb/tests/insertobject.c

    r9173 r9187  
    300300        }
    301301
    302         object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     302        object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    303303        if (!object) {
    304304            exit(EXIT_FAILURE);
     
    322322        }
    323323
    324         object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     324        object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    325325        if (!object) {
    326326            exit(EXIT_FAILURE);
     
    344344        }
    345345
    346         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     346        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    347347        if (!object) {
    348348            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r9173 r9187  
    602602        bool            status;
    603603
    604         object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     604        object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    605605        if (!object) {
    606606            exit(EXIT_FAILURE);
     
    682682            exit(EXIT_FAILURE);
    683683        }
     684        if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) {
     685            psFree(md);
     686            exit(EXIT_FAILURE);
     687        }
    684688
    685689        psFree(md);
     
    691695        bool            status;
    692696
    693         object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     697        object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    694698        if (!object) {
    695699            exit(EXIT_FAILURE);
     
    771775            exit(EXIT_FAILURE);
    772776        }
     777        if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) {
     778            psFree(md);
     779            exit(EXIT_FAILURE);
     780        }
    773781
    774782        psFree(md);
     
    780788        bool            status;
    781789
    782         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     790        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    783791        if (!object) {
    784792            exit(EXIT_FAILURE);
     
    857865        }
    858866        if (!psMetadataLookupF64(&status, md, "posang") == 64.64) {
     867            psFree(md);
     868            exit(EXIT_FAILURE);
     869        }
     870        if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) {
    859871            psFree(md);
    860872            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r9173 r9187  
    947947            exit(EXIT_FAILURE);
    948948        }
     949        if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) {
     950            psFree(md);
     951            exit(EXIT_FAILURE);
     952        }
    949953
    950954        object = rawDetrendExpObjectFromMetadata(md);
     
    10241028            exit(EXIT_FAILURE);
    10251029        }
     1030        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
     1031            psFree(object);
     1032            exit(EXIT_FAILURE);
     1033        }
    10261034
    10271035        psFree(object);
     
    11011109            exit(EXIT_FAILURE);
    11021110        }
     1111        if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) {
     1112            psFree(md);
     1113            exit(EXIT_FAILURE);
     1114        }
    11031115
    11041116        object = rawScienceExpObjectFromMetadata(md);
     
    11781190            exit(EXIT_FAILURE);
    11791191        }
     1192        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
     1193            psFree(object);
     1194            exit(EXIT_FAILURE);
     1195        }
    11801196
    11811197        psFree(object);
     
    12551271            exit(EXIT_FAILURE);
    12561272        }
     1273        if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) {
     1274            psFree(md);
     1275            exit(EXIT_FAILURE);
     1276        }
    12571277
    12581278        object = rawImfileObjectFromMetadata(md);
     
    13291349        }
    13301350        if (!object->posang == 64.64) {
     1351            psFree(object);
     1352            exit(EXIT_FAILURE);
     1353        }
     1354        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
    13311355            psFree(object);
    13321356            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/pop.c

    r9173 r9187  
    298298        psF32           ccd_temp;
    299299        psF64           posang;
    300 
    301         dbh = psDBInit("localhost", "test", NULL, "test");
    302         if (!dbh) {
    303             exit(EXIT_FAILURE);
    304         }
    305 
    306         if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     300        char            obstype[256];
     301
     302        dbh = psDBInit("localhost", "test", NULL, "test");
     303        if (!dbh) {
     304            exit(EXIT_FAILURE);
     305        }
     306
     307        if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    307308            exit(EXIT_FAILURE);
    308309        }
     
    330331        psF32           ccd_temp;
    331332        psF64           posang;
    332 
    333         dbh = psDBInit("localhost", "test", NULL, "test");
    334         if (!dbh) {
    335             exit(EXIT_FAILURE);
    336         }
    337 
    338         if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     333        char            obstype[256];
     334
     335        dbh = psDBInit("localhost", "test", NULL, "test");
     336        if (!dbh) {
     337            exit(EXIT_FAILURE);
     338        }
     339
     340        if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    339341            exit(EXIT_FAILURE);
    340342        }
     
    362364        psF32           ccd_temp;
    363365        psF64           posang;
    364 
    365         dbh = psDBInit("localhost", "test", NULL, "test");
    366         if (!dbh) {
    367             exit(EXIT_FAILURE);
    368         }
    369 
    370         if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     366        char            obstype[256];
     367
     368        dbh = psDBInit("localhost", "test", NULL, "test");
     369        if (!dbh) {
     370            exit(EXIT_FAILURE);
     371        }
     372
     373        if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    371374            exit(EXIT_FAILURE);
    372375        }
Note: See TracChangeset for help on using the changeset viewer.