From: <wsf...@us...> - 2011-02-19 01:16:53
|
Revision: 12476 http://swig.svn.sourceforge.net/swig/?rev=12476&view=rev Author: wsfulton Date: 2011-02-19 01:16:47 +0000 (Sat, 19 Feb 2011) Log Message: ----------- Add Octave test of global constants when accessed from a function reported by Alan W Irwin as previously not working Added Paths: ----------- trunk/Examples/test-suite/octave/preproc_constants_runme.m Added: trunk/Examples/test-suite/octave/preproc_constants_runme.m =================================================================== --- trunk/Examples/test-suite/octave/preproc_constants_runme.m (rev 0) +++ trunk/Examples/test-suite/octave/preproc_constants_runme.m 2011-02-19 01:16:47 UTC (rev 12476) @@ -0,0 +1,24 @@ +preproc_constants + +assert(CONST_INT1, 10) +assert(CONST_DOUBLE3, 12.3) +assert(CONST_BOOL1, true) +assert(CONST_CHAR, 'x') +assert(CONST_STRING1, "const string") + +# Test global constants can be seen within functions +function test_global() +global CONST_INT1 +global CONST_DOUBLE3 +global CONST_BOOL1 +global CONST_CHAR +global CONST_STRING1 + +assert(CONST_INT1, 10) +assert(CONST_DOUBLE3, 12.3) +assert(CONST_BOOL1, true) +assert(CONST_CHAR, 'x') +assert(CONST_STRING1, "const string") +endfunction + +test_global This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |