From e4a46764506bf33c762a87a5fc34fac112abf14d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 7 Feb 2003 22:14:14 +0000 Subject: [PATCH] Tests all sorts of bools git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4267 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Examples/test-suite/bools.i | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 SWIG/Examples/test-suite/bools.i diff --git a/SWIG/Examples/test-suite/bools.i b/SWIG/Examples/test-suite/bools.i new file mode 100644 index 000000000..71431c378 --- /dev/null +++ b/SWIG/Examples/test-suite/bools.i @@ -0,0 +1,39 @@ +// bool typemaps check +%module bools + +// bool constant +%constant bool constbool=false; + +%inline %{ + +// bool variables +bool bool1 = true; +bool bool2 = false; +bool* pbool = &bool1; +bool& rbool = bool2; +const bool* const_pbool = pbool; +const bool& const_rbool = rbool; + +// bool functions +bool bo(bool b) { + return b; +} +bool& rbo(bool& b) { + return b; +} +bool* pbo(bool* b) { + return b; +} +const bool& const_rbo(const bool& b) { + return b; +} +const bool* const_pbo(const bool* b) { + return b; +} + +// helper function +bool value(bool* b) { + return *b; +} +%} +