diff options
author | Pierre Marechal <pierre.marechal@scilab.org> | 2007-11-22 15:40:59 +0000 |
---|---|---|
committer | Pierre Marechal <pierre.marechal@scilab.org> | 2007-11-22 15:40:59 +0000 |
commit | 8fa056449fd90596fd0b5bc3ac21f44d55ac89fe (patch) | |
tree | 4bfb07a24de32143409c4f072349ed9542bb4924 /tests | |
parent | b5b2e807a6ad4d05446ea3e121a0bc21c8378398 (diff) | |
download | scilab-8fa056449fd90596fd0b5bc3ac21f44d55ac89fe.zip scilab-8fa056449fd90596fd0b5bc3ac21f44d55ac89fe.tar.gz |
Incoporate m2sci non-regression tests in the scilab source tree
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nonRegression/bug1636.sci | 54 | ||||
-rw-r--r-- | tests/nonRegression/bug1662.sci | 56 | ||||
-rw-r--r-- | tests/nonRegression/bug2333.sci | 20 | ||||
-rw-r--r-- | tests/nonRegression/bug2428.sci | 35 | ||||
-rw-r--r-- | tests/nonRegression/bug681.sci | 42 | ||||
-rw-r--r-- | tests/nonRegression/bug699.sci | 49 | ||||
-rw-r--r-- | tests/nonRegression/bug853.sci | 67 | ||||
-rw-r--r-- | tests/nonRegression/bug973.sci | 43 |
8 files changed, 0 insertions, 366 deletions
diff --git a/tests/nonRegression/bug1636.sci b/tests/nonRegression/bug1636.sci deleted file mode 100644 index bd7f18a..0000000 --- a/tests/nonRegression/bug1636.sci +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1636 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1636 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // When processing an m-file with multiple continuation lines in the | ||
8 | // initial funtion statement, i.e the first line, I received an index | ||
9 | // error in line 181 of m2sci_syntax. On investigation, I found the index | ||
10 | // k was zero and traced this to lines 141 and 171 which set k=k-1 after | ||
11 | // appending line k to line k-1. I have produced a modified | ||
12 | // m2sci_syntax.sci file with the line if k<> 1 then k=k-1; end instead of | ||
13 | // k=k-1 for lines 141 and 181 which seems to work OK. No errors and | ||
14 | // produces an sci file | ||
15 | |||
16 | // Copyright INRIA | ||
17 | // Scilab Project - F. Belahcene | ||
18 | |||
19 | MFILECONTENTS=["function A = bug1636(x,y,..."; | ||
20 | "z,t,..."; | ||
21 | "u,v,w,..."; | ||
22 | "z)"; | ||
23 | "a=x+y+z+t+u+v+w+z;"] | ||
24 | |||
25 | MFILE=TMPDIR+"/bug1636.m" | ||
26 | SCIFILE=TMPDIR+"/bug1636.sci" | ||
27 | |||
28 | mputl(MFILECONTENTS,MFILE); | ||
29 | mfile2sci(MFILE,TMPDIR,%f,%t); | ||
30 | SCIFILECONTENTS=mgetl(SCIFILE); | ||
31 | |||
32 | SCIFILECONTENTSREF=["function [A] = bug1636(x,y,z,t,u,v,w,z)"; | ||
33 | ""; | ||
34 | "// Ouput variables initialisation (not found in input variables)" | ||
35 | "A=[];"; | ||
36 | ""; | ||
37 | "// Display mode"; | ||
38 | "mode(0);" | ||
39 | ""; | ||
40 | "// Display warning for floating point exception"; | ||
41 | "ieee(1);"; | ||
42 | ""; | ||
43 | ""; | ||
44 | ""; | ||
45 | ""; | ||
46 | "a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),w),z);" | ||
47 | "endfunction"] | ||
48 | |||
49 | |||
50 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
51 | affich_result(%F,1636); | ||
52 | else | ||
53 | affich_result(%T,1636); | ||
54 | end | ||
diff --git a/tests/nonRegression/bug1662.sci b/tests/nonRegression/bug1662.sci deleted file mode 100644 index db30f7b..0000000 --- a/tests/nonRegression/bug1662.sci +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1662 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1662 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // when converting Matlab switch case statements to Scilab select case | ||
8 | // statements using m2sci_syntax , if there is a comment line between the | ||
9 | // switch and case statement in the m file, the sytnax is rejected with an | ||
10 | // incorrect syntax error. Take the comment out and it works fine. Not a | ||
11 | // major problem but a slight nuisance | ||
12 | |||
13 | // Copyright INRIA | ||
14 | // Scilab Project - F. Belahcene | ||
15 | |||
16 | |||
17 | MFILECONTENTS=["function y=bug1662(x)"; | ||
18 | "switch x % comment1"; | ||
19 | "% comment2"; | ||
20 | "case x>0 then y=''positive''"; | ||
21 | "case x<0 then y=''negative''"; | ||
22 | "else y=''null''"; | ||
23 | "end"] | ||
24 | |||
25 | MFILE=TMPDIR+"/bug1662.m" | ||
26 | SCIFILE=TMPDIR+"/bug1662.sci" | ||
27 | |||
28 | mputl(MFILECONTENTS,MFILE); | ||
29 | mfile2sci(MFILE,TMPDIR,%f,%t); | ||
30 | SCIFILECONTENTS=mgetl(SCIFILE); | ||
31 | |||
32 | SCIFILECONTENTSREF=["function [y] = bug1662(x)"; | ||
33 | "" | ||
34 | "// Ouput variables initialisation (not found in input variables)"; | ||
35 | "y=[];"; | ||
36 | "" | ||
37 | "// Display mode"; | ||
38 | "mode(0);"; | ||
39 | "" | ||
40 | "// Display warning for floating point exception"; | ||
41 | "ieee(1);"; | ||
42 | "" | ||
43 | "select x // comment1"; | ||
44 | " // comment2"; | ||
45 | " case mtlb_logic(x,"">"",0) then y = ""positive"""; | ||
46 | " case mtlb_logic(x,""<"",0) then y = ""negative"""; | ||
47 | " else y = ""null"""; | ||
48 | "end;"; | ||
49 | "endfunction"] | ||
50 | |||
51 | |||
52 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
53 | affich_result(%F,1662); | ||
54 | else | ||
55 | affich_result(%T,1662); | ||
56 | end \ No newline at end of file | ||
diff --git a/tests/nonRegression/bug2333.sci b/tests/nonRegression/bug2333.sci deleted file mode 100644 index 3b6d8f1..0000000 --- a/tests/nonRegression/bug2333.sci +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2333 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2333 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // I am trying to convert a large number of Matlab files to Scilab. Either | ||
8 | // by using translatepath or a loop with mfile2sci I get the same error | ||
9 | // message when converting specific .m files. It appears in recursive mode | ||
10 | // only when calling another matlab function. | ||
11 | |||
12 | |||
13 | // Vincent COUVERT - Scilab Project | ||
14 | // Copyright INRIA | ||
15 | // 15/03/2007 | ||
16 | |||
17 | load("SCI/modules/m2sci/macros/kernel/lib"); | ||
18 | r=exists("mfile_path"); | ||
19 | |||
20 | affich_result(r,2322); | ||
diff --git a/tests/nonRegression/bug2428.sci b/tests/nonRegression/bug2428.sci deleted file mode 100644 index 479dfa1..0000000 --- a/tests/nonRegression/bug2428.sci +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2428 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2428 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // I would like to convert to SciLab the package TBMLab 3.1 by Smets | ||
8 | // (http://iridia.ulb.ac.be/~psmets/TBMLAB.zip). I tried both via the menu | ||
9 | // Applications -> m2sci and trying to convert recursively the directory | ||
10 | // of the package and via the SciPad menu File -> Import Matlab File. In | ||
11 | // the first case the conversion fails without errors, in the second case | ||
12 | // an error appears and a message suggests to report here the error. | ||
13 | |||
14 | // Copyright INRIA | ||
15 | // Scilab Project - Vincent COUVERT | ||
16 | |||
17 | MFILE=TMPDIR+"/bug2428.m" | ||
18 | SCIFILE=TMPDIR+"/bug2428.sci" | ||
19 | |||
20 | correct=%T; | ||
21 | |||
22 | MFILECONTENTS=["function bug2428"; | ||
23 | "global gui_settings"; | ||
24 | "i = 1;"; | ||
25 | "a = gui_settings.pn_mem{i}"] | ||
26 | |||
27 | fd=mopen(MFILE,"w"); | ||
28 | mputl(MFILECONTENTS,fd); | ||
29 | mclose(fd); | ||
30 | |||
31 | ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch") | ||
32 | correct=correct&ierr==0; | ||
33 | |||
34 | //affich_result(correct,2428); | ||
35 | disp(correct); | ||
diff --git a/tests/nonRegression/bug681.sci b/tests/nonRegression/bug681.sci deleted file mode 100644 index fb3f7d5..0000000 --- a/tests/nonRegression/bug681.sci +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 681 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=681 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // m2sci doesn't translate "error" function. | ||
8 | |||
9 | |||
10 | // Copyright INRIA | ||
11 | // Scilab Project - V. Couvert | ||
12 | |||
13 | MFILECONTENTS="error(''This is an error message'')" | ||
14 | |||
15 | MFILE=TMPDIR+"/bug681.m" | ||
16 | SCIFILE=TMPDIR+"/bug681.sci" | ||
17 | |||
18 | fd=mopen(MFILE,"w"); | ||
19 | mputl(MFILECONTENTS,fd); | ||
20 | mclose(fd); | ||
21 | |||
22 | mfile2sci(MFILE,TMPDIR); | ||
23 | |||
24 | fd=mopen(SCIFILE,"r"); | ||
25 | SCIFILECONTENTS=mgetl(fd,-1); | ||
26 | mclose(fd); | ||
27 | |||
28 | SCIFILECONTENTSREF=[""; | ||
29 | "// Display mode"; | ||
30 | "mode(0);"; | ||
31 | ""; | ||
32 | "// Display warning for floating point exception"; | ||
33 | "ieee(1);"; | ||
34 | ""; | ||
35 | "error(""This is an error message"")"] | ||
36 | |||
37 | correct=%T | ||
38 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
39 | correct=%F | ||
40 | end | ||
41 | |||
42 | affich_result(correct,681); | ||
diff --git a/tests/nonRegression/bug699.sci b/tests/nonRegression/bug699.sci deleted file mode 100644 index e153a30..0000000 --- a/tests/nonRegression/bug699.sci +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 699 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=699 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // m2sci crashes for a very simple input file | ||
8 | // | ||
9 | // The content of the offending file a_test.m is a single | ||
10 | // line : | ||
11 | // | ||
12 | // M(1,1) = -sin(0.1); | ||
13 | // | ||
14 | // When I try to convert this Matlab file to Scilab using the | ||
15 | // m2sci application (menu option in the main Scilab window), | ||
16 | // the reported error message displays. | ||
17 | |||
18 | // Copyright INRIA | ||
19 | // Scilab Project - V. Couvert | ||
20 | |||
21 | // Modified by Pierre MARECHAL | ||
22 | // Copyright INRIA | ||
23 | // Date : 22 Mar 2005 | ||
24 | |||
25 | MFILECONTENTS=["M(1,1) = -sin(0.1);";"M(1,1) = sin(0.1);"] | ||
26 | |||
27 | MFILE=TMPDIR+"/bug699.m" | ||
28 | SCIFILE=TMPDIR+"/bug699.sci" | ||
29 | |||
30 | mputl(MFILECONTENTS,MFILE); | ||
31 | mfile2sci(MFILE,TMPDIR); | ||
32 | SCIFILECONTENTS=mgetl(SCIFILE); | ||
33 | |||
34 | SCIFILECONTENTSREF=[""; | ||
35 | "// Display mode"; | ||
36 | "mode(0);"; | ||
37 | ""; | ||
38 | "// Display warning for floating point exception"; | ||
39 | "ieee(1);"; | ||
40 | ""; | ||
41 | "M(1,1) = -sin(0.1);"; | ||
42 | "M(1,1) = sin(0.1);"] | ||
43 | |||
44 | |||
45 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
46 | affich_result(%F,699); | ||
47 | else | ||
48 | affich_result(%T,699); | ||
49 | end | ||
diff --git a/tests/nonRegression/bug853.sci b/tests/nonRegression/bug853.sci deleted file mode 100644 index 4d567de..0000000 --- a/tests/nonRegression/bug853.sci +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 853 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=853 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Error with the m2sci on personnal function : | ||
8 | // | ||
9 | // function CORPABOT_vJuin04 | ||
10 | // | ||
11 | // % COntinuous Reltaive Phase Analyser Based On the Tangeant | ||
12 | // (CO.R.P.A.B.O.T.) | ||
13 | // % Salesse Robin UMR6152 June 17th 2004 | ||
14 | // | ||
15 | // | ||
16 | // | ||
17 | // | ||
18 | // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
19 | // % Nettoyage du workspace | ||
20 | // clear all; | ||
21 | // | ||
22 | // % Nettoyage du Command Window | ||
23 | // clc; | ||
24 | // | ||
25 | // % Lancement du chronomètre | ||
26 | // tic; | ||
27 | // ... | ||
28 | |||
29 | // Copyright INRIA | ||
30 | // Scilab Project - V. Couvert | ||
31 | |||
32 | // Modified by Pierre MARECHAL | ||
33 | // Copyright INRIA | ||
34 | // Date : 18 Mar 2005 | ||
35 | |||
36 | MFILECONTENTS=["dir_name=''path'';"; | ||
37 | "dir_target=dir(dir_name);"; | ||
38 | "for i=1:10"; | ||
39 | " RC(i)=[dir_name,''\'',dir_target(i).name];"; | ||
40 | "end"] | ||
41 | |||
42 | MFILE=TMPDIR+"/bug853.m" | ||
43 | SCIFILE=TMPDIR+"/bug853.sci" | ||
44 | |||
45 | mputl(MFILECONTENTS,MFILE); | ||
46 | mfile2sci(MFILE,TMPDIR); | ||
47 | SCIFILECONTENTS=mgetl(SCIFILE); | ||
48 | |||
49 | SCIFILECONTENTSREF=[""; | ||
50 | "// Display mode"; | ||
51 | "mode(0);"; | ||
52 | ""; | ||
53 | "// Display warning for floating point exception"; | ||
54 | "ieee(1);"; | ||
55 | ""; | ||
56 | "dir_name = ""path"";"; | ||
57 | "dir_target = mtlb_dir(dir_name);"; | ||
58 | "for i = 1:10"; | ||
59 | " RC(1,i) = dir_name+""\""+dir_target(i).name;"; | ||
60 | "end;"] | ||
61 | |||
62 | |||
63 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
64 | affich_result(%F,853); | ||
65 | else | ||
66 | affich_result(%T,853); | ||
67 | end | ||
diff --git a/tests/nonRegression/bug973.sci b/tests/nonRegression/bug973.sci deleted file mode 100644 index 90da956..0000000 --- a/tests/nonRegression/bug973.sci +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 973 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=973 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // matlab file conversion problem (apparently: Extraction of | ||
8 | // out from 'funcall' tlist is not yet implemented) | ||
9 | |||
10 | // Copyright INRIA | ||
11 | // Scilab Project - V. Couvert | ||
12 | |||
13 | MFILECONTENTS=["%m2scideclare var|Unknown Unknown|Unknown";"var1 = strrep(var,'' '','','')"] | ||
14 | |||
15 | MFILE=TMPDIR+"/bug973.m" | ||
16 | SCIFILE=TMPDIR+"/bug973.sci" | ||
17 | |||
18 | fd=mopen(MFILE,"w"); | ||
19 | mputl(MFILECONTENTS,fd); | ||
20 | mclose(fd); | ||
21 | |||
22 | mfile2sci(MFILE,TMPDIR); | ||
23 | |||
24 | fd=mopen(SCIFILE,"r"); | ||
25 | SCIFILECONTENTS=mgetl(fd,-1); | ||
26 | mclose(fd); | ||
27 | |||
28 | SCIFILECONTENTSREF=[""; | ||
29 | "// Display mode"; | ||
30 | "mode(0);"; | ||
31 | ""; | ||
32 | "// Display warning for floating point exception"; | ||
33 | "ieee(1);"; | ||
34 | ""; | ||
35 | ""; | ||
36 | "var1 = mtlb_strrep(var,"" "","","")"] | ||
37 | |||
38 | correct=%T | ||
39 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
40 | correct=%F | ||
41 | end | ||
42 | |||
43 | affich_result(correct,973); | ||