Add in missing constant_directive.i test

This commit is contained in:
William S Fulton 2014-12-18 07:06:52 +00:00
commit 70a04c9ffe

View file

@ -0,0 +1,28 @@
%module constant_directive
// %constant and struct
%{
struct Type1 {
Type1(int val = 0) : val(val) {}
int val;
};
static Type1 TYPE1_CONSTANT1(1);
static Type1 TYPE1_CONST2(2);
static Type1 TYPE1_CONST3(3);
%}
struct Type1 {
Type1(int val = 0) : val(val) {}
int val;
};
%inline %{
Type1 getType1Instance() { return Type1(111); }
%}
%constant Type1 TYPE1_CONSTANT1;
%constant Type1 TYPE1_CONSTANT2 = TYPE1_CONST2;
%constant Type1 *TYPE1_CONSTANT3 = &TYPE1_CONST3;
%constant int TYPE_INT = 0;