diff options
author | Pierre Marechal <pierre.marechal@scilab.org> | 2007-11-22 14:40:45 +0000 |
---|---|---|
committer | Pierre Marechal <pierre.marechal@scilab.org> | 2007-11-22 14:40:45 +0000 |
commit | 5c8f22b35e98169ccf41ea3348da5b8001236173 (patch) | |
tree | 8272b15c59bab648618c977abb393326621abead /tests | |
parent | 964e6686bf573b233276032f26dcc826e2e9ac6f (diff) | |
download | scilab-5c8f22b35e98169ccf41ea3348da5b8001236173.zip scilab-5c8f22b35e98169ccf41ea3348da5b8001236173.tar.gz |
Incorporate non-regression files in the source tree
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nonRegression/bug1014.sci | 22 | ||||
-rw-r--r-- | tests/nonRegression/bug1023.sci | 42 | ||||
-rw-r--r-- | tests/nonRegression/bug1025.sci | 30 | ||||
-rw-r--r-- | tests/nonRegression/bug1057.sci | 40 | ||||
-rw-r--r-- | tests/nonRegression/bug1074.sci | 30 | ||||
-rw-r--r-- | tests/nonRegression/bug1082.sci | 50 | ||||
-rw-r--r-- | tests/nonRegression/bug1084.sci | 33 | ||||
-rw-r--r-- | tests/nonRegression/bug1107.sci | 21 | ||||
-rw-r--r-- | tests/nonRegression/bug1110.sci | 19 | ||||
-rw-r--r-- | tests/nonRegression/bug1123.sci | 50 | ||||
-rw-r--r-- | tests/nonRegression/bug1124.sci | 59 | ||||
-rw-r--r-- | tests/nonRegression/bug1149.sci | 50 |
12 files changed, 0 insertions, 446 deletions
diff --git a/tests/nonRegression/bug1014.sci b/tests/nonRegression/bug1014.sci deleted file mode 100644 index 2c81a0b..0000000 --- a/tests/nonRegression/bug1014.sci +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1014 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1014 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Nan bug (Windows) | ||
8 | // b=%nan; | ||
9 | // a=1/b | ||
10 | // | ||
11 | // produces a "Division by zero" error | ||
12 | |||
13 | |||
14 | // bug1014 | ||
15 | // Allan CORNET | ||
16 | clear | ||
17 | a=%nan; | ||
18 | b=1/a; | ||
19 | affich_result( isnan(b) == %T , 1014) | ||
20 | clear | ||
21 | |||
22 | |||
diff --git a/tests/nonRegression/bug1023.sci b/tests/nonRegression/bug1023.sci deleted file mode 100644 index d45ec1e..0000000 --- a/tests/nonRegression/bug1023.sci +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1023 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1023 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // mfscanf cores dump scilab. | ||
8 | // | ||
9 | // I have a file named links.txt, its size is 350k. When I | ||
10 | // try to run the below code, line 5 kills scilab with the | ||
11 | // error "error in fscanf : cannot allocate more memory". But | ||
12 | // the command "free" tells me I have 182Mb free memory. | ||
13 | // | ||
14 | // ================================================= | ||
15 | // filename = "/home/fsilva/kazus.ebooks/links.txt" | ||
16 | // inputfile = mopen(filename,"r") | ||
17 | // | ||
18 | // [n,a] = mfscanf(-1,inputfile,"%s"); | ||
19 | // [m,b] = mfscanf(-1,inputfile,"%s"); //line 5 | ||
20 | // | ||
21 | // mclose(inputfile); | ||
22 | |||
23 | |||
24 | // Non-regression test file for bug 1023 | ||
25 | // Copyright INRIA | ||
26 | // Scilab Project - Serge Steer | ||
27 | // Copyright INRIA 2006 | ||
28 | // Date : 11 janvier 2006 | ||
29 | |||
30 | mode(-1); | ||
31 | clear | ||
32 | Tref=['xxxx';'yyy';'z']; | ||
33 | mputl(Tref,TMPDIR+'/bug1023.txt'); | ||
34 | u=mopen(TMPDIR+'/bug1023.txt','r'); | ||
35 | |||
36 | [n,a] = mfscanf(-1,u,"%s"); | ||
37 | [m,b] = mfscanf(-1,u,"%s"); | ||
38 | |||
39 | ok=n==1&and(a==Tref)&m==-1&b==[]; | ||
40 | affich_result(ok,1023); | ||
41 | |||
42 | clear | ||
diff --git a/tests/nonRegression/bug1025.sci b/tests/nonRegression/bug1025.sci deleted file mode 100644 index bde2707..0000000 --- a/tests/nonRegression/bug1025.sci +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1025 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1025 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // winsid ne marche pas. | ||
8 | |||
9 | |||
10 | // Non-regression test file for bug 1025 | ||
11 | // Pierre MARECHAL - Scilab Project | ||
12 | // Copyright INRIA | ||
13 | // 1er juin 2005 | ||
14 | |||
15 | mode(-1); | ||
16 | clear; | ||
17 | |||
18 | set figure_style old; | ||
19 | xset('window',1000); | ||
20 | set figure_style old; | ||
21 | xset('window',0); | ||
22 | set figure_style new; | ||
23 | |||
24 | A = winsid(); | ||
25 | |||
26 | if and(A == [0,1000]) then | ||
27 | affich_result(%T,1025); | ||
28 | else | ||
29 | affich_result(%F,1025); | ||
30 | end | ||
diff --git a/tests/nonRegression/bug1057.sci b/tests/nonRegression/bug1057.sci deleted file mode 100644 index 310c10a..0000000 --- a/tests/nonRegression/bug1057.sci +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1057 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1057 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Crash when entering the following in the command window: | ||
8 | // | ||
9 | // 1.7977E+308 | ||
10 | // | ||
11 | // Actually, every number greater than 1.797E+308 crashes | ||
12 | // scilab (scilab3.0 under linux gives the correct answer Inf). | ||
13 | // | ||
14 | // A popup window appears with the following message: | ||
15 | // | ||
16 | // forrtl: severe(64): input conversion error, unit -5, file | ||
17 | // Internal List Directed Read | ||
18 | // Image [...] | ||
19 | // LibScilab.dll [...] | ||
20 | // [...] | ||
21 | // | ||
22 | // [...] is text I don't think is important. | ||
23 | // | ||
24 | // Basically overflow is translated in crashes where it should | ||
25 | // be Inf. | ||
26 | |||
27 | |||
28 | // Non-regression test file for bug 1057 | ||
29 | // Pierre MARECHAL - Scilab Project | ||
30 | // Copyright INRIA | ||
31 | // 1er juin 2005 | ||
32 | |||
33 | mode(-1); | ||
34 | clear; | ||
35 | |||
36 | if 1.7977E+308 == %inf then | ||
37 | affich_result(%T,1057); | ||
38 | else | ||
39 | affich_result(%F,1057); | ||
40 | end | ||
diff --git a/tests/nonRegression/bug1074.sci b/tests/nonRegression/bug1074.sci deleted file mode 100644 index 9c8e3a0..0000000 --- a/tests/nonRegression/bug1074.sci +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1074 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1074 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // fun2string() converts anomalously function calls with more | ||
8 | // than 1 return argument, and does not retain the function name | ||
9 | |||
10 | |||
11 | // Non-regression test file for bug 1057 | ||
12 | // Pierre MARECHAL - Scilab Project | ||
13 | // Copyright INRIA | ||
14 | // 1er juin 2005 | ||
15 | |||
16 | mode(-1); | ||
17 | clear; | ||
18 | |||
19 | function foo() | ||
20 | [a,b,c]=foo1(1) | ||
21 | endfunction | ||
22 | |||
23 | A = fun2string(foo) | ||
24 | B = ["function []=ans";" [a,b,c] = foo1(1)";"endfunction"] | ||
25 | |||
26 | if and( A == B ) then | ||
27 | affich_result(%T,1074); | ||
28 | else | ||
29 | affich_result(%F,1074); | ||
30 | end | ||
diff --git a/tests/nonRegression/bug1082.sci b/tests/nonRegression/bug1082.sci deleted file mode 100644 index 700dd00..0000000 --- a/tests/nonRegression/bug1082.sci +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1082 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1082 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Error during conversion of a very simple file. Though the | ||
8 | // syntax is the same in both languages, the converter fails to | ||
9 | // convert the rounding of the field of a structure: "round(a.b)" | ||
10 | |||
11 | |||
12 | // Non-regression test file for bug 1082 | ||
13 | // Copyright INRIA | ||
14 | // Scilab Project - F.Belahcene | ||
15 | |||
16 | mode(-1); | ||
17 | clear; | ||
18 | |||
19 | MFILECONTENTS=["structure.field = 2;" | ||
20 | "" | ||
21 | "data = round(structure.field);"] | ||
22 | |||
23 | MFILE=TMPDIR+"/bug1082.m" | ||
24 | SCIFILE=TMPDIR+"/bug1082.sci" | ||
25 | |||
26 | mputl(MFILECONTENTS,MFILE); | ||
27 | |||
28 | |||
29 | mfile2sci(MFILE,TMPDIR); | ||
30 | SCIFILECONTENTS=mgetl(SCIFILE); | ||
31 | |||
32 | |||
33 | SCIFILECONTENTSREF=[""; | ||
34 | "// Display mode"; | ||
35 | "mode(0);"; | ||
36 | ""; | ||
37 | "// Display warning for floating point exception"; | ||
38 | "ieee(1);"; | ||
39 | ""; | ||
40 | "structure.field = 2;"; | ||
41 | ""; | ||
42 | "data = round(mtlb_double(structure.field));"] | ||
43 | |||
44 | correct=%T | ||
45 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
46 | correct=%F | ||
47 | end | ||
48 | affich_result(correct,1082); | ||
49 | |||
50 | clear | ||
diff --git a/tests/nonRegression/bug1084.sci b/tests/nonRegression/bug1084.sci deleted file mode 100644 index 559375a..0000000 --- a/tests/nonRegression/bug1084.sci +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1084 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1084 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Problem with resetting seed for rand 'normal' | ||
8 | // distribution. As you can see from the attached code, I'm | ||
9 | // resetting the seed and generating a rand 'normal' | ||
10 | // distribution, however I only get the same results every | ||
11 | // other time. This should produce the same results every | ||
12 | // time. Note that the 'uniform' distribution does generate | ||
13 | // the same results every time. | ||
14 | |||
15 | |||
16 | // Non-regression test file for bug 1084 | ||
17 | // Pierre MARECHAL - Scilab Project | ||
18 | // Copyright INRIA | ||
19 | // 1er juin 2005 | ||
20 | |||
21 | rand('seed',0); | ||
22 | A = rand(1,3,'normal'); | ||
23 | rand('seed',0); | ||
24 | B = rand(1,3,'normal'); | ||
25 | rand('seed',0); | ||
26 | rand('seed',0); | ||
27 | C = rand(1,3,'normal'); | ||
28 | |||
29 | if and(A==B) & and(B==C) & and(A==C) then | ||
30 | affich_result(%T,1084); | ||
31 | else | ||
32 | affich_result(%F,1084); | ||
33 | end | ||
diff --git a/tests/nonRegression/bug1107.sci b/tests/nonRegression/bug1107.sci deleted file mode 100644 index a1b3593..0000000 --- a/tests/nonRegression/bug1107.sci +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1107 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1107 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // wrong use of = not detected in if conditions | ||
8 | |||
9 | |||
10 | // bug1107 | ||
11 | //the bug was due to a misinterpretation of syntax like (x=2) in | ||
12 | //factor. It was treated as a named argument of a function instead of a | ||
13 | //factor equivalent to (x==2) | ||
14 | mode (-1) | ||
15 | clear | ||
16 | x=5; if (x = 4) then x=6;end | ||
17 | ok=x==5 | ||
18 | ok=ok&execstr('x=5;z=2*(x=4)',"errcatch","n")==0&z==0 | ||
19 | ok=ok&execstr('x=5;z=2*(x-1=4)',"errcatch","n")==0&z==2 | ||
20 | affich_result(ok, 1107) | ||
21 | clear | ||
diff --git a/tests/nonRegression/bug1110.sci b/tests/nonRegression/bug1110.sci deleted file mode 100644 index 6af1ef8..0000000 --- a/tests/nonRegression/bug1110.sci +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1110 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1110 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // parser or evaluator error | ||
8 | |||
9 | |||
10 | // bug1110 | ||
11 | mode (-1) | ||
12 | clear | ||
13 | L=list(4,5,[1 2]); | ||
14 | ok=execstr('z=L(3)(:)(1)','errcatch')==21 | ||
15 | L=list(4,5,[1 1/%s]); | ||
16 | ok=ok&execstr('z=L(3)(1,:)(2)','errcatch')==0&and(z==[1 1]) | ||
17 | |||
18 | affich_result(ok, 1110) | ||
19 | clear | ||
diff --git a/tests/nonRegression/bug1123.sci b/tests/nonRegression/bug1123.sci deleted file mode 100644 index 2217ae0d..0000000 --- a/tests/nonRegression/bug1123.sci +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1123 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1123 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // I think this bug is related to other ones but the matlab | ||
8 | // construction : | ||
9 | // | ||
10 | // if(mod(N,2))N=N-1;t=t(1:N);xs=xs(1:N);xp=xp(1:N); x=x(1:N);end | ||
11 | // | ||
12 | // leads to a error 43 the m2sci script | ||
13 | |||
14 | |||
15 | // Non-regression test file for bug 1123 | ||
16 | // Copyright INRIA | ||
17 | // Scilab Project - F. Belahcene | ||
18 | |||
19 | mode(-1); | ||
20 | clear; | ||
21 | |||
22 | MFILECONTENTS="if(true)t=1;end" | ||
23 | |||
24 | MFILE=TMPDIR+"/bug1123.m" | ||
25 | SCIFILE=TMPDIR+"/bug1123.sci" | ||
26 | |||
27 | mputl(MFILECONTENTS,MFILE); | ||
28 | |||
29 | |||
30 | mfile2sci(MFILE,TMPDIR); | ||
31 | SCIFILECONTENTS=mgetl(SCIFILE); | ||
32 | |||
33 | |||
34 | SCIFILECONTENTSREF=[""; | ||
35 | "// Display mode"; | ||
36 | "mode(0);"; | ||
37 | ""; | ||
38 | "// Display warning for floating point exception"; | ||
39 | "ieee(1);"; | ||
40 | ""; | ||
41 | "if %t then t = 1;end;"] | ||
42 | |||
43 | correct=%T | ||
44 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
45 | correct=%F | ||
46 | end | ||
47 | |||
48 | affich_result(correct,1123); | ||
49 | |||
50 | clear | ||
diff --git a/tests/nonRegression/bug1124.sci b/tests/nonRegression/bug1124.sci deleted file mode 100644 index 5545c82..0000000 --- a/tests/nonRegression/bug1124.sci +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1124 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1124 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // incapacity to use a function name as an identifier | ||
8 | |||
9 | |||
10 | // Non-regression test file for bug 1124 | ||
11 | // Copyright INRIA | ||
12 | // Scilab Project - F. Belahcene | ||
13 | |||
14 | mode(-1); | ||
15 | clear; | ||
16 | |||
17 | MFILECONTENTS=[ | ||
18 | "load([rep,''alpha'']);"; | ||
19 | "load([rep,''beta'']);"; | ||
20 | "mu=beta*alpha;"; | ||
21 | ] | ||
22 | |||
23 | MFILE=TMPDIR+"/bug1124.m" | ||
24 | SCIFILE=TMPDIR+"/bug1124.sci" | ||
25 | |||
26 | fd=mopen(MFILE,"w"); | ||
27 | mputl(MFILECONTENTS,fd); | ||
28 | mclose(fd); | ||
29 | |||
30 | mfile2sci(MFILE,TMPDIR); | ||
31 | |||
32 | fd=mopen(SCIFILE,"r"); | ||
33 | SCIFILECONTENTS=mgetl(fd,-1); | ||
34 | mclose(fd); | ||
35 | |||
36 | SCIFILECONTENTSREF=[""; | ||
37 | "// Display mode"; | ||
38 | "mode(0);"; | ||
39 | ""; | ||
40 | "// Display warning for floating point exception"; | ||
41 | "ieee(1);"; | ||
42 | ""; | ||
43 | "// ! L.1: mtlb(rep) can be replaced by rep() or rep whether rep is an M-file or not"; | ||
44 | "loadmatfile(mtlb(rep)+""alpha"");"; | ||
45 | "// ! L.2: mtlb(rep) can be replaced by rep() or rep whether rep is an M-file or not"; | ||
46 | "loadmatfile(mtlb(rep)+""beta"");"; | ||
47 | "mu = mtlb_double(beta)*mtlb_double(alpha);"; | ||
48 | ] | ||
49 | |||
50 | correct=%T | ||
51 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
52 | correct=%F | ||
53 | end | ||
54 | |||
55 | affich_result(correct,1124); | ||
56 | |||
57 | clear | ||
58 | |||
59 | |||
diff --git a/tests/nonRegression/bug1149.sci b/tests/nonRegression/bug1149.sci deleted file mode 100644 index 90a8530..0000000 --- a/tests/nonRegression/bug1149.sci +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1149 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1149 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // m2sci doesn't cope with constructs like a=[1,2,3,] or | ||
8 | // a=[,1,2,3,] (superfluous leading/trailing comma), which | ||
9 | // matlab lives well with. Awful matlab quirk, I agree, but | ||
10 | // some automatic m-file generator does it carelessly. | ||
11 | |||
12 | |||
13 | // Non-regression test file for bug 1149 | ||
14 | // Copyright INRIA | ||
15 | // Scilab Project - F.Belahcene | ||
16 | |||
17 | mode(-1); | ||
18 | clear; | ||
19 | |||
20 | MFILECONTENTS="a=[,1,2,3,];" | ||
21 | |||
22 | MFILE=TMPDIR+"/bug1149.m" | ||
23 | SCIFILE=TMPDIR+"/bug1149.sci" | ||
24 | |||
25 | fd=mopen(MFILE,"w"); | ||
26 | mputl(MFILECONTENTS,fd); | ||
27 | mclose(fd); | ||
28 | |||
29 | mfile2sci(MFILE,TMPDIR); | ||
30 | |||
31 | fd=mopen(SCIFILE,"r"); | ||
32 | SCIFILECONTENTS=mgetl(fd,-1); | ||
33 | mclose(fd); | ||
34 | |||
35 | SCIFILECONTENTSREF=[""; | ||
36 | "// Display mode"; | ||
37 | "mode(0);"; | ||
38 | ""; | ||
39 | "// Display warning for floating point exception"; | ||
40 | "ieee(1);"; | ||
41 | ""; | ||
42 | "a = [1,2,3];"] | ||
43 | |||
44 | correct=%T | ||
45 | if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then | ||
46 | correct=%F | ||
47 | end | ||
48 | affich_result(correct,1149); | ||
49 | |||
50 | clear | ||