Add Octave test of global constants when accessed from a function reported by Alan W Irwin as previously not working
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12476 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
81ae06d960
commit
90bcaa3117
1 changed files with 24 additions and 0 deletions
24
Examples/test-suite/octave/preproc_constants_runme.m
Normal file
24
Examples/test-suite/octave/preproc_constants_runme.m
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue