IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10110 for trunk/ippdb/tests


Ignore:
Timestamp:
Nov 20, 2006, 1:58:03 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.57

Location:
trunk/ippdb/tests
Files:
11 edited

Legend:

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

    r10060 r10110  
    99{
    1010    {
     11        expTagCounterRow *object;
     12
     13        object = expTagCounterRowAlloc(64    );
     14
     15        if (!object) {
     16            exit(EXIT_FAILURE);
     17        }
     18
     19            psFree(object);
     20            exit(EXIT_FAILURE);
     21        }
     22
     23        psFree(object);
     24    }
     25
     26    {
    1127        summitExpRow    *object;
    1228
     
    224240        newExpRow       *object;
    225241
    226         object = newExpRowAlloc(64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32    );
    227 
    228         if (!object) {
    229             exit(EXIT_FAILURE);
    230         }
    231 
     242        object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32    );
     243
     244        if (!object) {
     245            exit(EXIT_FAILURE);
     246        }
     247
     248        if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) {
    232249            psFree(object);
    233250            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/createtable.c

    r10060 r10110  
    1313        }
    1414
     15        if(!expTagCounterCreateTable(dbh)) {
     16            exit(EXIT_FAILURE);
     17        }
     18
     19        psDBCleanup(dbh);
     20    }
     21
     22    {
     23        psDB            *dbh;
     24
     25        dbh = psDBInit("localhost", "test", NULL, "test");
     26        if (!dbh) {
     27            exit(EXIT_FAILURE);
     28        }
     29
    1530        if(!summitExpCreateTable(dbh)) {
    1631            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/dbcleanup.c

    r10060 r10110  
    1111    }
    1212
     13    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS expTagCounter");
    1314    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS summitExp");
    1415    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS summitImfile");
  • trunk/ippdb/tests/dbsetup.c

    r10060 r10110  
    1313
    1414    // remove the table if it already exists
     15    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS expTagCounter");
     16    expTagCounterCreateTable(dbh);
     17
    1518    p_psDBRunQuery(dbh, "DROP TABLE IF EXISTS summitExp");
    1619    summitExpCreateTable(dbh);
  • trunk/ippdb/tests/droptable.c

    r10060 r10110  
    1313        }
    1414
     15        if (!expTagCounterDropTable(dbh)) {
     16            exit(EXIT_FAILURE);
     17        }
     18
     19        psDBCleanup(dbh);
     20    }
     21
     22    {
     23        psDB            *dbh;
     24
     25        dbh = psDBInit("localhost", "test", NULL, "test");
     26        if (!dbh) {
     27            exit(EXIT_FAILURE);
     28        }
     29
    1530        if (!summitExpDropTable(dbh)) {
    1631            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r10060 r10110  
    1313        }
    1414
     15        if (!expTagCounterInsert(dbh, 64)) {
     16            exit(EXIT_FAILURE);
     17        }
     18
     19        psDBCleanup(dbh);
     20    }
     21
     22    {
     23        psDB            *dbh;
     24
     25        dbh = psDBInit("localhost", "test", NULL, "test");
     26        if (!dbh) {
     27            exit(EXIT_FAILURE);
     28        }
     29
    1530        if (!summitExpInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32)) {
    1631            exit(EXIT_FAILURE);
     
    103118        }
    104119
    105         if (!newExpInsert(dbh, 64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32)) {
     120        if (!newExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32)) {
    106121            exit(EXIT_FAILURE);
    107122        }
  • trunk/ippdb/tests/insertfits.c

    r10060 r10110  
    2424        }
    2525
     26        if (!expTagCounterInsertFits(dbh, fits)) {
     27            exit(EXIT_FAILURE);
     28        }
     29
     30        if (!psFitsClose(fits)) {
     31            exit(EXIT_FAILURE);
     32        }
     33
     34        psDBCleanup(dbh);
     35    }
     36
     37    {
     38        psDB            *dbh;
     39        psFits          *fits;
     40
     41        dbh = psDBInit("localhost", "test", NULL, "test");
     42        if (!dbh) {
     43            exit(EXIT_FAILURE);
     44        }
     45
     46        // open a temp
     47        fits = psFitsOpen(TMP_FILENAME, "r");
     48        if (!fits) {
     49            exit(EXIT_FAILURE);
     50        }
     51
    2652        if (!summitExpInsertFits(dbh, fits)) {
    2753            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insertobject.c

    r10060 r10110  
    77    {
    88        psDB            *dbh;
     9        expTagCounterRow *object;
     10
     11        dbh = psDBInit("localhost", "test", NULL, "test");
     12        if (!dbh) {
     13            exit(EXIT_FAILURE);
     14        }
     15
     16        object = expTagCounterRowAlloc(64);
     17        if (!object) {
     18            exit(EXIT_FAILURE);
     19        }
     20
     21        if (!expTagCounterInsertObject(dbh, object)) {
     22            exit(EXIT_FAILURE);
     23        }
     24
     25        psFree(object);
     26        psDBCleanup(dbh);
     27    }
     28
     29    {
     30        psDB            *dbh;
    931        summitExpRow    *object;
    1032
     
    146168        }
    147169
    148         object = newExpRowAlloc(64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32);
     170        object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32);
    149171        if (!object) {
    150172            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r10060 r10110  
    1010    {
    1111        psMetadata      *md;
     12        expTagCounterRow *object;
     13        bool            status;
     14
     15        object = expTagCounterRowAlloc(64);
     16        if (!object) {
     17            exit(EXIT_FAILURE);
     18        }
     19
     20        md = expTagCounterMetadataFromObject(object);
     21        if (!md) {
     22            exit(EXIT_FAILURE);
     23        }
     24
     25        psFree(object);
     26
     27            psFree(md);
     28            exit(EXIT_FAILURE);
     29        }
     30
     31        psFree(md);
     32    }
     33
     34    {
     35        psMetadata      *md;
    1236        summitExpRow    *object;
    1337        bool            status;
     
    274298        bool            status;
    275299
    276         object = newExpRowAlloc(64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32);
     300        object = newExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32);
    277301        if (!object) {
    278302            exit(EXIT_FAILURE);
     
    286310        psFree(object);
    287311
     312        if (strncmp(psMetadataLookupPtr(&status, md, "exp_tag"), "a string", MAX_STRING_LENGTH)) {
    288313            psFree(md);
    289314            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r10060 r10110  
    1010    {
    1111        psMetadata      *md;
     12        expTagCounterRow *object;
     13
     14        md = psMetadataAlloc();
     15            psFree(md);
     16            exit(EXIT_FAILURE);
     17        }
     18
     19        object = expTagCounterObjectFromMetadata(md);
     20        if (!object) {
     21            psFree(md);
     22            exit(EXIT_FAILURE);
     23        }
     24
     25        psFree(md);
     26
     27            psFree(object);
     28            exit(EXIT_FAILURE);
     29        }
     30
     31        psFree(object);
     32    }
     33
     34    {
     35        psMetadata      *md;
    1236        summitExpRow    *object;
    1337
     
    391415
    392416        md = psMetadataAlloc();
     417        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_tag", 0, NULL, "a string")) {
    393418            psFree(md);
    394419            exit(EXIT_FAILURE);
     
    426451        psFree(md);
    427452
     453        if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) {
    428454            psFree(object);
    429455            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/selectrowsfits.c

    r10060 r10110  
    2121        }
    2222
     23        if (!expTagCounterSelectRowsFits(dbh, fits, NULL, 1)) {
     24            exit(EXIT_FAILURE);
     25        }
     26
     27        psFree(fits);
     28        psDBCleanup(dbh);
     29    }
     30
     31    {
     32        psDB            *dbh;
     33        psFits          *fits;
     34
     35        dbh = psDBInit("localhost", "test", NULL, "test");
     36        if (!dbh) {
     37            exit(EXIT_FAILURE);
     38        }
     39
     40        fits = psFitsOpen(TMP_FILENAME, "w");
     41        if (!fits) {
     42            exit(EXIT_FAILURE);
     43        }
     44
    2345        if (!summitExpSelectRowsFits(dbh, fits, NULL, 1)) {
    2446            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.