IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 6, 2006, 6:46:10 PM (21 years ago)
Author:
jhoblitt
Message:

fix tests to work with per table data
minor pslib 0.9.0 compatibility fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/glueforge/templates/psdb/insertfits_c.tt

    r5907 r5950  
    55int main ()
    66{
    7     psDB            *dbh;
    8     psFits          *fits;
     7[% FOREACH table = tables -%]
     8    {
     9        psDB            *dbh;
     10        psFits          *fits;
    911
    10     dbh = psDBInit("localhost", "test", NULL, "test");
    11     if (!dbh) {
    12         exit(EXIT_FAILURE);
     12        dbh = psDBInit("localhost", "test", NULL, "test");
     13        if (!dbh) {
     14            exit(EXIT_FAILURE);
     15        }
     16
     17        // open a temp
     18        fits = psFitsOpen("./blargh", "rw");
     19        if (!fits) {
     20            exit(EXIT_FAILURE);
     21        }
     22
     23        if (![% table.namespace %]InsertFits(dbh, fits)) {
     24            exit(EXIT_FAILURE);
     25        }
     26
     27        psFree(fits);
     28        psDBCleanup(dbh);
    1329    }
    1430
    15     // open a temp
    16     fits = psFitsAlloc("./blargh");
    17     if (!fits) {
    18         exit(EXIT_FAILURE);
    19     }
    20 
    21     if (![% table.namespace %]InsertFits(dbh, fits)) {
    22         exit(EXIT_FAILURE);
    23     }
    24 
    25     psFree(fits);
    26     psDBCleanup(dbh);
    27 
     31[% END -%]
    2832    exit(EXIT_SUCCESS);
    2933}
Note: See TracChangeset for help on using the changeset viewer.