scilab: fix line number error in swigtesterror()

This commit is contained in:
Simon Marchetto 2014-03-28 09:53:54 +01:00
commit b58d996743

View file

@ -36,8 +36,8 @@ end
// Error management function // Error management function
function swigtesterror(msg) function swigtesterror(msg)
[lines, names] = where(); [lines, names] = where();
if size(lines, '*') > 1 if size(lines, '*') > 0
mfprintf(0, "*** TEST FAILED (at line %d) ***\n", lines(2)); mfprintf(0, "*** TEST FAILED (at line %d) ***\n", lines($));
if argn(2) >= 1 then disp(msg); end if argn(2) >= 1 then disp(msg); end
else else
mfprintf(0, "*** TEST FAILED ***\n"); mfprintf(0, "*** TEST FAILED ***\n");
@ -45,6 +45,7 @@ function swigtesterror(msg)
exit(1) exit(1)
endfunction endfunction
// Check equal function
function checkequal(returned, expected, message) function checkequal(returned, expected, message)
if typeof(returned) <> typeof(expected) then if typeof(returned) <> typeof(expected) then
returned_type_msg = ["returned type:"; typeof(returned)]; returned_type_msg = ["returned type:"; typeof(returned)];