File: 03typemap.t

package info (click to toggle)
libinline-perl 0.44-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 440 kB
  • ctags: 121
  • sloc: perl: 3,768; makefile: 38
file content (25 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use File::Spec;
use lib (File::Spec->catdir(File::Spec->updir(),'blib','lib'), File::Spec->catdir(File::Spec->curdir(),'blib','lib'));
use strict;
use Test;
use diagnostics;
use Inline Config => DIRECTORY => '_Inline_test';

plan(tests => 1,
     todo => [],
     onfail => sub {},
    );

use Inline C => DATA =>
           TYPEMAPS => File::Spec->catfile(File::Spec->curdir(),'t','typemap');

# test 1
ok(int((add_em_up(1.2, 3.4) + 0.001) * 10) == 46);

__END__

__C__

float add_em_up(float x, float y) {
    return x + y;
}