From 742aa4c0f475733f12f2394ceda659f8e37ced15 Mon Sep 17 00:00:00 2001 From: Steffen Mueller Date: Thu, 22 Nov 2012 08:03:16 +0100 Subject: Add additional tests for T_BOOL typemap Unlike the existing tests, these new tests don't use RETVAL. --- ext/XS-Typemap/Typemap.pm | 1 + ext/XS-Typemap/Typemap.xs | 7 +++++++ ext/XS-Typemap/t/Typemap.t | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1