summaryrefslogtreecommitdiff
path: root/ext/XS-Typemap
diff options
context:
space:
mode:
authorSteffen Mueller <smueller@cpan.org>2012-11-22 08:03:16 +0100
committerSteffen Mueller <smueller@cpan.org>2012-11-22 08:06:17 +0100
commit742aa4c0f475733f12f2394ceda659f8e37ced15 (patch)
tree95275748e67f38cc609b51abd5a115c672498262 /ext/XS-Typemap
parentb3efb2487fa7bdef70865822dabaa2dc0000dde1 (diff)
downloadperl-742aa4c0f475733f12f2394ceda659f8e37ced15.tar.gz
Add additional tests for T_BOOL typemap
Unlike the existing tests, these new tests don't use RETVAL.
Diffstat (limited to 'ext/XS-Typemap')
-rw-r--r--ext/XS-Typemap/Typemap.pm1
-rw-r--r--ext/XS-Typemap/Typemap.xs7
-rw-r--r--ext/XS-Typemap/t/Typemap.t7
3 files changed, 14 insertions, 1 deletions
diff --git a/ext/XS-Typemap/Typemap.pm b/ext/XS-Typemap/Typemap.pm
index 7132f725eb..61f41228b1 100644
--- a/ext/XS-Typemap/Typemap.pm
+++ b/ext/XS-Typemap/Typemap.pm
@@ -54,6 +54,7 @@ $VERSION = '0.08';
T_INT
T_ENUM
T_BOOL
+ T_BOOL_2
T_U_INT
T_SHORT
T_U_SHORT
diff --git a/ext/XS-Typemap/Typemap.xs b/ext/XS-Typemap/Typemap.xs
index 3dc5b88a9d..cac9466b62 100644
--- a/ext/XS-Typemap/Typemap.xs
+++ b/ext/XS-Typemap/Typemap.xs
@@ -436,6 +436,13 @@ T_BOOL( in )
OUTPUT:
RETVAL
+bool
+T_BOOL_2( in )
+ bool in
+ CODE:
+ OUTPUT:
+ in
+
## T_U_INT
diff --git a/ext/XS-Typemap/t/Typemap.t b/ext/XS-Typemap/t/Typemap.t
index 2a3f25e95f..de0bf6dd03 100644
--- a/ext/XS-Typemap/t/Typemap.t
+++ b/ext/XS-Typemap/t/Typemap.t
@@ -6,7 +6,7 @@ BEGIN {
}
}
-use Test::More tests => 140;
+use Test::More tests => 144;
use strict;
use warnings;
@@ -150,6 +150,11 @@ ok( ! T_BOOL(0) );
ok( ! T_BOOL('') );
ok( ! T_BOOL(undef) );
+ok( T_BOOL_2(52) );
+ok( ! T_BOOL_2(0) );
+ok( ! T_BOOL_2('') );
+ok( ! T_BOOL_2(undef) );
+
# T_U_SHORT aka U16
note("T_U_SHORT");
is( T_U_SHORT(32000), 32000);