// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2009-2010 - DIGITEO - Pierre MARECHAL
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- CLI SHELL MODE -->
// <-- Non-regression test for bug 4064 -->
//
// <-- Bugzilla URL -->
// http://bugzilla.scilab.org/show_bug.cgi?id=4064
//
// <-- Short Description -->
// IsXString() crashes with 2 matrices and inputs
loadXcosLibs();
ilib_verbose(0);
function f = myf(x)
f = [x' y'];
endfunction
function myg = myg(x)
myg = [x' z'];
endfunction
function [x1, x2, x3] = myp(x)
x1 = x(1, 1);
x2 = x(2, 1);
x3 = x(3, 1);
endfunction
funcprot = ["GRAPHIC";"INTERP";"MyGate"];
func = "myf";
[x1, x2, x3] = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
assert_checkequal(x2, "5");
assert_checkequal(x3, "5");
x1 = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
funcprot = ["GRAPHIC";"INTERP";"MyGate"];
func = "myg";
[x1, x2, x3] = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
assert_checkequal(x2, "5");
assert_checkequal(x3, "5");
x1 = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
funcprot = ["GRAPHIC";"INTERP";"MyGate"];
func = "myp";
[x1, x2, x3] = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
assert_checkequal(x2, "5");
assert_checkequal(x3, "5");
x1 = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
funcprot = ["GRAPHIC";"INTERP";"MyGate"];
func = "myf";
[x1, x2, x3] = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
assert_checkequal(x2, "5");
assert_checkequal(x3, "5");
x1 = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
funcprot = ["GRAPHIC";"INTERP";"MyGate"];
func = "myg";
[x1, x2, x3] = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
assert_checkequal(x2, "5");
assert_checkequal(x3, "5");
x1 = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
funcprot = ["GRAPHIC";"INTERP";"MyGate"];
func = "myp";
[x1, x2, x3] = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
assert_checkequal(x2, "5");
assert_checkequal(x3, "5");
x1 = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
% =============================================================================
// Test the error
% This function uses %MAIN so should trigger a call
funcprot = ["GRAPHIC";"INTERP";"MyGate"];
func = "myp";
[x1, x2, x3] = ScilabGraph(funcprot,func,[5 5],[],"c");
assert_checkequal(x1, "5");
assert_checkequal(x2, "5");
assert_checkequal(x3, "5");
assert_checkerror("x1 = ScilabGraph(funcprot,func,[5 5],[],"c");",...
"This function uses %MAIN which should be called only if compiling a module. Use the function 'myp' instead.");
clear func prot funcprot x1 x2 x3;