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

    r5907 r5950  
    99int main ()
    1010{
    11     [% indented(table.object_name, "*object") %];
     11[% FOREACH table = tables -%]
     12    {
     13        [% indented(table.object_name, "*object") %];
    1214
    13     object = [% table.object_name %]Alloc(
     15        object = [% table.object_name %]Alloc(
    1416[%- SET i = 0 -%]
    1517[%- FOREACH item = table.columns -%]
    16     [%- IF i == 0 -%][%- i = 1 -%][%- ELSE -%], [% END -%] [%- item.test -%]
     18        [%- IF i == 0 -%][%- i = 1 -%][%- ELSE -%], [% END -%] [%- item.test -%]
    1719[%- END -%]
    18 );
     20    );
    1921
    20     if (!object) {
    21         exit(EXIT_FAILURE);
    22     }
     22        if (!object) {
     23            exit(EXIT_FAILURE);
     24        }
    2325
    2426[% FOREACH item = table.columns -%]
    2527[% IF item.type == "S32" or item.type == "F32" or item.type == "F64" or item.type == "BOOL" -%]
    26     if (!object->[% item.name %] == [% item.test %]) {
     28        if (!object->[% item.name %] == [% item.test %]) {
    2729[% ELSIF item.type == "STR" -%]
    28     if (strncmp(object->[% item.name %], [% item.test %], MAX_STRING_LENGTH)) {
     30        if (strncmp(object->[% item.name %], [% item.test %], MAX_STRING_LENGTH)) {
    2931[% END -%]
    30         psFree(object);
    31         exit(EXIT_FAILURE);
    32     }
     32            psFree(object);
     33            exit(EXIT_FAILURE);
     34        }
    3335[% END -%]
    3436
    35     psFree(object);
     37        psFree(object);
     38    }
    3639
     40[% END -%]
    3741    exit(EXIT_SUCCESS);
    3842}
Note: See TracChangeset for help on using the changeset viewer.