IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9783 for trunk/ippdb/tests


Ignore:
Timestamp:
Oct 30, 2006, 11:25:59 AM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.52

Location:
trunk/ippdb/tests
Files:
11 edited

Legend:

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

    r9705 r9783  
    477477        p2PendingExpRow *object;
    478478
    479         object = p2PendingExpRowAlloc("a string", "a string", -32, -32    );
     479        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string"    );
    480480
    481481        if (!object) {
     
    499499            exit(EXIT_FAILURE);
    500500        }
     501        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     502            psFree(object);
     503            exit(EXIT_FAILURE);
     504        }
    501505
    502506        psFree(object);
     
    543547        p2ProcessedExpRow *object;
    544548
    545         object = p2ProcessedExpRowAlloc("a string", -32, -32    );
     549        object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string"    );
    546550
    547551        if (!object) {
     
    558562        }
    559563        if (!object->p2_version == -32) {
     564            psFree(object);
     565            exit(EXIT_FAILURE);
     566        }
     567        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     568            psFree(object);
     569            exit(EXIT_FAILURE);
     570        }
     571
     572        psFree(object);
     573    }
     574
     575    {
     576        p2MaskRow       *object;
     577
     578        object = p2MaskRowAlloc("a string"    );
     579
     580        if (!object) {
     581            exit(EXIT_FAILURE);
     582        }
     583
     584        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
    560585            psFree(object);
    561586            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/createtable.c

    r9684 r9783  
    193193        }
    194194
     195        if(!p2MaskCreateTable(dbh)) {
     196            exit(EXIT_FAILURE);
     197        }
     198
     199        psDBCleanup(dbh);
     200    }
     201
     202    {
     203        psDB            *dbh;
     204
     205        dbh = psDBInit("localhost", "test", NULL, "test");
     206        if (!dbh) {
     207            exit(EXIT_FAILURE);
     208        }
     209
    195210        if(!p2ProcessedImfileCreateTable(dbh)) {
    196211            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/dbcleanup.c

    r9684 r9783  
    2323    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2PendingImfile");
    2424    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedExp");
     25    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2Mask");
    2526    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedImfile");
    2627    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p3PendingExp");
  • trunk/ippdb/tests/dbsetup.c

    r9684 r9783  
    4848    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedExp");
    4949    p2ProcessedExpCreateTable(dbh);
     50
     51    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2Mask");
     52    p2MaskCreateTable(dbh);
    5053
    5154    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS p2ProcessedImfile");
  • trunk/ippdb/tests/droptable.c

    r9684 r9783  
    193193        }
    194194
     195        if (!p2MaskDropTable(dbh)) {
     196            exit(EXIT_FAILURE);
     197        }
     198
     199        psDBCleanup(dbh);
     200    }
     201
     202    {
     203        psDB            *dbh;
     204
     205        dbh = psDBInit("localhost", "test", NULL, "test");
     206        if (!dbh) {
     207            exit(EXIT_FAILURE);
     208        }
     209
    195210        if (!p2ProcessedImfileDropTable(dbh)) {
    196211            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r9705 r9783  
    148148        }
    149149
    150         if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32)) {
     150        if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string")) {
    151151            exit(EXIT_FAILURE);
    152152        }
     
    178178        }
    179179
    180         if (!p2ProcessedExpInsert(dbh, "a string", -32, -32)) {
     180        if (!p2ProcessedExpInsert(dbh, "a string", -32, -32, "a string")) {
     181            exit(EXIT_FAILURE);
     182        }
     183
     184        psDBCleanup(dbh);
     185    }
     186
     187    {
     188        psDB            *dbh;
     189
     190        dbh = psDBInit("localhost", "test", NULL, "test");
     191        if (!dbh) {
     192            exit(EXIT_FAILURE);
     193        }
     194
     195        if (!p2MaskInsert(dbh, "a string")) {
    181196            exit(EXIT_FAILURE);
    182197        }
  • trunk/ippdb/tests/insertfits.c

    r9684 r9783  
    336336        }
    337337
     338        if (!p2MaskInsertFits(dbh, fits)) {
     339            exit(EXIT_FAILURE);
     340        }
     341
     342        if (!psFitsClose(fits)) {
     343            exit(EXIT_FAILURE);
     344        }
     345
     346        psDBCleanup(dbh);
     347    }
     348
     349    {
     350        psDB            *dbh;
     351        psFits          *fits;
     352
     353        dbh = psDBInit("localhost", "test", NULL, "test");
     354        if (!dbh) {
     355            exit(EXIT_FAILURE);
     356        }
     357
     358        // open a temp
     359        fits = psFitsOpen(TMP_FILENAME, "r");
     360        if (!fits) {
     361            exit(EXIT_FAILURE);
     362        }
     363
    338364        if (!p2ProcessedImfileInsertFits(dbh, fits)) {
    339365            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insertobject.c

    r9705 r9783  
    212212        }
    213213
    214         object = p2PendingExpRowAlloc("a string", "a string", -32, -32);
     214        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
    215215        if (!object) {
    216216            exit(EXIT_FAILURE);
     
    256256        }
    257257
    258         object = p2ProcessedExpRowAlloc("a string", -32, -32);
     258        object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string");
    259259        if (!object) {
    260260            exit(EXIT_FAILURE);
     
    262262
    263263        if (!p2ProcessedExpInsertObject(dbh, object)) {
     264            exit(EXIT_FAILURE);
     265        }
     266
     267        psFree(object);
     268        psDBCleanup(dbh);
     269    }
     270
     271    {
     272        psDB            *dbh;
     273        p2MaskRow       *object;
     274
     275        dbh = psDBInit("localhost", "test", NULL, "test");
     276        if (!dbh) {
     277            exit(EXIT_FAILURE);
     278        }
     279
     280        object = p2MaskRowAlloc("a string");
     281        if (!object) {
     282            exit(EXIT_FAILURE);
     283        }
     284
     285        if (!p2MaskInsertObject(dbh, object)) {
    264286            exit(EXIT_FAILURE);
    265287        }
  • trunk/ippdb/tests/metadatafromobject.c

    r9705 r9783  
    551551        bool            status;
    552552
    553         object = p2PendingExpRowAlloc("a string", "a string", -32, -32);
     553        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
    554554        if (!object) {
    555555            exit(EXIT_FAILURE);
     
    579579            exit(EXIT_FAILURE);
    580580        }
     581        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
     582            psFree(md);
     583            exit(EXIT_FAILURE);
     584        }
    581585
    582586        psFree(md);
     
    633637        bool            status;
    634638
    635         object = p2ProcessedExpRowAlloc("a string", -32, -32);
     639        object = p2ProcessedExpRowAlloc("a string", -32, -32, "a string");
    636640        if (!object) {
    637641            exit(EXIT_FAILURE);
     
    654658        }
    655659        if (!psMetadataLookupS32(&status, md, "p2_version") == -32) {
     660            psFree(md);
     661            exit(EXIT_FAILURE);
     662        }
     663        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
     664            psFree(md);
     665            exit(EXIT_FAILURE);
     666        }
     667
     668        psFree(md);
     669    }
     670
     671    {
     672        psMetadata      *md;
     673        p2MaskRow       *object;
     674        bool            status;
     675
     676        object = p2MaskRowAlloc("a string");
     677        if (!object) {
     678            exit(EXIT_FAILURE);
     679        }
     680
     681        md = p2MaskMetadataFromObject(object);
     682        if (!md) {
     683            exit(EXIT_FAILURE);
     684        }
     685
     686        psFree(object);
     687
     688        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
    656689            psFree(md);
    657690            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r9705 r9783  
    889889            exit(EXIT_FAILURE);
    890890        }
     891        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
     892            psFree(md);
     893            exit(EXIT_FAILURE);
     894        }
    891895
    892896        object = p2PendingExpObjectFromMetadata(md);
     
    914918            exit(EXIT_FAILURE);
    915919        }
     920        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     921            psFree(object);
     922            exit(EXIT_FAILURE);
     923        }
    916924
    917925        psFree(object);
     
    10011009            exit(EXIT_FAILURE);
    10021010        }
     1011        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
     1012            psFree(md);
     1013            exit(EXIT_FAILURE);
     1014        }
    10031015
    10041016        object = p2ProcessedExpObjectFromMetadata(md);
     
    10191031        }
    10201032        if (!object->p2_version == -32) {
     1033            psFree(object);
     1034            exit(EXIT_FAILURE);
     1035        }
     1036        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     1037            psFree(object);
     1038            exit(EXIT_FAILURE);
     1039        }
     1040
     1041        psFree(object);
     1042    }
     1043
     1044    {
     1045        psMetadata      *md;
     1046        p2MaskRow       *object;
     1047
     1048        md = psMetadataAlloc();
     1049        if (!psMetadataAddStr(md, PS_LIST_TAIL, "label", 0, NULL, "a string")) {
     1050            psFree(md);
     1051            exit(EXIT_FAILURE);
     1052        }
     1053
     1054        object = p2MaskObjectFromMetadata(md);
     1055        if (!object) {
     1056            psFree(md);
     1057            exit(EXIT_FAILURE);
     1058        }
     1059
     1060        psFree(md);
     1061
     1062        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
    10211063            psFree(object);
    10221064            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/selectrowsfits.c

    r9684 r9783  
    285285        }
    286286
     287        if (!p2MaskSelectRowsFits(dbh, fits, NULL, 1)) {
     288            exit(EXIT_FAILURE);
     289        }
     290
     291        psFree(fits);
     292        psDBCleanup(dbh);
     293    }
     294
     295    {
     296        psDB            *dbh;
     297        psFits          *fits;
     298
     299        dbh = psDBInit("localhost", "test", NULL, "test");
     300        if (!dbh) {
     301            exit(EXIT_FAILURE);
     302        }
     303
     304        fits = psFitsOpen(TMP_FILENAME, "w");
     305        if (!fits) {
     306            exit(EXIT_FAILURE);
     307        }
     308
    287309        if (!p2ProcessedImfileSelectRowsFits(dbh, fits, NULL, 1)) {
    288310            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.