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/pop_c.tt

    r5907 r5950  
    77int main ()
    88{
    9     psDB            *dbh;
     9[% FOREACH table = tables -%]
     10    {
     11        psDB            *dbh;
    1012[% FOREACH item = table.columns -%]
    1113[% IF item.type == "STR" -%]
    12     [% indented("char", "$item.name[256]") %];
     14        [% indented("char", "$item.name[256]") %];
    1315[% ELSE-%]
    14     [% indented("$item.ctype", "$item.name") %];
     16        [% indented("$item.ctype", "$item.name") %];
    1517[% END -%]
    1618[% END -%]
    1719
    18     dbh = psDBInit("localhost", "test", NULL, "test");
    19     if (!dbh) {
    20         exit(EXIT_FAILURE);
    21     }
     20        dbh = psDBInit("localhost", "test", NULL, "test");
     21        if (!dbh) {
     22            exit(EXIT_FAILURE);
     23        }
    2224
    23     if (![% table.namespace %]Pop(dbh,
     25        if (![% table.namespace %]Pop(dbh,
    2426[%- SET i = 0 -%]
    2527[% FOREACH item = table.columns -%]
     
    3133[% END -%]
    3234[% END %])) {
    33         exit(EXIT_FAILURE);
     35            exit(EXIT_FAILURE);
     36        }
     37
     38        psDBCleanup(dbh);
    3439    }
    3540
    36     psDBCleanup(dbh);
    37 
     41[% END -%]
    3842    exit(EXIT_SUCCESS);
    3943}
Note: See TracChangeset for help on using the changeset viewer.