1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2009 - INRIA - Serge Steer
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
8 // <-- CLI SHELL MODE -->
9 // <-- Non-regression test for bug 2509 -->
11 // <-- Bugzilla URL -->
12 // http://bugzilla.scilab.org/show_bug.cgi?id=2509
14 // <-- Short Description -->
15 // execstr forgets to store the function name and line number when in the errcatch mode
16 prot=funcprot();funcprot(0);
18 deff("foo","a=aaaa","n")
19 if execstr("foo()","errcatch")==0 then bugmes();quit;end
20 [str,n,l,f]=lasterror(%t);
21 if l<>2|f<>"foo" then bugmes();quit;end
25 [str,n,l,f]=lasterror(%t);
26 if l<>2|f<>"foo" then bugmes();quit;end;
28 if exec(foo,"errcatch")==0 then bugmes();quit;end
29 [str,n,l,f]=lasterror(%t);
30 if l<>2|f<>"foo" then bugmes();quit;end
33 if execstr("foo()","errcatch")==0 then bugmes();quit;end
34 [str,n,l,f]=lasterror(%t);
35 if l<>2|f<>"foo" then bugmes();quit;end
39 [str,n,l,f]=lasterror(%t);
40 if l<>2|f<>"foo" then bugmes();quit;end;
42 if exec(foo,"errcatch")==0 then bugmes();quit;end
43 [str,n,l,f]=lasterror(%t);
44 if l<>2|f<>"foo" then bugmes();quit;end
47 if execstr(foo,"errcatch")==0 then bugmes();quit;end
48 [str,n,l,f]=lasterror(%t);
49 if l<>2|f<>"" then bugmes();quit;end
51 deff("foo","execstr(''a=aaaa'')")
52 if execstr("foo()","errcatch")==0 then bugmes();quit;end
53 [str,n,l,f]=lasterror(%t);
54 if l<>1|f<>"foo" then bugmes();quit;end