diff options
author | Pierre Marechal <pierre.marechal@scilab.org> | 2007-11-27 09:42:56 +0000 |
---|---|---|
committer | Pierre Marechal <pierre.marechal@scilab.org> | 2007-11-27 09:42:56 +0000 |
commit | 395d412dc11faa19aeb716180766113d8b1eeb09 (patch) | |
tree | 75fc243114900ec1d2daf5454bd15881b8bababf /tests | |
parent | d382090d24ed2a6e2c92797ce1c2e9bdaa52bbcd (diff) | |
download | scilab-395d412dc11faa19aeb716180766113d8b1eeb09.zip scilab-395d412dc11faa19aeb716180766113d8b1eeb09.tar.gz |
Incoporate non-regression test files in the scilab source tree
Diffstat (limited to 'tests')
33 files changed, 0 insertions, 1203 deletions
diff --git a/tests/nonRegression/bug1786.sci b/tests/nonRegression/bug1786.sci deleted file mode 100644 index 6659773..0000000 --- a/tests/nonRegression/bug1786.sci +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1786 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1786 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Scilab 4.0-RC1 | ||
8 | // Handle Label : rotation of the text | ||
9 | // | ||
10 | // Changing field Label.auto_rotation to off does not causes the rotation of the | ||
11 | // text. To force the rotation, it is necessary to re-affect the value of | ||
12 | // Label.font_angle. | ||
13 | // | ||
14 | // jacques-Deric | ||
15 | |||
16 | // Copyright INRIA | ||
17 | // Scilab Project - Pierre MARECHAL | ||
18 | // Copyright INRIA 2005 | ||
19 | // Date : 6 fevrier 2005 | ||
20 | |||
21 | hf = scf (1); | ||
22 | ha = gca (); | ||
23 | hlt = ha.title; | ||
24 | |||
25 | hlt.text = "Titre/Title"; | ||
26 | |||
27 | test1 = (hlt.auto_rotation == "on"); | ||
28 | test2 = (hlt.auto_position == "on"); | ||
29 | |||
30 | hlt.font_angle = 180; | ||
31 | test3 = (hlt.auto_rotation == "off"); | ||
32 | |||
33 | hlt.position = [0.5,0.5];; | ||
34 | test4 = (hlt.auto_position == "off"); | ||
35 | |||
36 | if( test1 & test2 & test3 & test4 ) then | ||
37 | affich_result(%T,1786); | ||
38 | else | ||
39 | affich_result(%F,1786); | ||
40 | end | ||
diff --git a/tests/nonRegression/bug1787.sci b/tests/nonRegression/bug1787.sci deleted file mode 100644 index 3c96f64..0000000 --- a/tests/nonRegression/bug1787.sci +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1787 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1787 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Scilab 4.0 RC1 | ||
8 | // The calling of procedure xtitle bugs when the drawing of boxes is asked. | ||
9 | // | ||
10 | // Jacques-Deric | ||
11 | |||
12 | // Copyright INRIA | ||
13 | // Scilab Project - Jean-Baptiste Silvy | ||
14 | // Copyright INRIA 2006 | ||
15 | // Date : 10/02/2006 | ||
16 | |||
17 | titleStr = "Scilab P0W3R" ; | ||
18 | xLabelStr = "XXX" ; | ||
19 | yLabelStr = "YYY" ; | ||
20 | |||
21 | xtitle("Scilab P0W3R",'XXX','YYY',1) ; | ||
22 | a = gca() ; | ||
23 | title = a.title ; | ||
24 | xLabel = a.x_label ; | ||
25 | yLabel = a.y_label ; | ||
26 | |||
27 | resT = ( title.text == titleStr ) & ( title.fill_mode == 'on' ) ; | ||
28 | resX = ( xLabel.text == xLabelStr ) & ( xLabel.fill_mode == 'on' ) ; | ||
29 | resY = ( yLabel.text == yLabelStr ) & ( yLabel.fill_mode == 'on' ) ; | ||
30 | |||
31 | // check that a box is drawn around the labels | ||
32 | // and that they have the rigth text | ||
33 | if ( resT & resX & resY ) then | ||
34 | affich_result(%T,1787); | ||
35 | else | ||
36 | affich_result(%F,1787); | ||
37 | end | ||
diff --git a/tests/nonRegression/bug1794.sci b/tests/nonRegression/bug1794.sci deleted file mode 100644 index e01ac73..0000000 --- a/tests/nonRegression/bug1794.sci +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1794 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1794 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Problem encountered when redefining builtin function | ||
8 | |||
9 | // Copyright INRIA | ||
10 | // Scilab Project - Serge Steer | ||
11 | // Copyright INRIA 2005 | ||
12 | // Date : 30 janvier 2006 | ||
13 | |||
14 | beta=5; | ||
15 | try | ||
16 | beta | ||
17 | ok1=%t; | ||
18 | catch | ||
19 | ok1=%f; | ||
20 | end | ||
21 | |||
22 | function y=foo() | ||
23 | beta; | ||
24 | y=beta+1 | ||
25 | endfunction | ||
26 | |||
27 | try | ||
28 | foo() | ||
29 | ok2=%t; | ||
30 | catch | ||
31 | ok2=%f; | ||
32 | end | ||
33 | |||
34 | affich_result(ok1&ok2,1794); | ||
diff --git a/tests/nonRegression/bug1802.sci b/tests/nonRegression/bug1802.sci deleted file mode 100644 index bd7bde5..0000000 --- a/tests/nonRegression/bug1802.sci +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1802 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1802 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // The sci2exp function is very very slow for large matrices | ||
8 | |||
9 | |||
10 | // Non-regression test file for bug 1802 | ||
11 | // Copyright INRIA | ||
12 | // Scilab Project - Serge Steer | ||
13 | // Copyright INRIA 2005 | ||
14 | // Date : 30 janvier 2006 | ||
15 | |||
16 | a=rand(100,500); | ||
17 | timer();sci2exp(a);t=timer(); | ||
18 | affich_result(t<60,1802); | ||
diff --git a/tests/nonRegression/bug1859.sci b/tests/nonRegression/bug1859.sci deleted file mode 100644 index e36046d..0000000 --- a/tests/nonRegression/bug1859.sci +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1859 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1859 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // I sent the following commands | ||
8 | // | ||
9 | // Year = [2002, 2002]; | ||
10 | // Month = [2, 3]; | ||
11 | // Day = [28, 1]; | ||
12 | // datenum(Year, Month, Day) | ||
13 | // | ||
14 | // The SCILAB output is: | ||
15 | // | ||
16 | // 731275. 731278. | ||
17 | // | ||
18 | // But this seems me incorrect, as 2002-03-01 is just one day following 2002-02-28. | ||
19 | // | ||
20 | // Now, if you give the commands | ||
21 | // | ||
22 | // datenum(2002,2,28) | ||
23 | // datenum(2002,3,1) | ||
24 | // | ||
25 | // you respectively obtain the two outputs | ||
26 | // | ||
27 | // ... | ||
28 | |||
29 | // Copyright INRIA | ||
30 | // Scilab Project - Pierre MARECHAL | ||
31 | // Copyright INRIA 2006 | ||
32 | // Date : 27 fevrier 2006 | ||
33 | |||
34 | Year = [2002, 2002]; | ||
35 | Month = [ 2, 3]; | ||
36 | Day = [ 28, 1]; | ||
37 | |||
38 | test = datenum(Year, Month, Day); | ||
39 | ref = [731275 ; 731276]; | ||
40 | |||
41 | if ~or(test <> ref) then | ||
42 | affich_result(%T,1859); | ||
43 | else | ||
44 | affich_result(%F,1859); | ||
45 | end | ||
diff --git a/tests/nonRegression/bug1867.sci b/tests/nonRegression/bug1867.sci deleted file mode 100644 index 89895d5..0000000 --- a/tests/nonRegression/bug1867.sci +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1867 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1867 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // msscanf fails to parse formats with a large number of entries (larger | ||
8 | // than 30 it | ||
9 | // seems). | ||
10 | |||
11 | // A.C | ||
12 | // Copyright INRIA 2006 | ||
13 | |||
14 | str1 = '1 2 3 4 5 6 7 8 9 10'; | ||
15 | L1 = msscanf(str1,"%d %d %d %d %d %d %d %d %d %d"); | ||
16 | Test1=and(L1==[1:10]); | ||
17 | |||
18 | str2 = '.. | ||
19 | 1 2 3 4 5 6 7 8 9 10 .. | ||
20 | 11 12 13 14 15 16 17 18 19 20 .. | ||
21 | 21 22 23 24 25 26 27 28 29 30 .. | ||
22 | 31 32 33 34 35 36 37 38 39 40 .. | ||
23 | 41 42 43 44 45 46 47 48 49 50'; | ||
24 | |||
25 | L2 = msscanf(str2,".. | ||
26 | %d %d %d %d %d %d %d %d %d %d .. | ||
27 | %d %d %d %d %d %d %d %d %d %d .. | ||
28 | %d %d %d %d %d %d %d %d %d %d .. | ||
29 | %d %d %d %d %d %d %d %d %d %d .. | ||
30 | %d %d %d %d %d %d %d %d %d %d"); | ||
31 | Test2=and(L2==[1:50]); | ||
32 | |||
33 | str3 = '.. | ||
34 | 1 2 3 4 5 6 7 8 9 10 .. | ||
35 | 11 12 13 14 15 16 17 18 19 20 .. | ||
36 | 21 22 23 24 25 26 27 28 29 30 .. | ||
37 | 31 32 33 34 35 36 37 38 39 40 .. | ||
38 | 41 42 43 44 45 46 47 48 49 50 .. | ||
39 | 51 52 53 54 55 56 57 58 59 60.. | ||
40 | '; | ||
41 | |||
42 | StrExec=".. | ||
43 | L3 = msscanf(str3,"".. | ||
44 | %d %d %d %d %d %d %d %d %d %d .. | ||
45 | %d %d %d %d %d %d %d %d %d %d .. | ||
46 | %d %d %d %d %d %d %d %d %d %d .. | ||
47 | %d %d %d %d %d %d %d %d %d %d .. | ||
48 | %d %d %d %d %d %d %d %d %d %d .. | ||
49 | %d %d %d %d %d %d %d %d %d %d.. | ||
50 | "");"; | ||
51 | errmsg=execstr(StrExec,'errcatch'); | ||
52 | |||
53 | Test3=(errmsg==0); | ||
54 | |||
55 | if (Test1 & Test2 & Test3) then | ||
56 | affich_result(%T,1867); | ||
57 | else | ||
58 | affich_result(%F,1867); | ||
59 | end | ||
diff --git a/tests/nonRegression/bug1902.sci b/tests/nonRegression/bug1902.sci deleted file mode 100644 index 10e8c9a..0000000 --- a/tests/nonRegression/bug1902.sci +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1902 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1902 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // in drawlater mode the bounding box of strings may be wrong | ||
8 | |||
9 | // Copyright INRIA | ||
10 | // Scilab Project - Jean-Baptiste Silvy | ||
11 | // Copyright INRIA 2006 | ||
12 | // Date : October 25 2006 | ||
13 | |||
14 | |||
15 | // draw later part | ||
16 | drawlater() ; | ||
17 | |||
18 | xstring(0,0,['toto','titi';"tatapjp","iiih"]) ; | ||
19 | |||
20 | e = gce() ; | ||
21 | |||
22 | box11 = stringbox(e) | ||
23 | |||
24 | a = gca() ; | ||
25 | a.data_bounds = [-2,-2;7,7] ; | ||
26 | |||
27 | box21 = stringbox(e) | ||
28 | |||
29 | a.view = '3d' ; | ||
30 | |||
31 | box31 = stringbox(e) | ||
32 | |||
33 | a.data_bounds = [0,-1,3;6,7,8] ; | ||
34 | |||
35 | box41 = stringbox(e) | ||
36 | |||
37 | drawnow() ; | ||
38 | |||
39 | |||
40 | clf() ; | ||
41 | |||
42 | |||
43 | // same as first part but wthout drawlater | ||
44 | xstring(0,0,['toto','titi';"tatapjp","iiih"]) ; | ||
45 | |||
46 | e = gce() ; | ||
47 | |||
48 | box12 = stringbox(e) | ||
49 | |||
50 | a = gca() ; | ||
51 | a.data_bounds = [-2,-2;7,7] ; | ||
52 | |||
53 | box22 = stringbox(e) | ||
54 | |||
55 | a.view = '3d' ; | ||
56 | |||
57 | box32 = stringbox(e) | ||
58 | |||
59 | a.data_bounds = [0,-1,3;6,7,8] ; | ||
60 | |||
61 | box42 = stringbox(e) | ||
62 | |||
63 | // bounding box should be the same either we are in drawlater or not. | ||
64 | if ( norm( box11 - box12 ) < 0.1 .. | ||
65 | & norm( box21 - box22 ) < 0.1 .. | ||
66 | & norm( box31 - box32 ) < 0.1 .. | ||
67 | & norm( box41 - box42 ) < 0.1 ) then | ||
68 | affich_result(%T,1902) ; | ||
69 | else | ||
70 | affich_result(%F,1902) ; | ||
71 | end | ||
diff --git a/tests/nonRegression/bug1933.sci b/tests/nonRegression/bug1933.sci deleted file mode 100644 index fd664a5..0000000 --- a/tests/nonRegression/bug1933.sci +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1933 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1933 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // log and log2 doesn't work on vectors with %nan under windows. They work | ||
8 | // nicely | ||
9 | // under linux. | ||
10 | |||
11 | // A.C | ||
12 | // Copyright INRIA 2006 | ||
13 | |||
14 | A = [0 0 2 2 0 0]; | ||
15 | A(find(A==0)) = %nan; | ||
16 | B=log(A); | ||
17 | |||
18 | if ( isnan(B(1)) & isnan(B(2)) & isnan(B(5)) & isnan(B(6)) ) then | ||
19 | affich_result(%T,1933); | ||
20 | else | ||
21 | affich_result(%F,1933); | ||
22 | end | ||
diff --git a/tests/nonRegression/bug1955.sci b/tests/nonRegression/bug1955.sci deleted file mode 100644 index 15acda2..0000000 --- a/tests/nonRegression/bug1955.sci +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1955 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1955 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Reshaping global hypermatrices is problematic, as demonstrated by the | ||
8 | // attached file 'bug.sci', which contains further comments. | ||
9 | |||
10 | // Copyright INRIA | ||
11 | // Scilab Project - Serge Steer | ||
12 | // Copyright INRIA 2006 | ||
13 | // Date : 3 mai 2006 | ||
14 | |||
15 | global ghm | ||
16 | |||
17 | ghm=matrix(1:8,2,4); | ||
18 | ghm=matrix(ghm,2,2,2); | ||
19 | |||
20 | r= and(ghm==matrix(1:8,2,2,2)) | ||
21 | affich_result(r,1955); | ||
diff --git a/tests/nonRegression/bug1956.sci b/tests/nonRegression/bug1956.sci deleted file mode 100644 index fd684aa..0000000 --- a/tests/nonRegression/bug1956.sci +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1956 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1956 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // this works for example: | ||
8 | // a=10; // a constant | ||
9 | // for i=1:2 | ||
10 | // d(i)=a; | ||
11 | // end | ||
12 | // but it doesn't work if 'a' is a structure. | ||
13 | // I find a solution for a structure: | ||
14 | // a.b=[1 2 3]; | ||
15 | // a.c=[4 5 6] | ||
16 | // but it's not smart and clear code... | ||
17 | |||
18 | // Copyright INRIA | ||
19 | // Scilab Project - Serge Steer | ||
20 | // Copyright INRIA 2006 | ||
21 | // Date : 4 mai 2006 | ||
22 | |||
23 | clear a d | ||
24 | a.b=[1 2 3]; | ||
25 | d(1)=a | ||
26 | r=and(d==a) | ||
27 | d(2)=a; | ||
28 | r=r&and(d(1)==a) | ||
29 | r=r&and(d(2)==a) | ||
30 | |||
31 | affich_result(r,1956); | ||
diff --git a/tests/nonRegression/bug1957.sci b/tests/nonRegression/bug1957.sci deleted file mode 100644 index f4d1719..0000000 --- a/tests/nonRegression/bug1957.sci +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1957 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1957 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Non fonctionnement de intersci pour les variables optionnelles (au | ||
8 | // moins scalaires) | ||
9 | |||
10 | // Copyright INRIA | ||
11 | // Scilab Project - Serge Steer | ||
12 | // Copyright INRIA 2006 | ||
13 | // Date : 15 mai 2006 | ||
14 | |||
15 | tab=ascii(9); | ||
16 | path=TMPDIR; | ||
17 | |||
18 | desc=['foo'+tab+'x'+tab+'y'+tab+'[ITMAX 2000]'+tab+'[eps 0.001]' | ||
19 | 'x'+tab+'scalar' | ||
20 | 'y'+tab+'scalar' | ||
21 | 'ITMAX'+tab+'scalar' | ||
22 | 'eps '+tab+'scalar' | ||
23 | 'r'+tab+'vector 4' | ||
24 | '' | ||
25 | 'foo'+tab+'x'+tab+'y'+tab+' ITMAX'+tab+'eps'+tab+'r' | ||
26 | 'x'+tab+'double' | ||
27 | 'y'+tab+'double' | ||
28 | 'ITMAX'+tab+'integer' | ||
29 | 'eps'+tab+'double' | ||
30 | 'r'+tab+'double' | ||
31 | '' | ||
32 | 'out sequence'+tab+'r' | ||
33 | '*******************']; | ||
34 | mputl(desc,path+'/intsfoo.desc') | ||
35 | |||
36 | foo_code=['#include ""stack-c.h""' | ||
37 | 'void C2F(foo)(double *x,double *y,int *ITMAX,double *eps,double *r)' | ||
38 | ' {' | ||
39 | ' r[0]=*x; r[1]=*y; r[2]=*ITMAX; r[3]=*eps;' | ||
40 | ' }']; | ||
41 | mputl(foo_code,path+'/foo.c') | ||
42 | |||
43 | intersci=getshortpathname(SCI+'/modules/intersci/bin/intersci-n') | ||
44 | |||
45 | curpath=pwd() | ||
46 | chdir(path) | ||
47 | try | ||
48 | unix_s(intersci+' intsfoo') | ||
49 | ilib_build('testlib',['test','intsfoo'],['foo.o','intsfoo.o'],[]) | ||
50 | exec loader.sce | ||
51 | catch | ||
52 | affich_result(%f,1957); | ||
53 | return | ||
54 | end | ||
55 | chdir(curpath) | ||
56 | res=test(1.2,-2.3); | ||
57 | r=norm(res-[1.2,-2.3,2000,0.001])<1d-10; | ||
58 | res=test(1.2,-2.3,ITMAX=33); | ||
59 | r=r&norm(res-[1.2,-2.3,33,0.001])<1d-10; | ||
60 | res=test(1.2,-2.3,eps=1d-7); | ||
61 | r=r&norm(res-[1.2,-2.3,2000,1d-7])<1d-10; | ||
62 | res=test(1.2,-2.3,eps=1d-7,ITMAX=33); | ||
63 | r=r&norm(res-[1.2,-2.3,33,1d-7])<1d-10; | ||
64 | affich_result(r,1957); | ||
diff --git a/tests/nonRegression/bug1977.sci b/tests/nonRegression/bug1977.sci deleted file mode 100644 index 72d6c81..0000000 --- a/tests/nonRegression/bug1977.sci +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1977 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1977 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // inttype has stars in error message | ||
8 | // | ||
9 | // | ||
10 | // -->inttype("hell") | ||
11 | // !--error 44 | ||
12 | // ***th argument is incorrect | ||
13 | // | ||
14 | // | ||
15 | // Francois | ||
16 | |||
17 | // Copyright INRIA | ||
18 | // Scilab Project - Pierre MARECHAL | ||
19 | // Copyright INRIA 2006 | ||
20 | // Date : 23 mai 2006 | ||
21 | |||
22 | execstr('inttype(''hell'')','errcatch'); | ||
23 | |||
24 | if lasterror() == 'first argument is incorrect' then | ||
25 | affich_result(%T,1977); | ||
26 | else | ||
27 | affich_result(%F,1977); | ||
28 | end | ||
diff --git a/tests/nonRegression/bug1979.sci b/tests/nonRegression/bug1979.sci deleted file mode 100644 index 4638b9b..0000000 --- a/tests/nonRegression/bug1979.sci +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1979 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1979 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // I think that something is forgotten in the integer treatment in Scilab : | ||
8 | // | ||
9 | // -->a=int32(1);b=int32(6); | ||
10 | // -->a:b | ||
11 | // a:b | ||
12 | // !--error 4 | ||
13 | // undefined variable : %i_b_i | ||
14 | |||
15 | // Copyright INRIA | ||
16 | // Scilab Project - Pierre MARECHAL | ||
17 | // Copyright INRIA 2006 | ||
18 | // Date : 23 mai 2006 | ||
19 | |||
20 | a = int32(1); | ||
21 | b = int32(6); | ||
22 | c = a:b; | ||
23 | d = int32([1 2 3 4 5 6]); | ||
24 | |||
25 | if and( c == d ) then | ||
26 | affich_result(%T,1979); | ||
27 | else | ||
28 | affich_result(%F,1979); | ||
29 | end | ||
diff --git a/tests/nonRegression/bug1991.sci b/tests/nonRegression/bug1991.sci deleted file mode 100644 index 09b9280..0000000 --- a/tests/nonRegression/bug1991.sci +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 1991 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1991 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // [a,b]=(3,int32(5)) | ||
8 | // !--error 78 | ||
9 | // convert: wrong number of lhs arguments | ||
10 | |||
11 | // Copyright INRIA | ||
12 | // Scilab Project - Serge Steer | ||
13 | // Copyright INRIA 2006 | ||
14 | // Date : 15 mai 2006 | ||
15 | |||
16 | [a,b]=(3,int32(5)); | ||
17 | r=a==3&b==int32(5); | ||
18 | a=(3 + int32(5)); | ||
19 | r=r&(a==int32(8)); | ||
20 | |||
21 | [a,b,c]=(3,(2),sin(5)); | ||
22 | r=r&a==3&b==2&c==sin(5); | ||
23 | |||
24 | affich_result(r,1991); | ||
diff --git a/tests/nonRegression/bug2014.sci b/tests/nonRegression/bug2014.sci deleted file mode 100644 index 726d5f6..0000000 --- a/tests/nonRegression/bug2014.sci +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2014 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2014 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // The function isequal doesn't work properly with list. | ||
8 | // | ||
9 | // -->a=list("a");b=list("a","b"); | ||
10 | // -->isequal(a,b) | ||
11 | // ans = | ||
12 | // | ||
13 | // T | ||
14 | // | ||
15 | // -->isequal(b,a) | ||
16 | // !--error 21 | ||
17 | // invalid index | ||
18 | // at line 10 of function %l_isequal called by : | ||
19 | // isequal(b,a) | ||
20 | // | ||
21 | // I propose this modification of the macro %l_isequal in the file | ||
22 | // SCI/macros/percent/%l_isequal.sci : | ||
23 | // | ||
24 | // 1 - function r=%l_isequal(x1,varargin) | ||
25 | // 2 - narg=size(varargin) | ||
26 | // 3 - if narg==0 then error('isequal requires at least two input arguments'),end | ||
27 | // ... | ||
28 | |||
29 | // Copyright INRIA | ||
30 | // Scilab Project - Serge Steer | ||
31 | // Copyright INRIA 2006 | ||
32 | // Date : june 2006 | ||
33 | |||
34 | l1=list(1,2,3);l2=list(1,2);l3=list(); | ||
35 | r=isequal(l1,l1)&isequal(l3,l3)&~isequal(l1,l2)&~isequal(l3,l1) | ||
36 | affich_result(r,2014); | ||
diff --git a/tests/nonRegression/bug2022.sci b/tests/nonRegression/bug2022.sci deleted file mode 100644 index 9f693c0..0000000 --- a/tests/nonRegression/bug2022.sci +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2022 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2022 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // percentile function (perctl) doesn't always calculate percentile value, instead | ||
8 | // choosing to error out: | ||
9 | // | ||
10 | // Example that causes error: | ||
11 | // | ||
12 | // perctl([23.4,364.34,1929.3,4234.3,293.3,928.3],[10]) | ||
13 | |||
14 | // Author : Scilab Project - Pierre MARECHAL | ||
15 | // Copyright INRIA | ||
16 | // Date : 12 june 2006 | ||
17 | |||
18 | test1 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],90) == [472 3] ); | ||
19 | test2 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],75) == [452 6] ); | ||
20 | test3 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],10) == [368 22] ); | ||
21 | test4 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],1) == [332 23] ); | ||
22 | test5 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],2) == [332 23] ); | ||
23 | test6 = ( perctl([500 480 460 453 452 452 451 450 450 431 421 420 420 417 416 414 410 410 405 397 380 360 332],99) == [500 1] ); | ||
24 | |||
25 | test7 = ( perctl([23.4,364.34,1929.3,4234.3,293.3,928.3],[10]) == [23.4 1] ); | ||
26 | |||
27 | if and(test1) & and(test2) & and(test3) & and(test4) & and(test5) & and(test6) & and(test7) then | ||
28 | affich_result(%T,2022); | ||
29 | else | ||
30 | affich_result(%F,2022); | ||
31 | end | ||
diff --git a/tests/nonRegression/bug2038.sci b/tests/nonRegression/bug2038.sci deleted file mode 100644 index cd99aac..0000000 --- a/tests/nonRegression/bug2038.sci +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2038 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2038 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // The dir command does not read properly directories different from the | ||
8 | // current | ||
9 | // one. Give the command a=dir('SubDir') (assuming SubDir exists and is | ||
10 | // non | ||
11 | // empty). Then, each element of a.isdir is %f, each element of a.date and | ||
12 | // a.bytes | ||
13 | // is 0. | ||
14 | // | ||
15 | // See also | ||
16 | // http://groups.google.it/group/comp.soft- | ||
17 | // sys.math.scilab/browse_thread/thread/2f81e9afd1d7d6f1/e33536bff4dc1ecf#e | ||
18 | // 33536bff4dc1ecf | ||
19 | |||
20 | // Author : Scilab Project - Allan CORNET | ||
21 | // Copyright INRIA | ||
22 | // Date : 3 july 2006 | ||
23 | |||
24 | mkdir('bug2038_dir'); | ||
25 | cd('bug2038_dir'); | ||
26 | mkdir('bug2038_subdir'); | ||
27 | cd('..') | ||
28 | |||
29 | a=dir('bug2038_dir'); | ||
30 | b=mtlb_dir('bug2038_dir'); | ||
31 | |||
32 | x=getdate(a.date); | ||
33 | cx=x(1:4); | ||
34 | |||
35 | y=getdate(); | ||
36 | cy=y(1:4); | ||
37 | |||
38 | T1=(a.isdir & b.isdir); | ||
39 | T2=(cx == cy); | ||
40 | |||
41 | if (T1 & T2) then | ||
42 | affich_result(%T,2038); | ||
43 | else | ||
44 | affich_result(%F,2038); | ||
45 | end | ||
diff --git a/tests/nonRegression/bug2039.sci b/tests/nonRegression/bug2039.sci deleted file mode 100644 index 51127b3..0000000 --- a/tests/nonRegression/bug2039.sci +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2039 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2039 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // non empty lasterror on Scilab startup | ||
8 | // | ||
9 | // | ||
10 | // Startup execution: | ||
11 | // loading initial environment | ||
12 | // | ||
13 | // -->[str,n,line,func]=lasterror(%f) | ||
14 | // func = | ||
15 | // | ||
16 | // | ||
17 | // line = | ||
18 | // | ||
19 | // 0. | ||
20 | // n = | ||
21 | // | ||
22 | // 999. | ||
23 | // str = | ||
24 | // | ||
25 | // Cannot query value of this type. | ||
26 | // | ||
27 | // ... | ||
28 | |||
29 | // Author : Scilab Project - Pierre MARECHAL | ||
30 | // Copyright INRIA | ||
31 | // Date : 28 june 2006 | ||
32 | |||
33 | if lasterror(%F) == [] then | ||
34 | affich_result(%T,2039); | ||
35 | else | ||
36 | affich_result(%F,2039); | ||
37 | end | ||
diff --git a/tests/nonRegression/bug2045.sci b/tests/nonRegression/bug2045.sci deleted file mode 100644 index 83fc930..0000000 --- a/tests/nonRegression/bug2045.sci +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2045 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2045 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // xpolys([],[],-1) | ||
8 | // kills scilex | ||
9 | |||
10 | // Copyright INRIA | ||
11 | // Scilab Project - Jean-Baptiste Silvy | ||
12 | // Copyright INRIA 2006 | ||
13 | // Date : October 27 2006 | ||
14 | |||
15 | // should not draw anything | ||
16 | xpolys([],[],-1) ; | ||
17 | |||
18 | e = gce() ; | ||
19 | |||
20 | if ( e.type <> "Axes" ) then | ||
21 | affich_result(%F,2045) ; | ||
22 | end | ||
23 | |||
24 | |||
25 | xpoly([],[]) ; | ||
26 | |||
27 | // should create an empty polyline | ||
28 | e = gce() ; | ||
29 | |||
30 | if ( e.type <> "Polyline" ) then | ||
31 | affich_result(%F,2045) ; | ||
32 | end | ||
33 | |||
34 | if ( size(e.data) <> [0,0] ) then | ||
35 | affich_result(%F,2045) ; | ||
36 | end | ||
37 | |||
38 | // check if scilab don't crash | ||
39 | plot3d ; | ||
40 | |||
41 | e.data = rand(100,2) ; | ||
42 | |||
43 | e.data = [] ; | ||
44 | |||
45 | xdel(winsid()) ; | ||
46 | |||
47 | // check if nothing is broken | ||
48 | xpolys(rand(12,12), rand(12,12) ) ; | ||
49 | |||
50 | e = gce() ; | ||
51 | |||
52 | if ( e.type <> "Compound" ) then | ||
53 | affich_result(%F,2045) ; | ||
54 | end | ||
55 | |||
56 | if ( size(e.children) <> 12 ) then | ||
57 | affich_result(%F,2045) ; | ||
58 | end | ||
59 | |||
60 | delete(gca()) ; | ||
61 | |||
62 | xpoly( rand(1,12), rand(1,12) ) ; | ||
63 | |||
64 | e = gce() ; | ||
65 | |||
66 | if ( e.type <> "Polyline" ) then | ||
67 | affich_result(%F,2045) ; | ||
68 | end | ||
69 | |||
70 | affich_result(%T,2045) ; | ||
diff --git a/tests/nonRegression/bug205.sci b/tests/nonRegression/bug205.sci deleted file mode 100644 index 011a598..0000000 --- a/tests/nonRegression/bug205.sci +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 205 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=205 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Bug Report Id: 04062001110115540 | ||
8 | // determ oublie les termes de plus haut degre. | ||
9 | // | ||
10 | // On Scilab 2.5 with " determ " function | ||
11 | // The Error Messages are: | ||
12 | // | ||
13 | // Commands: // scilab dit que le polynome caracteristique de | ||
14 | // // cette matrice de dimension | ||
15 | // // 30 est de degre 21 | ||
16 | // N=30 | ||
17 | // a=rand(N,N) | ||
18 | // s=poly(0,'s') | ||
19 | // p=determ(eye(N,N)*s-a) | ||
20 | // degree(p) | ||
21 | // | ||
22 | // Gaubert on Linux PPC version 2.2.13 distribution with X/kde as window manager | ||
23 | // France February 10, 2001 at 11:55:40 | ||
24 | |||
25 | // Author : Scilab Project - Pierre MARECHAL | ||
26 | // Copyright INRIA | ||
27 | // Date : 09 june 2006 | ||
28 | |||
29 | N=30; | ||
30 | A=rand(N,N); | ||
31 | s=poly(0,'s'); | ||
32 | P=determ( eye(N,N)*%s - A ); | ||
33 | |||
34 | if degree(P)==30 then | ||
35 | affich_result(%T,205); | ||
36 | else | ||
37 | affich_result(%F,205); | ||
38 | end | ||
diff --git a/tests/nonRegression/bug2052.sci b/tests/nonRegression/bug2052.sci deleted file mode 100644 index c102d5d..0000000 --- a/tests/nonRegression/bug2052.sci +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2052 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2052 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Bug dans la primitive "isequal" (au moins) avec des type de données | ||
8 | // utilisateur | ||
9 | |||
10 | // Serge Steer - Scilab Project | ||
11 | // Copyright INRIA | ||
12 | // 19/02/2007 | ||
13 | |||
14 | cur=pwd(); | ||
15 | cd(TMPDIR); | ||
16 | //first create a function changetype | ||
17 | code=['#include ""stack-c.h""' | ||
18 | 'int intchangetype(fname)' | ||
19 | ' char *fname;' | ||
20 | '{' | ||
21 | ' int m1,n1,l1;' | ||
22 | ' CheckRhs(2,2);' | ||
23 | ' CheckLhs(1,1);' | ||
24 | ' GetRhsVar(2,""i"",&m1,&n1,&l1)' | ||
25 | ' /* change the type */' | ||
26 | ' *istk(iadr(*Lstk(Top-1)))=*istk(l1);' | ||
27 | ' C2F(intersci).ntypes[0] = ''$'';' | ||
28 | ' LhsVar(1)=1;' | ||
29 | ' return 0;' | ||
30 | '}']; | ||
31 | mputl(code,'intchangetype.c'); | ||
32 | ilib_build('libtest',['changetype','intchangetype'],'intchangetype',[]); | ||
33 | exec('loader.sce') | ||
34 | cd(cur); | ||
35 | |||
36 | |||
37 | //create variables of type 222 | ||
38 | A=rand(3,2); | ||
39 | a=changetype(A,222); | ||
40 | //associate a typename to 222 | ||
41 | typename("bug2052", 222) | ||
42 | //define overloading function for isequal | ||
43 | function r=%bug2052_isequal(x,y) | ||
44 | r=type(x)==222&type(y)==222 | ||
45 | if r then | ||
46 | x=changetype(x,1) | ||
47 | y=changetype(y,1) | ||
48 | r=r&and(x==y) | ||
49 | end | ||
50 | endfunction | ||
51 | //Check if everything is ok | ||
52 | l=list(1,2,3); | ||
53 | r=isequal(a,a)&~isequal(a,A)&~isequal(A,a)&isequal(A,A)&isequal(l,l)&~isequal(l,A); | ||
54 | |||
55 | affich_result(r,2052); | ||
diff --git a/tests/nonRegression/bug2067.sci b/tests/nonRegression/bug2067.sci deleted file mode 100644 index f00cfb4..0000000 --- a/tests/nonRegression/bug2067.sci +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2067 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2067 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Scilab dies when the Plot command is given a large numerical value. | ||
8 | // | ||
9 | // Tried it with Scilab Nightly Build 20060710. | ||
10 | // | ||
11 | // Greetings from Poland, | ||
12 | // Lukasz Hladowski. | ||
13 | |||
14 | // Copyright INRIA | ||
15 | // Scilab Project - Jean-Baptiste Silvy | ||
16 | // Copyright INRIA 2006 | ||
17 | // Date : July 11 2006 | ||
18 | |||
19 | // the bug was hanging the computer | ||
20 | plot( 10^16, 5) ; | ||
21 | |||
22 | affich_result(%T,2067) ; | ||
diff --git a/tests/nonRegression/bug2092.sci b/tests/nonRegression/bug2092.sci deleted file mode 100644 index 6244a02..0000000 --- a/tests/nonRegression/bug2092.sci +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2092 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2092 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Incorrect handling of second input argument to function mad() | ||
8 | |||
9 | // Copyright INRIA | ||
10 | // Scilab Project - Pierre MARECHAL | ||
11 | // Copyright INRIA 2006 | ||
12 | // Date : 17 aout 2006 | ||
13 | |||
14 | A = mad([1:10;2:11],2); | ||
15 | B = mad([1:10;2:11],'c'); | ||
16 | |||
17 | if and(A == B) then | ||
18 | affich_result(%T,2092); | ||
19 | else | ||
20 | affich_result(%F,2092); | ||
21 | end | ||
diff --git a/tests/nonRegression/bug2093.sci b/tests/nonRegression/bug2093.sci deleted file mode 100644 index 5bcdd83..0000000 --- a/tests/nonRegression/bug2093.sci +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2093 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2093 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // matrix(A,q) doesn't return a q*1 matrix when A is a 1*1*q matrix and q a scalar. | ||
8 | // Instead, it returns a mlist. | ||
9 | |||
10 | // Copyright INRIA | ||
11 | // Scilab Project - Pierre MARECHAL | ||
12 | // Copyright INRIA 2006 | ||
13 | // Date : 28 août 2006 | ||
14 | |||
15 | A = rand(1,1,6); | ||
16 | B = matrix(A,6); | ||
17 | C = matrix(A,[6,1]); | ||
18 | |||
19 | if (type(B) == 1) & (type(C) == 1) then | ||
20 | affich_result(%T,2093); | ||
21 | else | ||
22 | affich_result(%F,2093); | ||
23 | end | ||
diff --git a/tests/nonRegression/bug2098.sci b/tests/nonRegression/bug2098.sci deleted file mode 100644 index 5663c6e..0000000 --- a/tests/nonRegression/bug2098.sci +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2098 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2098 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // showprofile(test) makes Scilab crash if the function 'test' has not | ||
8 | // been prepared for profiling, as demonstrated by the following example: | ||
9 | // | ||
10 | // -->function test | ||
11 | // -->disp('test') | ||
12 | // -->endfunction | ||
13 | // | ||
14 | // -->test | ||
15 | // | ||
16 | // test | ||
17 | // | ||
18 | // -->showprofile(test) // this line makes Scilab exit silently | ||
19 | |||
20 | // Author : Scilab Project - Pierre MARECHAL | ||
21 | // Copyright INRIA | ||
22 | // Date : 05 mai 2007 | ||
23 | |||
24 | function test | ||
25 | disp('test'); | ||
26 | endfunction | ||
27 | |||
28 | ierr = execstr('showprofile(test)','errcatch'); | ||
29 | |||
30 | if( ierr == 1000 ) then | ||
31 | affich_result(%T,2098); | ||
32 | else | ||
33 | affich_result(%F,2098); | ||
34 | end | ||
diff --git a/tests/nonRegression/bug2149.sci b/tests/nonRegression/bug2149.sci deleted file mode 100644 index c96487d..0000000 --- a/tests/nonRegression/bug2149.sci +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2149 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2149 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Missing error message in fprintfMat | ||
8 | // | ||
9 | // | ||
10 | // help fprintfMat states that the matrix to save must be a matrix of real | ||
11 | // numbers. Therefore: | ||
12 | // | ||
13 | // -->M=[1+%i;1-%i]; | ||
14 | // | ||
15 | // -->fprintfMat("mymatrix.txt",M,"%f") | ||
16 | // | ||
17 | // --> | ||
18 | // should spit an error. It does not but it silently saves the real part | ||
19 | // of M instead. | ||
20 | // | ||
21 | // Another (better) option: extend fprintfMat/scanfMat so that they work | ||
22 | // with complex matrices (or matrices of integers, booleans, etc). | ||
23 | // | ||
24 | // Francois | ||
25 | |||
26 | // Copyright INRIA | ||
27 | // Scilab Project - Allan CORNET | ||
28 | // Copyright INRIA 2006 | ||
29 | |||
30 | correctItem=0; | ||
31 | |||
32 | M=[1+%i;2+3*%i] ; | ||
33 | try | ||
34 | fprintfMat(TMPDIR+'/pipo.txt',M,'%f',['comment un';'comment 2']) | ||
35 | correct=%T; | ||
36 | catch | ||
37 | correctItem=correctItem+1; | ||
38 | end | ||
39 | |||
40 | M=[1.2,2.3]; | ||
41 | try | ||
42 | fprintfMat(TMPDIR+'/pipo.txt',M,'%f',['comment un';'comment 2']) | ||
43 | catch | ||
44 | correctItem=correctItem+1; | ||
45 | end | ||
46 | |||
47 | try | ||
48 | fprintfMat(TMPDIR+'/pipo.txt','M','%f',['comment un';'comment 2']) | ||
49 | correct=%T; | ||
50 | catch | ||
51 | correctItem=correctItem+1; | ||
52 | end | ||
53 | |||
54 | if (correctItem == 2) then | ||
55 | affich_result(%T,2149); | ||
56 | else | ||
57 | affich_result(%F,2149); | ||
58 | end | ||
diff --git a/tests/nonRegression/bug2162.sci b/tests/nonRegression/bug2162.sci deleted file mode 100644 index fa757dc..0000000 --- a/tests/nonRegression/bug2162.sci +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2162 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2162 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // When using plot3d with facets coordinates, it is impossible to draw a single facet. | ||
8 | |||
9 | // Copyright INRIA | ||
10 | // Scilab Project - Jean-Baptiste Silvy | ||
11 | // Copyright INRIA 2006 | ||
12 | // Date : October 19 2006 | ||
13 | |||
14 | xf = [0;0;0;0] ; | ||
15 | yf = [0;1;1;0] ; | ||
16 | zf = [0;0;1;1] ; // coordinates of a square | ||
17 | |||
18 | // plot3d routine should be able to draw a single square | ||
19 | plot3d( xf, yf, zf ) ; | ||
20 | |||
21 | e = gce() ; | ||
22 | |||
23 | if ( e.type == "Fac3d" ) then | ||
24 | affich_result(%T,2162); | ||
25 | else | ||
26 | affich_result(%F,2162); | ||
27 | end | ||
28 | |||
diff --git a/tests/nonRegression/bug2181.sci b/tests/nonRegression/bug2181.sci deleted file mode 100644 index aedacc7..0000000 --- a/tests/nonRegression/bug2181.sci +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2181 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2181 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // getrelativefilename crashes when the two arguments it receives refer to | ||
8 | // different drives. | ||
9 | // | ||
10 | // Francois | ||
11 | |||
12 | // Pierre MARECHAL - Scilab Project | ||
13 | // Copyright INRIA | ||
14 | // 30 octobre 2006 | ||
15 | |||
16 | if MSDOS then | ||
17 | |||
18 | test1 = getrelativefilename("D:\","C:\Program Files\scilab\readme.txt"); | ||
19 | test2 = getrelativefilename("C:\","C:\Program Files\scilab\readme.txt"); | ||
20 | test3 = getrelativefilename("C:\Documents and Settings","C:\Program Files\scilab\readme.txt"); | ||
21 | test4 = getrelativefilename("C:\PROGRAM FILES\toto","c:\program files\scilab\readme.txt"); | ||
22 | |||
23 | res1 = ( test1 == "C:\Program Files\scilab\readme.txt" ); | ||
24 | res2 = ( test2 == "C:\Program Files\scilab\readme.txt" ); | ||
25 | res3 = ( test3 == "..\Program Files\scilab\readme.txt" ); | ||
26 | res4 = ( test4 == "..\scilab\readme.txt" ); | ||
27 | |||
28 | if (res1 & res2 & res3) then | ||
29 | affich_result(%T,2181); | ||
30 | else | ||
31 | affich_result(%F,2181); | ||
32 | end | ||
33 | |||
34 | else | ||
35 | affich_result(%T,2181); | ||
36 | end | ||
diff --git a/tests/nonRegression/bug2263.sci b/tests/nonRegression/bug2263.sci deleted file mode 100644 index 0b49e46..0000000 --- a/tests/nonRegression/bug2263.sci +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2263 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2263 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Suppose you want to call a arbitrary scilab function "test". But you want the | ||
8 | // outputs from this function be stored in a matlab-like struct, for example, | ||
9 | // [out.t1,out.t2,out.t3,out.t4]=test(1) | ||
10 | // This works fine, but if you have a nested structure (out.a.XXX) than scilab is | ||
11 | // not able to provide the outputs at the correct places, for example | ||
12 | // [out.a.t1,out.a.t2,out.a.t3,out.a.t4]=test(1). | ||
13 | // | ||
14 | // | ||
15 | // The function "test" could be: | ||
16 | // function [a,b,c,d,e]=teste(in) | ||
17 | // a=in; | ||
18 | // b=in+1; | ||
19 | // c=in+2; | ||
20 | // d=in+3; | ||
21 | // e=in+4; | ||
22 | // endfunction | ||
23 | |||
24 | // Serge Steer - Scilab Project | ||
25 | // Copyright INRIA | ||
26 | // 2 janv 2007 | ||
27 | |||
28 | function [a,b,c,d,e]=test() | ||
29 | a=1;b=2;c=3;d=4;e=5; | ||
30 | endfunction | ||
31 | [out.a.t1,out.a.t2,out.a.t3,out.a.t4]=test(); | ||
32 | T=%t; | ||
33 | T=T&and(out==mlist(["st","dims","a"],int32([1,1]),.. | ||
34 | mlist(["st","dims","t4","t3","t2","t1"],int32([1,1]),4,3,2,1))) ; | ||
35 | |||
36 | clear out | ||
37 | [out.a.t1,t2,out.a.t3,t4]=test(); | ||
38 | T=T&and(out==mlist(["st","dims","a"],int32([1,1]),.. | ||
39 | mlist(["st","dims","t3","t1"],int32([1,1]),3,1)))&t2==2&t4==4; | ||
40 | |||
41 | clear a | ||
42 | [a.t1,a.t2,a.t3,a.t4]=test(); | ||
43 | T=T& and(a==mlist(["st","dims","t4","t3","t2","t1"],int32([1,1]),4,3,2,1)); | ||
44 | |||
45 | clear a | ||
46 | [t1,a.t2,t3,a.t4]=test(); | ||
47 | T=T& and(a==mlist(["st","dims","t4","t2"],int32([1,1]),4,2))&t1==1&t3==3; | ||
48 | |||
49 | [t1,t2,t3,t4]=test(); | ||
50 | T=T&and([t1 t2 t3 t4]==[1 2 3 4]); | ||
51 | |||
52 | affich_result(T,2263); | ||
diff --git a/tests/nonRegression/bug2264.sci b/tests/nonRegression/bug2264.sci deleted file mode 100644 index 890f6c8..0000000 --- a/tests/nonRegression/bug2264.sci +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2264 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2264 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // lcm gives wrong value for 3-element vectors(cf bug 666) | ||
8 | |||
9 | // Serge Steer - Scilab Project | ||
10 | // Copyright INRIA | ||
11 | // 2 janv 2007 | ||
12 | |||
13 | [q,fact]=lcm(int32([-6 5 7 12 4])); | ||
14 | T=q==int32(420); | ||
15 | [q,fact]=lcm(int32([6 5 7 3 4])) ; | ||
16 | T=T&(q==int32(420)); | ||
17 | [q,fact]=lcm(int32([-6 5 1 3 4])); | ||
18 | T=T&(q==int32(60)); | ||
19 | [q,fact]=lcm(int32([-6 5 0 3 4])); | ||
20 | T=T&(q==int32(0)); | ||
21 | |||
22 | affich_result(T,2264); | ||
diff --git a/tests/nonRegression/bug2268.sci b/tests/nonRegression/bug2268.sci deleted file mode 100644 index 2b0ca74..0000000 --- a/tests/nonRegression/bug2268.sci +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2268 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2268 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Memory leak in msscanf(). When calling msscanf() many times, as in reading in | ||
8 | // large CSV files, process size grows beyond memory capacity. | ||
9 | |||
10 | // Serge Steer - Scilab Project | ||
11 | // Copyright INRIA | ||
12 | // 2 janv 2007 | ||
13 | |||
14 | free=getmemory() ; | ||
15 | for k=1:10000 | ||
16 | foo=msscanf('1.234 44 55 66 77 88 88 ', '%f %f %f %f %f %f %f '); | ||
17 | end | ||
18 | leak=free-getmemory() | ||
19 | T=leak<=4; | ||
20 | affich_result(T,2266); | ||
diff --git a/tests/nonRegression/bug2270.sci b/tests/nonRegression/bug2270.sci deleted file mode 100644 index a3d0d1d..0000000 --- a/tests/nonRegression/bug2270.sci +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2270 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2270 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // datenum(Y,M,D) issues an incorrect error message when the third | ||
8 | // parameter is invalid. The error should say 'The third argument must be | ||
9 | // between 1 and 31', depending on the actual number of days in that | ||
10 | // specific month. | ||
11 | |||
12 | |||
13 | // Copyright INRIA | ||
14 | // Scilab Project - Pierre MARECHAL | ||
15 | // Copyright INRIA 2007 | ||
16 | // Date : 3 janvier 2007 | ||
17 | |||
18 | execstr('datenum(2006,12,32)','errcatch'); | ||
19 | error_str = lasterror(); | ||
20 | |||
21 | if stripblanks(error_str) <> "The third argument must be between 1 and 31" then | ||
22 | affich_result(%F,2270); | ||
23 | else | ||
24 | affich_result(%T,2270); | ||
25 | end | ||
diff --git a/tests/nonRegression/bug2277.sci b/tests/nonRegression/bug2277.sci deleted file mode 100644 index e3bc4dd..0000000 --- a/tests/nonRegression/bug2277.sci +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | // <-- Non-regression test for bug 2277 --> | ||
2 | // | ||
3 | // <-- Bugzilla URL --> | ||
4 | // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2277 | ||
5 | // | ||
6 | // <-- Short Description --> | ||
7 | // Scilab has a bug with the SPARSE command. When the "values vector" in the | ||
8 | // row/column representation is COMPLEX the routine fails to build the sparse | ||
9 | // matrix correctly. This seems to occur always when the first AND third entry of | ||
10 | // this vector are zero. | ||
11 | // The other bug is that when other elements are zero (not the third, the fifth for | ||
12 | // example) they are still stored in the sparse representation. | ||
13 | // This is very problematic for people doing finite element calculations with scilab! | ||
14 | |||
15 | // Copyright INRIA | ||
16 | // Scilab Project - S. Steer | ||
17 | // Copyright INRIA | ||
18 | // Date : 17 Janv 2007 | ||
19 | |||
20 | ij = [1,3;1,7;3,3;4,4;5,3;6,10;7,1;7,9;8,10;9,6;9,7;9,9;10,10] ; | ||
21 | v=[1 0 0 4:13]'*%i; | ||
22 | A=sparse(ij,v,[10 10]); | ||
23 | [ij2,v2,mn]=spget(A); | ||
24 | r= and(v2==[1 4:13]'*%i) ; | ||
25 | ij(2:3,:)=[]; | ||
26 | r=r&and(ij==ij2); | ||
27 | affich_result(r,2277); | ||