scilab: new test for constants (scilabconst)
This commit is contained in:
parent
8dfd458ab0
commit
d8135e7387
3 changed files with 76 additions and 1 deletions
42
Examples/test-suite/scilab_consts.i
Normal file
42
Examples/test-suite/scilab_consts.i
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
%module scilab_consts
|
||||
|
||||
/* Default mode: constants are wrapped as getter functions */
|
||||
%scilabconst(0);
|
||||
|
||||
#define ICONST0 42
|
||||
#define FCONST0 2.1828
|
||||
#define CCONST0 'x'
|
||||
#define CCONST0_2 '\n'
|
||||
#define SCONST0 "Hello World"
|
||||
#define SCONST0_2 "\"Hello World\""
|
||||
|
||||
/* Expressions should work too */
|
||||
#define EXPR0 ICONST0 + 3*FCONST0
|
||||
|
||||
/* This shouldn't do anything, bar is not defined */
|
||||
#define BAR0 bar
|
||||
|
||||
/* SWIG directive %constant produces constants too */
|
||||
%constant int iconst0 = 37;
|
||||
%constant double fconst0 = 42.2;
|
||||
|
||||
|
||||
/* Alternative mode: constants are wrapped as variables */
|
||||
%scilabconst(1);
|
||||
|
||||
#define ICONST1 42
|
||||
#define FCONST1 2.1828
|
||||
#define CCONST1 'x'
|
||||
#define CCONST1_2 '\n'
|
||||
#define SCONST1 "Hello World"
|
||||
#define SCONST1_2 "\"Hello World\""
|
||||
|
||||
/* Expressions should work too */
|
||||
#define EXPR1 ICONST1 + 3*FCONST1
|
||||
|
||||
/* This shouldn't do anything, bar is not defined */
|
||||
#define BAR1 bar
|
||||
|
||||
/* SWIG directive %constant produces constants too */
|
||||
%constant int iconst1 = 37;
|
||||
%constant double fconst1 = 42.2;
|
||||
Loading…
Add table
Add a link
Reference in a new issue