scilab: roll back on primitive typemaps: return Scilab double on signed integers

This commit is contained in:
Simon Marchetto 2014-01-30 11:00:47 +01:00
commit a6f824a9a8
5 changed files with 81 additions and 106 deletions

View file

@ -1,32 +1,32 @@
exec("swigtest.start", -1);
// Char
if typeof(returnChar()) <> "string" then swigtesterror(); end
if returnChar() <> "a" then swigtesterror(); end
if typeof(returnSignedChar()) <> "int8" then swigtesterror(); end
if returnSignedChar() <> int8(42) then swigtesterror(); end
if typeof(returnUnsignedChar()) <> "uint8" then swigtesterror(); end
if returnUnsignedChar() <> uint8(42) then swigtesterror(); end
if typeof(returnChar()) <> "string" then swigtesterror(); end
if returnChar() <> "a" then swigtesterror(); end
if typeof(returnShortAsInt16()) <> "int16" then swigtesterror(); end
if returnShortAsInt16() <> int16(42) then swigtesterror(); end
if typeof(returnSignedShortAsInt16()) <> "int16" then swigtesterror(); end
if returnSignedShortAsInt16() <> int16(42) then swigtesterror(); end
// Short
if typeof(returnShort()) <> "constant" then swigtesterror(); end
if returnShort() <> 42 then swigtesterror(); end
if typeof(returnUnsignedShort()) <> "uint16" then swigtesterror(); end
if returnUnsignedShort() <> uint16(42) then swigtesterror(); end
if typeof(returnIntAsInt32()) <> "int32" then swigtesterror(); end
if returnIntAsInt32() <> int32(42) then swigtesterror(); end
if typeof(returnSignedIntAsInt32()) <> "int32" then swigtesterror(); end
if returnSignedIntAsInt32() <> int32(42) then swigtesterror(); end
if typeof(returnLongAsInt32()) <> "int32" then swigtesterror(); end
if returnLongAsInt32() <> int32(42) then swigtesterror(); end
if typeof(returnSignedLongAsInt32()) <> "int32" then swigtesterror(); end
if returnSignedLongAsInt32() <> int32(42) then swigtesterror(); end
// Int
if typeof(returnInt()) <> "constant" then swigtesterror(); end
if returnInt() <> 42 then swigtesterror(); end
if typeof(returnUnsignedInt()) <> "uint32" then swigtesterror(); end
if returnUnsignedInt() <> uint32(42) then swigtesterror(); end
// Long
if typeof(returnLong()) <> "constant" then swigtesterror(); end
if returnLong() <> 42 then swigtesterror(); end
if typeof(returnUnsignedLong()) <> "uint32" then swigtesterror(); end
if returnUnsignedLong() <> uint32(42) then swigtesterror(); end
// Double & float
if typeof(returnDouble()) <> "constant" then swigtesterror(); end
if returnDouble() <> 42.42 then swigtesterror(); end
if typeof(returnFloat()) <> "constant" then swigtesterror(); end