IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4006


Ignore:
Timestamp:
May 20, 2005, 12:53:49 PM (21 years ago)
Author:
jhoblitt
Message:

add [foo]Alloc src & tests

Location:
trunk/glueforge
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/glueforge/glueforge.in

    r4005 r4006  
    33# Copyright (C) 2005  Joshua Hoblitt
    44#
    5 # $Id: glueforge.in,v 1.13 2005-05-20 03:32:11 jhoblitt Exp $
     5# $Id: glueforge.in,v 1.14 2005-05-20 22:53:49 jhoblitt Exp $
    66
    77use strict;
     
    7070        ctype   => $mdtypes->{ctype},
    7171        mtype   => $mdtypes->{mtype},
     72        test    => $mdtypes->{test},
    7273        comment => $elem->{comment},
    7374        value   => $elem->{value},
     
    7677
    7778$data{columns} = \@items;
     79
    7880
    7981$output = $data{pkg_name} unless defined $output;
     
    9193    'dbsetup_c.tt'          => "$output/tests/dbsetup.c",
    9294    'dbcleanup_c.tt'        => "$output/tests/dbcleanup.c",
     95    'alloc_c.tt'            => "$output/tests/alloc.c",
    9396    'init_c.tt'             => "$output/tests/init.c",
    94     'init_c.tt'             => "$output/tests/cleanup.c",
     97    'cleanup_c.tt'          => "$output/tests/cleanup.c",
    9598    'createtable_c.tt'      => "$output/tests/createtable.c",
    9699    'droptable_c.tt'        => "$output/tests/droptable.c",
     
    131134    my %ctypes = map { $_ => "ps$_" } keys %primitives;
    132135
     136    my %ttypes = (
     137        S8      => -8,
     138        S16     => -16,
     139        S32     => -32,
     140        S64     => -64,
     141        U8      => 8,
     142        U16     => 16,
     143        U32     => 32,
     144        U64     => 64,
     145        F32     => 32.32,
     146        F64     => 64.64,
     147    );
     148
    133149    if ( $primitives{$type} ) {
    134150        return {
    135151            ctype   => $ctypes{$type},
    136152            mtype   => $mtypes{$type},
     153            test    => $ttypes{$type},
    137154        };
    138155    } elsif ( $type =~ /STR|STRING/ ) {
     
    140157            ctype   => "char*",
    141158            mtype   => 'PS_META_STR',
     159            test    => '"a string"',
    142160        };
    143161    } elsif ( $type =~ /BOOL/ ) {
     
    145163            ctype   => "bool",
    146164            mtype   => 'PS_META_STR',
     165            test    => 'true',
    147166        };
    148167    } else {
  • trunk/glueforge/templates/psdb/code.tt

    r4005 r4006  
    22
    33#define [% namespace FILTER upper %]_TABLE_NAME "[% table_name %]"
     4
     5[% INCLUDE alloc.tt %]
    46
    57[% INCLUDE init.tt %]
  • trunk/glueforge/templates/psdb/tests_makefile_am.tt

    r4005 r4006  
    5151
    5252TESTS = \
     53        alloc \
    5354        init \
    5455        cleanup \
  • trunk/glueforge/templates/psdb/testsuite_at.tt

    r4005 r4006  
    22
    33AT_INIT
     4
     5[% INCLUDE alloc_at.tt %]
    46
    57#m4_include([init.at])
Note: See TracChangeset for help on using the changeset viewer.