summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPierre Marechal <pierre.marechal@scilab.org>2007-11-22 14:40:45 +0000
committerPierre Marechal <pierre.marechal@scilab.org>2007-11-22 14:40:45 +0000
commit5c8f22b35e98169ccf41ea3348da5b8001236173 (patch)
tree8272b15c59bab648618c977abb393326621abead /tests
parent964e6686bf573b233276032f26dcc826e2e9ac6f (diff)
downloadscilab-5c8f22b35e98169ccf41ea3348da5b8001236173.zip
scilab-5c8f22b35e98169ccf41ea3348da5b8001236173.tar.gz
Incorporate non-regression files in the source tree
Diffstat (limited to 'tests')
-rw-r--r--tests/nonRegression/bug1014.sci22
-rw-r--r--tests/nonRegression/bug1023.sci42
-rw-r--r--tests/nonRegression/bug1025.sci30
-rw-r--r--tests/nonRegression/bug1057.sci40
-rw-r--r--tests/nonRegression/bug1074.sci30
-rw-r--r--tests/nonRegression/bug1082.sci50
-rw-r--r--tests/nonRegression/bug1084.sci33
-rw-r--r--tests/nonRegression/bug1107.sci21
-rw-r--r--tests/nonRegression/bug1110.sci19
-rw-r--r--tests/nonRegression/bug1123.sci50
-rw-r--r--tests/nonRegression/bug1124.sci59
-rw-r--r--tests/nonRegression/bug1149.sci50
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
16clear
17a=%nan;
18b=1/a;
19affich_result( isnan(b) == %T , 1014)
20clear
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
30mode(-1);
31clear
32Tref=['xxxx';'yyy';'z'];
33mputl(Tref,TMPDIR+'/bug1023.txt');
34u=mopen(TMPDIR+'/bug1023.txt','r');
35
36[n,a] = mfscanf(-1,u,"%s");
37[m,b] = mfscanf(-1,u,"%s");
38
39ok=n==1&and(a==Tref)&m==-1&b==[];
40affich_result(ok,1023);
41
42clear
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
15mode(-1);
16clear;
17
18set figure_style old;
19xset('window',1000);
20set figure_style old;
21xset('window',0);
22set figure_style new;
23
24A = winsid();
25
26if and(A == [0,1000]) then
27 affich_result(%T,1025);
28else
29 affich_result(%F,1025);
30end
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
33mode(-1);
34clear;
35
36if 1.7977E+308 == %inf then
37 affich_result(%T,1057);
38else
39 affich_result(%F,1057);
40end
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
16mode(-1);
17clear;
18
19function foo()
20 [a,b,c]=foo1(1)
21endfunction
22
23A = fun2string(foo)
24B = ["function []=ans";" [a,b,c] = foo1(1)";"endfunction"]
25
26if and( A == B ) then
27 affich_result(%T,1074);
28else
29 affich_result(%F,1074);
30end
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
16mode(-1);
17clear;
18
19MFILECONTENTS=["structure.field = 2;"
20""
21"data = round(structure.field);"]
22
23MFILE=TMPDIR+"/bug1082.m"
24SCIFILE=TMPDIR+"/bug1082.sci"
25
26mputl(MFILECONTENTS,MFILE);
27
28
29mfile2sci(MFILE,TMPDIR);
30SCIFILECONTENTS=mgetl(SCIFILE);
31
32
33SCIFILECONTENTSREF=["";
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
44correct=%T
45if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
46 correct=%F
47end
48affich_result(correct,1082);
49
50clear
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
21rand('seed',0);
22A = rand(1,3,'normal');
23rand('seed',0);
24B = rand(1,3,'normal');
25rand('seed',0);
26rand('seed',0);
27C = rand(1,3,'normal');
28
29if and(A==B) & and(B==C) & and(A==C) then
30 affich_result(%T,1084);
31else
32 affich_result(%F,1084);
33end
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)
14mode (-1)
15clear
16x=5; if (x = 4) then x=6;end
17ok=x==5
18ok=ok&execstr('x=5;z=2*(x=4)',"errcatch","n")==0&z==0
19ok=ok&execstr('x=5;z=2*(x-1=4)',"errcatch","n")==0&z==2
20affich_result(ok, 1107)
21clear
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
11mode (-1)
12clear
13L=list(4,5,[1 2]);
14ok=execstr('z=L(3)(:)(1)','errcatch')==21
15L=list(4,5,[1 1/%s]);
16ok=ok&execstr('z=L(3)(1,:)(2)','errcatch')==0&and(z==[1 1])
17
18affich_result(ok, 1110)
19clear
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
19mode(-1);
20clear;
21
22MFILECONTENTS="if(true)t=1;end"
23
24MFILE=TMPDIR+"/bug1123.m"
25SCIFILE=TMPDIR+"/bug1123.sci"
26
27mputl(MFILECONTENTS,MFILE);
28
29
30mfile2sci(MFILE,TMPDIR);
31SCIFILECONTENTS=mgetl(SCIFILE);
32
33
34SCIFILECONTENTSREF=["";
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
43correct=%T
44if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
45 correct=%F
46end
47
48affich_result(correct,1123);
49
50clear
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
14mode(-1);
15clear;
16
17MFILECONTENTS=[
18"load([rep,''alpha'']);";
19"load([rep,''beta'']);";
20"mu=beta*alpha;";
21]
22
23MFILE=TMPDIR+"/bug1124.m"
24SCIFILE=TMPDIR+"/bug1124.sci"
25
26fd=mopen(MFILE,"w");
27mputl(MFILECONTENTS,fd);
28mclose(fd);
29
30mfile2sci(MFILE,TMPDIR);
31
32fd=mopen(SCIFILE,"r");
33SCIFILECONTENTS=mgetl(fd,-1);
34mclose(fd);
35
36SCIFILECONTENTSREF=["";
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
50correct=%T
51if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
52 correct=%F
53end
54
55affich_result(correct,1124);
56
57clear
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
17mode(-1);
18clear;
19
20MFILECONTENTS="a=[,1,2,3,];"
21
22MFILE=TMPDIR+"/bug1149.m"
23SCIFILE=TMPDIR+"/bug1149.sci"
24
25fd=mopen(MFILE,"w");
26mputl(MFILECONTENTS,fd);
27mclose(fd);
28
29mfile2sci(MFILE,TMPDIR);
30
31fd=mopen(SCIFILE,"r");
32SCIFILECONTENTS=mgetl(fd,-1);
33mclose(fd);
34
35SCIFILECONTENTSREF=["";
36"// Display mode";
37"mode(0);";
38"";
39"// Display warning for floating point exception";
40"ieee(1);";
41"";
42"a = [1,2,3];"]
43
44correct=%T
45if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
46 correct=%F
47end
48affich_result(correct,1149);
49
50clear