IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8368 for trunk/ippdb/tests


Ignore:
Timestamp:
Aug 15, 2006, 4:31:35 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.29

Location:
trunk/ippdb/tests
Files:
14 edited

Legend:

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

    r8325 r8368  
    10421042
    10431043    {
     1044        detNormalizedStatImfileRow *object;
     1045
     1046        object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32    );
     1047
     1048        if (!object) {
     1049            exit(EXIT_FAILURE);
     1050        }
     1051
     1052        if (!object->det_id == -32) {
     1053            psFree(object);
     1054            exit(EXIT_FAILURE);
     1055        }
     1056        if (!object->iteration == -32) {
     1057            psFree(object);
     1058            exit(EXIT_FAILURE);
     1059        }
     1060        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     1061            psFree(object);
     1062            exit(EXIT_FAILURE);
     1063        }
     1064        if (!object->norm == 32.32) {
     1065            psFree(object);
     1066            exit(EXIT_FAILURE);
     1067        }
     1068
     1069        psFree(object);
     1070    }
     1071
     1072    {
    10441073        detNormalizedImfileRow *object;
    10451074
  • trunk/ippdb/tests/createtable.c

    r7461 r8368  
    403403        }
    404404
     405        if(!detNormalizedStatImfileCreateTable(dbh)) {
     406            exit(EXIT_FAILURE);
     407        }
     408
     409        psDBCleanup(dbh);
     410    }
     411
     412    {
     413        psDB            *dbh;
     414
     415        dbh = psDBInit("localhost", "test", NULL, "test");
     416        if (!dbh) {
     417            exit(EXIT_FAILURE);
     418        }
     419
    405420        if(!detNormalizedImfileCreateTable(dbh)) {
    406421            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/dbcleanup.c

    r7461 r8368  
    3737    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detProcessedImfile");
    3838    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detStackedImfile");
     39    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detNormalizedStatImfile");
    3940    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detNormalizedImfile");
    4041    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detMasterFrame");
  • trunk/ippdb/tests/dbsetup.c

    r7461 r8368  
    9191    detStackedImfileCreateTable(dbh);
    9292
     93    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detNormalizedStatImfile");
     94    detNormalizedStatImfileCreateTable(dbh);
     95
    9396    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS detNormalizedImfile");
    9497    detNormalizedImfileCreateTable(dbh);
  • trunk/ippdb/tests/droptable.c

    r7461 r8368  
    403403        }
    404404
     405        if (!detNormalizedStatImfileDropTable(dbh)) {
     406            exit(EXIT_FAILURE);
     407        }
     408
     409        psDBCleanup(dbh);
     410    }
     411
     412    {
     413        psDB            *dbh;
     414
     415        dbh = psDBInit("localhost", "test", NULL, "test");
     416        if (!dbh) {
     417            exit(EXIT_FAILURE);
     418        }
     419
    405420        if (!detNormalizedImfileDropTable(dbh)) {
    406421            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r8319 r8368  
    403403        }
    404404
     405        if (!detNormalizedStatImfileInsert(dbh, -32, -32, "a string", 32.32)) {
     406            exit(EXIT_FAILURE);
     407        }
     408
     409        psDBCleanup(dbh);
     410    }
     411
     412    {
     413        psDB            *dbh;
     414
     415        dbh = psDBInit("localhost", "test", NULL, "test");
     416        if (!dbh) {
     417            exit(EXIT_FAILURE);
     418        }
     419
    405420        if (!detNormalizedImfileInsert(dbh, -32, -32, "a string", "a string", "a string")) {
    406421            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insertfits.c

    r7461 r8368  
    700700        }
    701701
     702        if (!detNormalizedStatImfileInsertFits(dbh, fits)) {
     703            exit(EXIT_FAILURE);
     704        }
     705
     706        if (!psFitsClose(fits)) {
     707            exit(EXIT_FAILURE);
     708        }
     709
     710        psDBCleanup(dbh);
     711    }
     712
     713    {
     714        psDB            *dbh;
     715        psFits          *fits;
     716
     717        dbh = psDBInit("localhost", "test", NULL, "test");
     718        if (!dbh) {
     719            exit(EXIT_FAILURE);
     720        }
     721
     722        // open a temp
     723        fits = psFitsOpen(TMP_FILENAME, "r");
     724        if (!fits) {
     725            exit(EXIT_FAILURE);
     726        }
     727
    702728        if (!detNormalizedImfileInsertFits(dbh, fits)) {
    703729            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insertobject.c

    r8319 r8368  
    579579    {
    580580        psDB            *dbh;
     581        detNormalizedStatImfileRow *object;
     582
     583        dbh = psDBInit("localhost", "test", NULL, "test");
     584        if (!dbh) {
     585            exit(EXIT_FAILURE);
     586        }
     587
     588        object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32);
     589        if (!object) {
     590            exit(EXIT_FAILURE);
     591        }
     592
     593        if (!detNormalizedStatImfileInsertObject(dbh, object)) {
     594            exit(EXIT_FAILURE);
     595        }
     596
     597        psFree(object);
     598        psDBCleanup(dbh);
     599    }
     600
     601    {
     602        psDB            *dbh;
    581603        detNormalizedImfileRow *object;
    582604
  • trunk/ippdb/tests/metadatafromobject.c

    r8325 r8368  
    12521252    {
    12531253        psMetadata      *md;
     1254        detNormalizedStatImfileRow *object;
     1255        bool            status;
     1256
     1257        object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32);
     1258        if (!object) {
     1259            exit(EXIT_FAILURE);
     1260        }
     1261
     1262        md = detNormalizedStatImfileMetadataFromObject(object);
     1263        if (!md) {
     1264            exit(EXIT_FAILURE);
     1265        }
     1266
     1267        psFree(object);
     1268
     1269        if (!psMetadataLookupS32(&status, md, "det_id") == -32) {
     1270            psFree(md);
     1271            exit(EXIT_FAILURE);
     1272        }
     1273        if (!psMetadataLookupS32(&status, md, "iteration") == -32) {
     1274            psFree(md);
     1275            exit(EXIT_FAILURE);
     1276        }
     1277        if (strncmp(psMetadataLookupPtr(&status, md, "class_id"), "a string", MAX_STRING_LENGTH)) {
     1278            psFree(md);
     1279            exit(EXIT_FAILURE);
     1280        }
     1281        if (!psMetadataLookupF32(&status, md, "norm") == 32.32) {
     1282            psFree(md);
     1283            exit(EXIT_FAILURE);
     1284        }
     1285
     1286        psFree(md);
     1287    }
     1288
     1289    {
     1290        psMetadata      *md;
    12541291        detNormalizedImfileRow *object;
    12551292        bool            status;
  • trunk/ippdb/tests/objectfrommetadata.c

    r8325 r8368  
    18701870    {
    18711871        psMetadata      *md;
     1872        detNormalizedStatImfileRow *object;
     1873
     1874        md = psMetadataAlloc();
     1875        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
     1876            psFree(md);
     1877            exit(EXIT_FAILURE);
     1878        }
     1879        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
     1880            psFree(md);
     1881            exit(EXIT_FAILURE);
     1882        }
     1883        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
     1884            psFree(md);
     1885            exit(EXIT_FAILURE);
     1886        }
     1887        if (!psMetadataAddF32(md, PS_LIST_TAIL, "norm", 0, NULL, 32.32)) {
     1888            psFree(md);
     1889            exit(EXIT_FAILURE);
     1890        }
     1891
     1892        object = detNormalizedStatImfileObjectFromMetadata(md);
     1893        if (!object) {
     1894            psFree(md);
     1895            exit(EXIT_FAILURE);
     1896        }
     1897
     1898        psFree(md);
     1899
     1900        if (!object->det_id == -32) {
     1901            psFree(object);
     1902            exit(EXIT_FAILURE);
     1903        }
     1904        if (!object->iteration == -32) {
     1905            psFree(object);
     1906            exit(EXIT_FAILURE);
     1907        }
     1908        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
     1909            psFree(object);
     1910            exit(EXIT_FAILURE);
     1911        }
     1912        if (!object->norm == 32.32) {
     1913            psFree(object);
     1914            exit(EXIT_FAILURE);
     1915        }
     1916
     1917        psFree(object);
     1918    }
     1919
     1920    {
     1921        psMetadata      *md;
    18721922        detNormalizedImfileRow *object;
    18731923
  • trunk/ippdb/tests/pop.c

    r8325 r8368  
    574574        psS32           iteration;
    575575        char            class_id[256];
     576        psF32           norm;
     577
     578        dbh = psDBInit("localhost", "test", NULL, "test");
     579        if (!dbh) {
     580            exit(EXIT_FAILURE);
     581        }
     582
     583        if (!detNormalizedStatImfilePop(dbh, &det_id, &iteration, (char **)&class_id, &norm)) {
     584            exit(EXIT_FAILURE);
     585        }
     586
     587        psDBCleanup(dbh);
     588    }
     589
     590    {
     591        psDB            *dbh;
     592        psS32           det_id;
     593        psS32           iteration;
     594        char            class_id[256];
    576595        char            uri[256];
    577596        char            recipe[256];
  • trunk/ippdb/tests/popfits.c

    r7461 r8368  
    700700        }
    701701
     702        if (!detNormalizedStatImfilePopFits(dbh, fits, 1)) {
     703            exit(EXIT_FAILURE);
     704        }
     705
     706        if (!psFitsClose(fits)) {
     707            exit(EXIT_FAILURE);
     708        }
     709
     710        psDBCleanup(dbh);
     711    }
     712
     713    {
     714        psDB            *dbh;
     715        psFits          *fits;
     716
     717        dbh = psDBInit("localhost", "test", NULL, "test");
     718        if (!dbh) {
     719            exit(EXIT_FAILURE);
     720        }
     721
     722        // allocate a temp
     723        fits = psFitsOpen(TMP_FILENAME, "w");
     724        if (!fits) {
     725            exit(EXIT_FAILURE);
     726        }
     727
    702728        if (!detNormalizedImfilePopFits(dbh, fits, 1)) {
    703729            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/popobject.c

    r7461 r8368  
    475475    {
    476476        psDB            *dbh;
     477        detNormalizedStatImfileRow *object;
     478
     479        dbh = psDBInit("localhost", "test", NULL, "test");
     480        if (!dbh) {
     481            exit(EXIT_FAILURE);
     482        }
     483
     484        object = detNormalizedStatImfilePopObject(dbh);
     485        if (!object) {
     486            exit(EXIT_FAILURE);
     487        }
     488
     489        psFree(object);
     490        psDBCleanup(dbh);
     491    }
     492
     493    {
     494        psDB            *dbh;
    477495        detNormalizedImfileRow *object;
    478496
  • trunk/ippdb/tests/selectrowsfits.c

    r7461 r8368  
    593593        }
    594594
     595        if (!detNormalizedStatImfileSelectRowsFits(dbh, fits, NULL, 1)) {
     596            exit(EXIT_FAILURE);
     597        }
     598
     599        psFree(fits);
     600        psDBCleanup(dbh);
     601    }
     602
     603    {
     604        psDB            *dbh;
     605        psFits          *fits;
     606
     607        dbh = psDBInit("localhost", "test", NULL, "test");
     608        if (!dbh) {
     609            exit(EXIT_FAILURE);
     610        }
     611
     612        fits = psFitsOpen(TMP_FILENAME, "w");
     613        if (!fits) {
     614            exit(EXIT_FAILURE);
     615        }
     616
    595617        if (!detNormalizedImfileSelectRowsFits(dbh, fits, NULL, 1)) {
    596618            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.