Add regression test for << in array size bug

Go is happy with the testcase if the type is changed from int to
char, so just go with that.

See https://sourceforge.net/p/swig/bugs/983/
This commit is contained in:
Olly Betts 2023-04-20 14:55:09 +12:00
parent c538bd24c4
commit 3275331886
2 changed files with 5 additions and 1 deletions

View File

@ -73,4 +73,8 @@ typedef struct {
cartPosition_t p; cartPosition_t p;
} CartPoseData_t; } CartPoseData_t;
/* Test left shift in array size doesn't trigger "Bad template type" error.
* Regression test for https://sourceforge.net/p/swig/bugs/983/ */
char array_shifted_size[(1<<2)];
%} %}

View File

@ -4,7 +4,7 @@ require "tests.php";
check::functions(array('fn_taking_arrays','newintpointer','setintfrompointer','getintfrompointer','array_pointer_func')); check::functions(array('fn_taking_arrays','newintpointer','setintfrompointer','getintfrompointer','array_pointer_func'));
check::classes(array('arrays','SimpleStruct','ArrayStruct','CartPoseData_t')); check::classes(array('arrays','SimpleStruct','ArrayStruct','CartPoseData_t'));
check::globals(array()); check::globals(array('array_shifted_size'));
$ss=new simplestruct(); $ss=new simplestruct();
check::classname('simplestruct',$ss); check::classname('simplestruct',$ss);