summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPierre Marechal <pierre.marechal@scilab.org>2007-11-22 15:40:59 +0000
committerPierre Marechal <pierre.marechal@scilab.org>2007-11-22 15:40:59 +0000
commit8fa056449fd90596fd0b5bc3ac21f44d55ac89fe (patch)
tree4bfb07a24de32143409c4f072349ed9542bb4924 /tests
parentb5b2e807a6ad4d05446ea3e121a0bc21c8378398 (diff)
downloadscilab-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.sci54
-rw-r--r--tests/nonRegression/bug1662.sci56
-rw-r--r--tests/nonRegression/bug2333.sci20
-rw-r--r--tests/nonRegression/bug2428.sci35
-rw-r--r--tests/nonRegression/bug681.sci42
-rw-r--r--tests/nonRegression/bug699.sci49
-rw-r--r--tests/nonRegression/bug853.sci67
-rw-r--r--tests/nonRegression/bug973.sci43
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
19MFILECONTENTS=["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
25MFILE=TMPDIR+"/bug1636.m"
26SCIFILE=TMPDIR+"/bug1636.sci"
27
28mputl(MFILECONTENTS,MFILE);
29mfile2sci(MFILE,TMPDIR,%f,%t);
30SCIFILECONTENTS=mgetl(SCIFILE);
31
32SCIFILECONTENTSREF=["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
50if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
51 affich_result(%F,1636);
52else
53 affich_result(%T,1636);
54end
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
17MFILECONTENTS=["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
25MFILE=TMPDIR+"/bug1662.m"
26SCIFILE=TMPDIR+"/bug1662.sci"
27
28mputl(MFILECONTENTS,MFILE);
29mfile2sci(MFILE,TMPDIR,%f,%t);
30SCIFILECONTENTS=mgetl(SCIFILE);
31
32SCIFILECONTENTSREF=["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
52if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
53 affich_result(%F,1662);
54else
55 affich_result(%T,1662);
56end \ 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
17load("SCI/modules/m2sci/macros/kernel/lib");
18r=exists("mfile_path");
19
20affich_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
17MFILE=TMPDIR+"/bug2428.m"
18SCIFILE=TMPDIR+"/bug2428.sci"
19
20correct=%T;
21
22MFILECONTENTS=["function bug2428";
23 "global gui_settings";
24 "i = 1;";
25 "a = gui_settings.pn_mem{i}"]
26
27fd=mopen(MFILE,"w");
28mputl(MFILECONTENTS,fd);
29mclose(fd);
30
31ierr=execstr("mfile2sci("""+MFILE+""","""+TMPDIR+""")","errcatch")
32correct=correct&ierr==0;
33
34//affich_result(correct,2428);
35disp(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
13MFILECONTENTS="error(''This is an error message'')"
14
15MFILE=TMPDIR+"/bug681.m"
16SCIFILE=TMPDIR+"/bug681.sci"
17
18fd=mopen(MFILE,"w");
19mputl(MFILECONTENTS,fd);
20mclose(fd);
21
22mfile2sci(MFILE,TMPDIR);
23
24fd=mopen(SCIFILE,"r");
25SCIFILECONTENTS=mgetl(fd,-1);
26mclose(fd);
27
28SCIFILECONTENTSREF=["";
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
37correct=%T
38if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
39 correct=%F
40end
41
42affich_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
25MFILECONTENTS=["M(1,1) = -sin(0.1);";"M(1,1) = sin(0.1);"]
26
27MFILE=TMPDIR+"/bug699.m"
28SCIFILE=TMPDIR+"/bug699.sci"
29
30mputl(MFILECONTENTS,MFILE);
31mfile2sci(MFILE,TMPDIR);
32SCIFILECONTENTS=mgetl(SCIFILE);
33
34SCIFILECONTENTSREF=["";
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
45if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
46 affich_result(%F,699);
47else
48 affich_result(%T,699);
49end
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
36MFILECONTENTS=["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
42MFILE=TMPDIR+"/bug853.m"
43SCIFILE=TMPDIR+"/bug853.sci"
44
45mputl(MFILECONTENTS,MFILE);
46mfile2sci(MFILE,TMPDIR);
47SCIFILECONTENTS=mgetl(SCIFILE);
48
49SCIFILECONTENTSREF=["";
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
63if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
64 affich_result(%F,853);
65else
66 affich_result(%T,853);
67end
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
13MFILECONTENTS=["%m2scideclare var|Unknown Unknown|Unknown";"var1 = strrep(var,'' '','','')"]
14
15MFILE=TMPDIR+"/bug973.m"
16SCIFILE=TMPDIR+"/bug973.sci"
17
18fd=mopen(MFILE,"w");
19mputl(MFILECONTENTS,fd);
20mclose(fd);
21
22mfile2sci(MFILE,TMPDIR);
23
24fd=mopen(SCIFILE,"r");
25SCIFILECONTENTS=mgetl(fd,-1);
26mclose(fd);
27
28SCIFILECONTENTSREF=["";
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
38correct=%T
39if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
40 correct=%F
41end
42
43affich_result(correct,973);