scilab: STL containers of int accept doubles in input
This commit is contained in:
parent
4cca1f67cb
commit
2e2d1afc4d
3 changed files with 9 additions and 6 deletions
|
|
@ -61,10 +61,6 @@ function testSequenceContainer(container, value_type, value1, value2, expected_a
|
||||||
checkerror(ierr, cmd);
|
checkerror(ierr, cmd);
|
||||||
if ~isdef('c') | ~isequal(c, [value1, value2]) then swigtesterror(); end
|
if ~isdef('c') | ~isequal(c, [value1, value2]) then swigtesterror(); end
|
||||||
|
|
||||||
if (value_type == "int") then
|
|
||||||
c = int32(c);
|
|
||||||
end
|
|
||||||
|
|
||||||
// test sequence container passed as value of function
|
// test sequence container passed as value of function
|
||||||
cmd = msprintf("s = val_%s_%s(c);", value_type, container);
|
cmd = msprintf("s = val_%s_%s(c);", value_type, container);
|
||||||
ierr = execstr(cmd, "errcatch");
|
ierr = execstr(cmd, "errcatch");
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ if ~exists("isum") | (isum <> 10) then swigtesterror(); end
|
||||||
iset2 = create_integer_set(3, 6);
|
iset2 = create_integer_set(3, 6);
|
||||||
if ~exists("iset2") | ~isequal(iset2, [3 4 5 6]) then swigtesterror(); end
|
if ~exists("iset2") | ~isequal(iset2, [3 4 5 6]) then swigtesterror(); end
|
||||||
// concat the two sets with concat_integer_set():");
|
// concat the two sets with concat_integer_set():");
|
||||||
iset3 = concat_integer_set(int32(iset), int32(iset2));
|
iset3 = concat_integer_set(int32(iset), iset2);
|
||||||
if ~exists("iset3") | ~isequal(iset3, [1 2 3 4 5 6]) then swigtesterror(); end
|
if ~exists("iset3") | ~isequal(iset3, [1 2 3 4 5 6]) then swigtesterror(); end
|
||||||
|
|
||||||
// string sets
|
// string sets
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ SWIGINTERN int
|
||||||
SWIG_AsCheck_Sequence_dec(int)(SwigSciObject _obj) {
|
SWIG_AsCheck_Sequence_dec(int)(SwigSciObject _obj) {
|
||||||
SciErr sciErr;
|
SciErr sciErr;
|
||||||
int *piAddrVar;
|
int *piAddrVar;
|
||||||
|
int iType = 0;
|
||||||
|
|
||||||
sciErr = getVarAddressFromPosition(pvApiCtx, _obj, &piAddrVar);
|
sciErr = getVarAddressFromPosition(pvApiCtx, _obj, &piAddrVar);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
|
|
@ -19,7 +20,13 @@ SWIG_AsCheck_Sequence_dec(int)(SwigSciObject _obj) {
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isIntegerType(pvApiCtx, piAddrVar))
|
sciErr = getVarType(pvApiCtx, piAddrVar, &iType);
|
||||||
|
if (sciErr.iErr) {
|
||||||
|
printError(&sciErr, 0);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((iType == sci_matrix) || (iType == sci_ints))
|
||||||
{
|
{
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue