IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8319 for trunk/ippdb/tests


Ignore:
Timestamp:
Aug 14, 2006, 11:56:03 AM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.27

Location:
trunk/ippdb/tests
Files:
6 edited

Legend:

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

    r8283 r8319  
    645645        rawImfileRow    *object;
    646646
    647         object = rawImfileRowAlloc("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    );
     647        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    );
    648648
    649649        if (!object) {
     
    663663            exit(EXIT_FAILURE);
    664664        }
     665        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
     666            psFree(object);
     667            exit(EXIT_FAILURE);
     668        }
    665669        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    666670            psFree(object);
     
    962966        detProcessedImfileRow *object;
    963967
    964         object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string"    );
     968        object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64    );
    965969
    966970        if (!object) {
     
    985989        }
    986990        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     991            psFree(object);
     992            exit(EXIT_FAILURE);
     993        }
     994        if (!object->bg == 64.64) {
     995            psFree(object);
     996            exit(EXIT_FAILURE);
     997        }
     998        if (!object->bg_stdev == 64.64) {
     999            psFree(object);
     1000            exit(EXIT_FAILURE);
     1001        }
     1002        if (!object->bg_mean_stdev == 64.64) {
    9871003            psFree(object);
    9881004            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r8283 r8319  
    238238        }
    239239
    240         if (!rawImfileInsert(dbh, "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)) {
     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)) {
    241241            exit(EXIT_FAILURE);
    242242        }
     
    373373        }
    374374
    375         if (!detProcessedImfileInsert(dbh, -32, "a string", "a string", "a string", "a string")) {
     375        if (!detProcessedImfileInsert(dbh, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64)) {
    376376            exit(EXIT_FAILURE);
    377377        }
  • trunk/ippdb/tests/insertobject.c

    r8283 r8319  
    344344        }
    345345
    346         object = rawImfileRowAlloc("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);
    347347        if (!object) {
    348348            exit(EXIT_FAILURE);
     
    542542        }
    543543
    544         object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string");
     544        object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64);
    545545        if (!object) {
    546546            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r8283 r8319  
    768768        bool            status;
    769769
    770         object = rawImfileRowAlloc("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);
     770        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);
    771771        if (!object) {
    772772            exit(EXIT_FAILURE);
     
    792792            exit(EXIT_FAILURE);
    793793        }
     794        if (strncmp(psMetadataLookupPtr(&status, md, "exp_type"), "a string", MAX_STRING_LENGTH)) {
     795            psFree(md);
     796            exit(EXIT_FAILURE);
     797        }
    794798        if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) {
    795799            psFree(md);
     
    11571161        bool            status;
    11581162
    1159         object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string");
     1163        object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64);
    11601164        if (!object) {
    11611165            exit(EXIT_FAILURE);
     
    11861190        }
    11871191        if (strncmp(psMetadataLookupPtr(&status, md, "recipe"), "a string", MAX_STRING_LENGTH)) {
     1192            psFree(md);
     1193            exit(EXIT_FAILURE);
     1194        }
     1195        if (!psMetadataLookupF64(&status, md, "bg") == 64.64) {
     1196            psFree(md);
     1197            exit(EXIT_FAILURE);
     1198        }
     1199        if (!psMetadataLookupF64(&status, md, "bg_stdev") == 64.64) {
     1200            psFree(md);
     1201            exit(EXIT_FAILURE);
     1202        }
     1203        if (!psMetadataLookupF64(&status, md, "bg_mean_stdev") == 64.64) {
    11881204            psFree(md);
    11891205            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r8283 r8319  
    11751175            exit(EXIT_FAILURE);
    11761176        }
     1177        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
     1178            psFree(md);
     1179            exit(EXIT_FAILURE);
     1180        }
    11771181        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
    11781182            psFree(md);
     
    12481252            exit(EXIT_FAILURE);
    12491253        }
     1254        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
     1255            psFree(object);
     1256            exit(EXIT_FAILURE);
     1257        }
    12501258        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
    12511259            psFree(object);
     
    17451753            exit(EXIT_FAILURE);
    17461754        }
     1755        if (!psMetadataAddF64(md, PS_LIST_TAIL, "bg", 0, NULL, 64.64)) {
     1756            psFree(md);
     1757            exit(EXIT_FAILURE);
     1758        }
     1759        if (!psMetadataAddF64(md, PS_LIST_TAIL, "bg_stdev", 0, NULL, 64.64)) {
     1760            psFree(md);
     1761            exit(EXIT_FAILURE);
     1762        }
     1763        if (!psMetadataAddF64(md, PS_LIST_TAIL, "bg_mean_stdev", 0, NULL, 64.64)) {
     1764            psFree(md);
     1765            exit(EXIT_FAILURE);
     1766        }
    17471767
    17481768        object = detProcessedImfileObjectFromMetadata(md);
     
    17711791        }
    17721792        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1793            psFree(object);
     1794            exit(EXIT_FAILURE);
     1795        }
     1796        if (!object->bg == 64.64) {
     1797            psFree(object);
     1798            exit(EXIT_FAILURE);
     1799        }
     1800        if (!object->bg_stdev == 64.64) {
     1801            psFree(object);
     1802            exit(EXIT_FAILURE);
     1803        }
     1804        if (!object->bg_mean_stdev == 64.64) {
    17731805            psFree(object);
    17741806            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/pop.c

    r8283 r8319  
    345345        char            class[256];
    346346        char            class_id[256];
     347        char            exp_type[256];
    347348        char            uri[256];
    348349        char            filter[256];
     
    364365        }
    365366
    366         if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     367        if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&exp_type, (char **)&uri, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
    367368            exit(EXIT_FAILURE);
    368369        }
     
    532533        char            uri[256];
    533534        char            recipe[256];
    534 
    535         dbh = psDBInit("localhost", "test", NULL, "test");
    536         if (!dbh) {
    537             exit(EXIT_FAILURE);
    538         }
    539 
    540         if (!detProcessedImfilePop(dbh, &det_id, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&recipe)) {
     535        psF64           bg;
     536        psF64           bg_stdev;
     537        psF64           bg_mean_stdev;
     538
     539        dbh = psDBInit("localhost", "test", NULL, "test");
     540        if (!dbh) {
     541            exit(EXIT_FAILURE);
     542        }
     543
     544        if (!detProcessedImfilePop(dbh, &det_id, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev)) {
    541545            exit(EXIT_FAILURE);
    542546        }
Note: See TracChangeset for help on using the changeset viewer.