summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPierre Marechal <pierre.marechal@scilab.org>2007-11-27 07:53:08 +0000
committerPierre Marechal <pierre.marechal@scilab.org>2007-11-27 07:53:08 +0000
commit4e001e847d1950af298f34baeab694277d52c551 (patch)
tree9466b86da7e493c250e57daf1ea2dc166d4858b5 /tests
parente334b99c4e16c871b8a6c02869b39dc684efcc95 (diff)
downloadscilab-4e001e847d1950af298f34baeab694277d52c551.zip
scilab-4e001e847d1950af298f34baeab694277d52c551.tar.gz
Incoporate non-regression test files in the scilab source tree
Diffstat (limited to 'tests')
-rw-r--r--tests/nonRegression/bug1620.sci39
-rw-r--r--tests/nonRegression/bug1625.sci33
-rw-r--r--tests/nonRegression/bug1682.sci55
-rw-r--r--tests/nonRegression/bug1684.sci38
-rw-r--r--tests/nonRegression/bug1693.sci111
-rw-r--r--tests/nonRegression/bug1711.sci35
-rw-r--r--tests/nonRegression/bug1712.sci42
-rw-r--r--tests/nonRegression/bug1720.sci39
-rw-r--r--tests/nonRegression/bug1725.sci42
-rw-r--r--tests/nonRegression/bug1732.sci35
-rw-r--r--tests/nonRegression/bug1736.sci21
-rw-r--r--tests/nonRegression/bug1742.sci29
-rw-r--r--tests/nonRegression/bug1768.sci36
-rw-r--r--tests/nonRegression/bug1772.sci23
14 files changed, 0 insertions, 578 deletions
diff --git a/tests/nonRegression/bug1620.sci b/tests/nonRegression/bug1620.sci
deleted file mode 100644
index 00210c4..0000000
--- a/tests/nonRegression/bug1620.sci
+++ /dev/null
@@ -1,39 +0,0 @@
1// <-- Non-regression test for bug 1620 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1620
5//
6// <-- Short Description -->
7// Lorsque j'essaie de lire une matrice de taille 500x148, soit:
8// -le programme me charge la matrice mais en decalant les elements (le
9// premier de la deuxième ligne devient le dernier de la premiere) et en
10// donnant la taille 500x149 -> il ne remonte aucun probleme, ce qui est
11// pervers!
12// - soit scilab me dit que la fonction fscanfMat ne dispose pas de
13// memoire suffisante pour lire la matrice
14// - soit scilab plante avec le message décrit ci-dessous.
15//
16// Lorsque je charge une matrice beaucoup plus grosse en nombre
17// d'éléments
18// (mais avec moins de colones), je n'ai aucun problème. Il ne s'agit
19// donc pas vraiment d'un problème de taille mémoire.
20// J'ai essayé d'augmenter la taille de la pile avec la commande
21// gstacksize
22// (n), mais cela n'a pas eu d'effet. Qu'en pensez vous?
23// La commande clear nettoie-t-elle efficacement la mémoire?
24// Merci de votre aide.
25
26// Copyright INRIA
27// Scilab Project - Pierre MARECHAL
28// Copyright INRIA 2006
29// Date : 9 janvier 2006
30
31a=rand(500,148)
32fprintfMat(TMPDIR+"/bug1620.txt",a);
33b=fscanfMat(TMPDIR+"/bug1620.txt");
34
35if or(size(b)<>[500 148]) then
36 affich_result(%F,1620);
37else
38 affich_result(%T,1620);
39end
diff --git a/tests/nonRegression/bug1625.sci b/tests/nonRegression/bug1625.sci
deleted file mode 100644
index cfdb251..0000000
--- a/tests/nonRegression/bug1625.sci
+++ /dev/null
@@ -1,33 +0,0 @@
1// <-- Non-regression test for bug 1625 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1625
5//
6// <-- Short Description -->
7// This problem concerns th datenum function:
8// I'm getting the following results
9//
10// -->datenum(1996,12,31)
11// ans =
12//
13// 729389.8
14//
15// -->datenum(1997,1,1)
16// ans =
17//
18// 1.5
19
20// Copyright INRIA
21// Scilab Project - Pierre MARECHAL
22// Copyright INRIA 2005
23// Date : 28 dcembre 2005
24
25test1 = ( datenum(1997,1,1) == 729391 );
26test2 = ( datenum(1996,12,31) == floor(datenum(1996,12,31)) );
27test3 = ( datenum(1997,1,1,23,59,59) - datenum(1997,1,1) < 1 )
28
29if ( test1 & test2 & test3 ) then
30 affich_result(%T,1625);
31else
32 affich_result(%F,1625);
33end
diff --git a/tests/nonRegression/bug1682.sci b/tests/nonRegression/bug1682.sci
deleted file mode 100644
index d227f4d..0000000
--- a/tests/nonRegression/bug1682.sci
+++ /dev/null
@@ -1,55 +0,0 @@
1// <-- Non-regression test for bug 1682 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1682
5//
6// <-- Short Description -->
7// Scilab 4.0 RC1 under Windows XP
8// The field Figure.rotation_style="multiple" does not work correctly.
9//
10// The rotation of the axes of the first system by the change of the field
11// Axes.rotation_angles does not force the rotation of the second one.
12//
13// When making a manual rotation, it works.
14//
15// Jacques-Deric
16
17
18// Copyright INRIA
19// Scilab Project - Jean-Baptiste Silvy
20// Copyright INRIA 2006
21// Date : 11 janvier 2006
22
23// Program Spas42151A
24// Designed for Scilab 3.1 & 4.0
25// Copyright Jacques-Deric Rouault, CNRS, INRIA
26
27disp ("4.21.51A");
28hf = scf (1);
29hf.figure_name = "4.21.51A";
30hf.background = 32;
31hf.rotation_style = "multiple";
32
33subplot (1, 2, 1);
34xfrect (0, 1, 1, 1);
35hr1 = gce ();
36hr1.background = 2;
37hr1.fill_mode = "on";
38ha1 = hr1.parent; // get the axes
39
40subplot (1, 2, 2);
41xfrect (0, 1, 1, 1);
42hr2 = gce ();
43hr2.background = 3;
44hr2.fill_mode = "on";
45ha2=hr2.parent; // get the axes
46
47newAngles = [60,200] ;
48ha1.rotation_angles = newAngles ;
49
50// check if both axes are turned
51if ( (ha1.rotation_angles == newAngles) & (ha2.rotation_angles == newAngles) ) then
52 affich_result(%T,1682);
53else
54 affich_result(%F,1682);
55end
diff --git a/tests/nonRegression/bug1684.sci b/tests/nonRegression/bug1684.sci
deleted file mode 100644
index 34ebaf7..0000000
--- a/tests/nonRegression/bug1684.sci
+++ /dev/null
@@ -1,38 +0,0 @@
1// <-- Non-regression test for bug 1684 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1684
5//
6// <-- Short Description -->
7// I can't compute the following expression:
8// A = 1 + -2;
9// I need to enter A = 1 + (-2);
10// I've got a program which generates automaticaly matlab scripts with this kind of
11// expressions and I don't want to change it to test is the value is negative and
12// then add parenthesis.
13
14// Copyright INRIA
15// Scilab Project - Serge Steer
16// Copyright INRIA 2005
17// Date : 6 mars 2006
18
19a=1+-1;
20ok1=a==0;
21a=1-+1;
22ok2=a==0;
23a=1++1;
24ok3=a==2;
25a=1--1;
26ok4=a==2;
27a=1*-1;
28ok5=a==-1;
29a=1*+1;
30ok6=a==1;
31a=2*+++--2;
32ok7=a==4;
33
34a=3+-1*+++--2;
35ok8=a==1;
36
37affich_result(ok1&ok2&ok3&ok4&ok5&ok6&ok7&ok8,1684);
38clear
diff --git a/tests/nonRegression/bug1693.sci b/tests/nonRegression/bug1693.sci
deleted file mode 100644
index 3d586db..0000000
--- a/tests/nonRegression/bug1693.sci
+++ /dev/null
@@ -1,111 +0,0 @@
1// <-- Non-regression test for bug 1693 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1693
5//
6// <-- Short Description -->
7// cd \ throws an error
8//
9// -->cd \
10// !--error 998
11// Can't go to directory \
12// at line 6 of function cd called by :
13// cd \
14//
15// In scilab-3.1.1, it works
16//
17// -->cd \
18// ans =
19//
20// C:\
21//
22// This was reported on the newsgroup:
23// http://groups.google.fr/group/comp.soft-
24// sys.math.scilab/browse_thread/thread/3e2f8a72af0148fd/e0f7866780de7fbf
25//
26// Since the Windows command interpreter accepts this (cd \ changes
27// ...
28
29// Copyright INRIA
30// Scilab Project - Pierre MARECHAL
31// Copyright INRIA 2005
32// Date : 28 dcembre 2005
33
34// ================== Test 1 ==================
35
36cd \
37
38if MSDOS
39 if pwd() <> 'C:\' then
40 test1 = %F;
41 else
42 test1 = %T;
43 end
44else
45 if pwd() <> '/' then
46 test1 = %F;
47 else
48 test1 = %T;
49 end
50end
51
52// ================== Test 2 ==================
53
54cd home
55
56if pwd() <> home then
57 test2 = %F;
58else
59 test2 = %T;
60end
61
62// ================== Test 3 ==================
63
64if MSDOS
65 cd WSCI
66 if pwd() <> WSCI then
67 test3 = %F;
68 else
69 test3 = %T;
70 end
71else
72 test3 = %T;
73end
74
75// ================== Test 4 ==================
76
77cd SCIHOME
78
79if pwd() <> SCIHOME then
80 test4 = %F;
81else
82 test4 = %T;
83end
84
85// ================== Test 5 ==================
86
87cd SCIHOME
88
89if pwd() <> SCIHOME then
90 test5 = %F;
91else
92 test5 = %T;
93end
94
95// ================== Test 6 ==================
96
97cd PWD
98
99if pwd() <> PWD then
100 test6 = %F;
101else
102 test6 = %T;
103end
104
105// ================== Result ==================
106
107if ( test1 & test2 & test3 & test4 & test5 & test6 ) then
108 affich_result(%T,1693);
109else
110 affich_result(%F,1693);
111end
diff --git a/tests/nonRegression/bug1711.sci b/tests/nonRegression/bug1711.sci
deleted file mode 100644
index 76083d6..0000000
--- a/tests/nonRegression/bug1711.sci
+++ /dev/null
@@ -1,35 +0,0 @@
1// <-- Non-regression test for bug 1711 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1711
5//
6// <-- Short Description -->
7// datenum() produces incorrect results. For example:
8//
9// -->datenum(2006,1,4)
10// ans =
11//
12// 4.5
13//
14// -->datenum()
15// ans =
16//
17// 4.8753166
18//
19// -->datevec(datenum())
20// ans =
21//
22// - 1. 13. 4. 21. 0. 27.783333
23
24// Copyright INRIA
25// Scilab Project - Pierre MARECHAL
26// Copyright INRIA 2005
27// Date : 28 dcembre 2005
28
29test1 = ( datenum(2006,1,4) == 732681 );
30
31if test1 then
32 affich_result(%T,1711);
33else
34 affich_result(%F,1711);
35end
diff --git a/tests/nonRegression/bug1712.sci b/tests/nonRegression/bug1712.sci
deleted file mode 100644
index 91ae4e7..0000000
--- a/tests/nonRegression/bug1712.sci
+++ /dev/null
@@ -1,42 +0,0 @@
1// <-- Non-regression test for bug 1712 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1712
5//
6// <-- Short Description -->
7// Logical binary operations &,| with hypermatrices fail, as shown in the
8// following examples. (The unary operation ~ succeeds.)
9//
10// -->hm=hypermat([2 2 2],1:8)
11//
12// -->hm>min(hm) & hm<max(hm)
13// !--error 4
14// undefined variable : %l_h_l
15//
16// -->hm==min(hm) | hm==max(hm)
17// !--error 4
18// undefined variable : %l_g_l
19//
20// -->~(hm==min(hm))
21// ans =
22//
23// (:,:,1)
24//
25// ! F T !
26// ! T T !
27// ...
28
29// Copyright INRIA
30// Scilab Project - Pierre MARECHAL
31// Copyright INRIA 2005
32// Date : 6 fevrier 2005
33
34hm=hypermat([2 2 2],1:8);
35test1 = execstr('hm>min(hm) & hm<max(hm)','errcatch');
36test2 = execstr('hm==min(hm) | hm==max(hm)','errcatch');
37
38if( (test1 == 0) & (test2 == 0) ) then
39 affich_result(%T,1712);
40else
41 affich_result(%F,1712);
42end
diff --git a/tests/nonRegression/bug1720.sci b/tests/nonRegression/bug1720.sci
deleted file mode 100644
index 663b816..0000000
--- a/tests/nonRegression/bug1720.sci
+++ /dev/null
@@ -1,39 +0,0 @@
1// <-- Non-regression test for bug 1720 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1720
5//
6// <-- Short Description -->
7// Scilab 4.0-RC1
8// Different default behavior of xfrect and xfarc
9// xfrec does not draw the limit of the rectangle
10// xfarc draws the limit of the circle
11//
12// I don't know which is right and which is wrong, but there is an obvious
13// inconsistency between the two behaviors
14//
15// Jacques-Deric
16
17// Copyright INRIA
18// Scilab Project - Jean-Baptiste Silvy
19// Copyright INRIA 2006
20// Date : 11 janvier 2006
21
22hf = scf(1) ;
23hf.figure_name = "4.13.22A1";
24ha = hf.children;
25ha.axes_visible = "on";
26ha.box = "on";
27xfrect (0,0.5,0.5,0.5);
28hr = gce();
29hr.background = 5;
30xfarc (0.5,1,0.5,0.5,0,23040);
31hc = gce();
32hc.background = 6;
33
34// check that xfarc fill the arc and don't draw the limit
35if ( hc.line_mode == 'off' ) then
36 affich_result(%T,1720);
37else
38 affich_result(%F,1720);
39end
diff --git a/tests/nonRegression/bug1725.sci b/tests/nonRegression/bug1725.sci
deleted file mode 100644
index 688d1bc..0000000
--- a/tests/nonRegression/bug1725.sci
+++ /dev/null
@@ -1,42 +0,0 @@
1// <-- Non-regression test for bug 1725 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1725
5//
6// <-- Short Description -->
7// the function mtlb_axis returns an index error when called with an
8// argument of [ 1 500 -22.3 1.4] or any other argument.
9//
10// This was traced to varargout(1) not being set to a.data_bounds within
11// the code segment
12// if rhs>0 then
13//
14// statements
15//
16// else// v = axis
17// else
18// varargout(1)=a.data_bounds;
19// end
20// endfunction
21//
22// Changing this to
23// if rhs>0 then
24//
25// statements
26// varargout(1)=a.data_bounds;
27// ...
28
29
30// Copyright INRIA
31// Scilab Project - Farid Belahcene
32// Copyright INRIA 2005
33// Date : 09 janvier 2006
34
35a = mtlb_axis([ 1 500 -22.3 1.4])
36test1 = ( a == [1 500 -22.3 1.4] )
37
38if ( test1 ) then
39 affich_result(%T,1725);
40else
41 affich_result(%F,1725);
42end
diff --git a/tests/nonRegression/bug1732.sci b/tests/nonRegression/bug1732.sci
deleted file mode 100644
index 66d5a96..0000000
--- a/tests/nonRegression/bug1732.sci
+++ /dev/null
@@ -1,35 +0,0 @@
1// <-- Non-regression test for bug 1732 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1732
5//
6// <-- Short Description -->
7// The field Axes.sub_tics does not correctly works under Linux, but correctly
8// works un Windows.
9//
10// Jacques-Deric
11
12// Copyright INRIA
13// Scilab Project - Jean-Baptiste Silvy
14// Copyright INRIA 2006
15// Date : 18 janvier 2006
16
17ref = [1,0,5] ;
18
19ha = gca () ;
20ha.axes_visible="on" ;
21ha.view = "3d" ;
22ha.sub_ticks = ref ;
23res1 = ha.sub_ticks ;
24
25// mask Z axis
26ha.rotation_angles = [1,30];
27res2 = ha.sub_ticks ;
28
29
30// check the sub_ticks were not modified
31if ( res1 == ref & res2 == ref ) then
32 affich_result(%T,1732);
33else
34 affich_result(%F,1732);
35end
diff --git a/tests/nonRegression/bug1736.sci b/tests/nonRegression/bug1736.sci
deleted file mode 100644
index 7252c64..0000000
--- a/tests/nonRegression/bug1736.sci
+++ /dev/null
@@ -1,21 +0,0 @@
1// <-- Non-regression test for bug 1736 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1736
5//
6// <-- Short Description -->
7// Actually this is the same bug as 608, but it has been
8// marked incorrectly as RESOLVED. The fix should be the
9// same I posted some years ago for version 2.7 and I'm
10// surprised it hasn't be applied a lot of years after it
11// has been indentified and posted a bug correction... There
12// is a problem with uint8 comparisons...
13
14// Copyright INRIA
15// Scilab Project - Serge Steer
16// Copyright INRIA 2006
17// Date : 11 janvier 2006
18
19a = uint8(rand(10,10)*100);
20ok=(a<=50)==(50>=a)
21affich_result(ok,1736);
diff --git a/tests/nonRegression/bug1742.sci b/tests/nonRegression/bug1742.sci
deleted file mode 100644
index cf5bb5e..0000000
--- a/tests/nonRegression/bug1742.sci
+++ /dev/null
@@ -1,29 +0,0 @@
1// <-- Non-regression test for bug 1742 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1742
5//
6// <-- Short Description -->
7// function [m]=msd(x,orien)
8// //This function computes the mean squared deviation of the values of a
9// //vector or matrix x.
10//
11// elseif orien=='r'|orien==1 then
12// m=sqrt(sum((x-ones(x(:,1))*mean(x,'r')).^2,'r')/ncol);
13//
14// This formula is wrong. Must be canged in:
15// m=sqrt(sum((x-ones(x(:,1))*mean(x,'r')).^2,'r')/nrow);
16
17// Copyright INRIA
18// Scilab Project - Serge Steer
19// Copyright INRIA 2006
20// Date : 4 mai 2006
21
22x=matrix([5 2:8],2,4);
23r=(msd(x)-3.5)<%eps
24r=r&norm(msd(x,1)-[3 1 1 1]/2)<%eps
25r=r&norm(msd(x,'r')-[3 1 1 1]/2)<%eps
26r=r&norm(msd(x,2)-sqrt([2;5]))<%eps
27r=r&norm(msd(x,'c')-sqrt([2;5]))<%eps
28
29affich_result(r,1742);
diff --git a/tests/nonRegression/bug1768.sci b/tests/nonRegression/bug1768.sci
deleted file mode 100644
index 48e48a5..0000000
--- a/tests/nonRegression/bug1768.sci
+++ /dev/null
@@ -1,36 +0,0 @@
1// <-- Non-regression test for bug 1768 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1768
5//
6// <-- Short Description -->
7// I just downloaded Scilab-4.0rc1.
8// Whenever I write a new function and try to write the relative help
9// file, xmltohtml crashes. Apparently, it does not found the whatis file
10// even if it was just created successfully
11
12// Copyright INRIA
13// Scilab Project - Serge Steer
14// Copyright INRIA 2005
15// Date : 20 janvier 2006
16
17function y=foo1(a,b)
18 y=a+b
19endfunction
20T=help_skeleton('foo1')
21mputl(strsubst(T,'<LINK> add a key here</LINK>','<LINK>abs</LINK>'), ...
22 TMPDIR+'/foo1.xml')
23ok=%t
24try
25 xmltohtml(TMPDIR)
26catch
27 ok=%f
28end
29if ok
30 try
31 xmltohtml('SCI/modules/elementaries_functions/help/'+getlanguage())
32 catch
33 ok=%f
34 end
35end
36affich_result(ok,1768);
diff --git a/tests/nonRegression/bug1772.sci b/tests/nonRegression/bug1772.sci
deleted file mode 100644
index 6347504..0000000
--- a/tests/nonRegression/bug1772.sci
+++ /dev/null
@@ -1,23 +0,0 @@
1// <-- Non-regression test for bug 1772 -->
2//
3// <-- Bugzilla URL -->
4// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1772
5//
6// <-- Short Description -->
7// There is a problem while inserting an object of type list in an undefined struct
8// field
9
10// Copyright INRIA
11// Scilab Project - Serge Steer
12// Copyright INRIA 2005
13// Date : 20 janvier 2006
14
15S.x=1;
16ok=%t
17try
18 S.y.z=list()
19catch
20 ok=%f
21end
22if ok then ok=S.y.z==list(),end
23affich_result(ok,1772);