IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4354


Ignore:
Timestamp:
Jun 22, 2005, 2:27:47 PM (21 years ago)
Author:
jhoblitt
Message:

improved tests

File:
1 edited

Legend:

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

    r4332 r4354  
    55#include <stdlib.h>
    66
     7#define MAX_STRING_LENGTH 1024
     8
    79int main ()
    810{
    911    psMetadata      *md;
    1012    [% indented(object_name, "*object") %];
     13    bool            status;
    1114
    1215    object = [% object_name %]Alloc(
     
    2528    }
    2629
     30    psFree(object);
     31
     32[% FOREACH item = columns -%]
     33[% IF item.type == "S32" or item.type == "F32" or item.type == "F64" -%]
     34    if (!psMetadataLookup[% item.type %](&status, md, "[% item.name %]") == [% item.test %]) {
     35[% ELSIF item.type == "STR" -%]
     36    if (strncmp(psMetadataLookupPtr(&status, md, "[% item.name %]"), [% item.test %], MAX_STRING_LENGTH)) {
     37[% ELSIF item.type == "BOOL" -%]
     38    if (!psMetadataLookupBool(&status, md, "[% item.name %]") == [% item.test %]) {
     39[% END -%]
     40        psFree(md);
     41        exit(EXIT_FAILURE);
     42    }
     43[% END -%]
     44
    2745    psFree(md);
    28     psFree(object);
    2946
    3047    exit(EXIT_SUCCESS);
Note: See TracChangeset for help on using the changeset viewer.