summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSerge Steer <serge.steer@scilab.org>2007-02-19 17:38:35 +0000
committerSerge Steer <serge.steer@scilab.org>2007-02-19 17:38:35 +0000
commit935a5173977c705bd461a17a95f52ae93bc08087 (patch)
treef40a3573095603e63877d14b84ee58c76401739c /tests
parent252954308c8b96986071beebac42d85ae58bcdee (diff)
downloadscilab-935a5173977c705bd461a17a95f52ae93bc08087.zip
scilab-935a5173977c705bd461a17a95f52ae93bc08087.tar.gz
bug2052.sci added
Diffstat (limited to 'tests')
-rw-r--r--tests/nonRegression/bug2052.sci50
-rw-r--r--tests/nonRegression/list_nonreg.txt1
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/nonRegression/bug2052.sci b/tests/nonRegression/bug2052.sci
new file mode 100644
index 0000000..27f23a7
--- /dev/null
+++ b/tests/nonRegression/bug2052.sci
@@ -0,0 +1,50 @@
1// Non-regression test file for bug 2052
2// Serge Steer - Scilab Project
3// Copyright INRIA
4// 19/02/2007
5
6mode(-1);
7clear;
8cur=pwd();
9cd(TMPDIR);
10//first create a function changetype
11code=['#include ""stack-c.h""'
12'int intchangetype(fname)'
13' char *fname;'
14'{'
15' int m1,n1,l1;'
16' CheckRhs(2,2);'
17' CheckLhs(1,1);'
18' GetRhsVar(2,""i"",&m1,&n1,&l1)'
19' /* change the type */'
20' *istk(iadr(*Lstk(Top-1)))=*istk(l1);'
21' C2F(intersci).ntypes[0] = ''$'';'
22' LhsVar(1)=1;'
23' return 0;'
24'}'];
25mputl(code,'intchangetype.c');
26ilib_build('libtest',['changetype','intchangetype'],'intchangetype',[]);
27exec('loader.sce')
28cd(cur);
29
30
31//create variables of type 222
32A=rand(3,2);
33a=changetype(A,222);
34//associate a typename to 222
35typename("bug2052", 222)
36//define overloading function for isequal
37function r=%bug2052_isequal(x,y)
38 r=type(x)==222&type(y)==222
39 if r then
40 x=changetype(x,1)
41 y=changetype(y,1)
42 r=r&and(x==y)
43 end
44endfunction
45//Check if everything is ok
46l=list(1,2,3);
47r=isequal(a,a)&~isequal(a,A)&~isequal(A,a)&isequal(A,A)&isequal(l,l)&~isequal(l,A);
48
49affich_result(r,2052);
50clear
diff --git a/tests/nonRegression/list_nonreg.txt b/tests/nonRegression/list_nonreg.txt
index 35556ac..7b9fa46 100644
--- a/tests/nonRegression/list_nonreg.txt
+++ b/tests/nonRegression/list_nonreg.txt
@@ -147,6 +147,7 @@
1472038 1472038
1482039 1482039
1492045 1492045
1502052
1502067 1512067
1512067 1522067
1522092 1532092