summaryrefslogtreecommitdiffstats
path: root/scilab/modules/intersci
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-08-30 13:09:27 +0200
committerAllan CORNET <allan.cornet@scilab.org>2010-08-30 13:10:10 +0200
commit4f4b7a06e326894426d97f0310197339aa96df81 (patch)
tree52fce836f6f73621ee29b0ee6e6bbee6c47d36e3 /scilab/modules/intersci
parent62df049505870351d59d77cb383873b936b5a92f (diff)
downloadscilab-4f4b7a06e326894426d97f0310197339aa96df81.zip
scilab-4f4b7a06e326894426d97f0310197339aa96df81.tar.gz
fix test (remove display) intersci module
Change-Id: I68cd9b25a02683a77e529ef7002620faba6949d5
Diffstat (limited to 'scilab/modules/intersci')
-rw-r--r--scilab/modules/intersci/tests/nonreg_tests/bug_1957.dia.ref105
-rw-r--r--scilab/modules/intersci/tests/nonreg_tests/bug_1957.tst70
2 files changed, 60 insertions, 115 deletions
diff --git a/scilab/modules/intersci/tests/nonreg_tests/bug_1957.dia.ref b/scilab/modules/intersci/tests/nonreg_tests/bug_1957.dia.ref
index c1ecd8e..1bcbedc 100644
--- a/scilab/modules/intersci/tests/nonreg_tests/bug_1957.dia.ref
+++ b/scilab/modules/intersci/tests/nonreg_tests/bug_1957.dia.ref
@@ -14,88 +14,45 @@
14// moins scalaires) 14// moins scalaires)
15tab = ascii(9); 15tab = ascii(9);
16path = TMPDIR; 16path = TMPDIR;
17ilib_verbose(0);
17desc=['foo'+tab+'x'+tab+'y'+tab+'[ITMAX 2000]'+tab+'[eps 0.001]' 18desc=['foo'+tab+'x'+tab+'y'+tab+'[ITMAX 2000]'+tab+'[eps 0.001]'
18 'x'+tab+'scalar' 19 'x'+tab+'scalar'
19 'y'+tab+'scalar' 20 'y'+tab+'scalar'
20 'ITMAX'+tab+'scalar' 21 'ITMAX'+tab+'scalar'
21 'eps '+tab+'scalar' 22 'eps '+tab+'scalar'
22 'r'+tab+'vector 4' 23 'r'+tab+'vector 4'
23 '' 24 ''
24 'foo'+tab+'x'+tab+'y'+tab+' ITMAX'+tab+'eps'+tab+'r' 25 'foo'+tab+'x'+tab+'y'+tab+' ITMAX'+tab+'eps'+tab+'r'
25 'x'+tab+'double' 26 'x'+tab+'double'
26 'y'+tab+'double' 27 'y'+tab+'double'
27 'ITMAX'+tab+'integer' 28 'ITMAX'+tab+'integer'
28 'eps'+tab+'double' 29 'eps'+tab+'double'
29 'r'+tab+'double' 30 'r'+tab+'double'
30 '' 31 ''
31 'out sequence'+tab+'r' 32 'out sequence'+tab+'r'
32 '*******************']; 33 '*******************'];
33mputl(desc,path+'/intsfoo.desc') 34mputl(desc,path+'/intsfoo.desc')
34foo_code=['#include ""stack-c.h""' 35 ans =
35 'void C2F(foo)(double *x,double *y,int *ITMAX,double *eps,double *r)'
36 ' {'
37 ' r[0]=*x; r[1]=*y; r[2]=*ITMAX; r[3]=*eps;'
38 ' }'];
39mputl(foo_code,path+'/foo.c')
40intersci=getshortpathname(SCI+'/modules/intersci/bin/intersci-n')
41 intersci =
42 36
43 SCI/modules/intersci/bin/intersci-n 37 T
38foo_code=['#include ""stack-c.h""'
39 'void C2F(foo)(double *x,double *y,int *ITMAX,double *eps,double *r)'
40 ' {'
41 ' r[0]=*x; r[1]=*y; r[2]=*ITMAX; r[3]=*eps;'
42 ' }'];
43mputl(foo_code,path+'/foo.c');
44intersci=getshortpathname(SCI+'/modules/intersci/bin/intersci-n');
44curpath=pwd(); 45curpath=pwd();
45chdir(path); 46chdir(path);
46try 47try
47 unix_s(intersci+' intsfoo') 48 unix_s(intersci+' intsfoo');
48 ilib_build('buglib',['bug1957','intsfoo'],['foo.o','intsfoo.o'],[]) 49 ilib_build('buglib',['bug1957','intsfoo'],['foo.o','intsfoo.o'],[])
49 Generate a gateway file 50 exec loader.sce;
50 Generate a loader file
51 Generate a Makefile: Makelib
52 Running the makefile
53 Compilation of foo
54 Compilation of intsfoo
55 Building shared library (be patient)
56 exec loader.sce
57
58// ------------------------------------------------------
59
60// generated by builder.sce: Please do not edit this file
61
62// ------------------------------------------------------
63
64
65buglib_path = get_file_path('loader.sce');
66
67list_functions = [ 'bug1957';
68];
69
70addinter(buglib_path+'/buglib.dll','buglib',list_functions);
71Shared archive loaded.
72Link done.
73
74// remove temp. variables on stack
75
76clear buglib_path;
77
78clear list_functions;
79
80clear get_file_path;
81
82// ------------------------------------------------------
83
84catch 51catch
85 if %T then bugmes();quit;end 52 if %T then bugmes();quit;end
86 return 53 return
87end 54end
88chdir(curpath); 55chdir(curpath);
89res=bug1957(1.2,-2.3); 56res=bug1957(1.2,-2.3);
90VAL = 2000; 57VAL = 2000;
91if norm(res-[1.2,-2.3,VAL,0.001])-VAL >= 2d-1 then bugmes();quit;end 58if norm(res-[1.2,-2.3,VAL,0.001]) >= 2d-1 then bugmes();quit;end
92ITMAX=33;
93res=bug1957(1.2,-2.3);
94if norm(res-[1.2,-2.3,33,0.001])-ITMAX >= 2d-1 then bugmes();quit;end
95eps=1d-7;
96res=bug1957(1.2,-2.3);
97VAL = 2000;
98if norm(res-[1.2,-2.3,VAL,1d-7])-VAL >= 2d-1 then bugmes();quit;end
99ITMAX=33;
100res=bug1957(1.2,-2.3);
101if norm(res-[1.2,-2.3,ITMAX,1d-7])-ITMAX >= 2d-1 then bugmes();quit;end
diff --git a/scilab/modules/intersci/tests/nonreg_tests/bug_1957.tst b/scilab/modules/intersci/tests/nonreg_tests/bug_1957.tst
index 4abe1cb..c1f0763 100644
--- a/scilab/modules/intersci/tests/nonreg_tests/bug_1957.tst
+++ b/scilab/modules/intersci/tests/nonreg_tests/bug_1957.tst
@@ -11,68 +11,56 @@
11// http://bugzilla.scilab.org/show_bug.cgi?id=1957 11// http://bugzilla.scilab.org/show_bug.cgi?id=1957
12// 12//
13// <-- Short Description --> 13// <-- Short Description -->
14// Non fonctionnement de intersci pour les variables optionnelles (au 14// Non fonctionnement de intersci pour les variables optionnelles (au
15// moins scalaires) 15// moins scalaires)
16 16
17tab = ascii(9); 17tab = ascii(9);
18path = TMPDIR; 18path = TMPDIR;
19ilib_verbose(0);
19 20
20desc=['foo'+tab+'x'+tab+'y'+tab+'[ITMAX 2000]'+tab+'[eps 0.001]' 21desc=['foo'+tab+'x'+tab+'y'+tab+'[ITMAX 2000]'+tab+'[eps 0.001]'
21 'x'+tab+'scalar' 22 'x'+tab+'scalar'
22 'y'+tab+'scalar' 23 'y'+tab+'scalar'
23 'ITMAX'+tab+'scalar' 24 'ITMAX'+tab+'scalar'
24 'eps '+tab+'scalar' 25 'eps '+tab+'scalar'
25 'r'+tab+'vector 4' 26 'r'+tab+'vector 4'
26 '' 27 ''
27 'foo'+tab+'x'+tab+'y'+tab+' ITMAX'+tab+'eps'+tab+'r' 28 'foo'+tab+'x'+tab+'y'+tab+' ITMAX'+tab+'eps'+tab+'r'
28 'x'+tab+'double' 29 'x'+tab+'double'
29 'y'+tab+'double' 30 'y'+tab+'double'
30 'ITMAX'+tab+'integer' 31 'ITMAX'+tab+'integer'
31 'eps'+tab+'double' 32 'eps'+tab+'double'
32 'r'+tab+'double' 33 'r'+tab+'double'
33 '' 34 ''
34 'out sequence'+tab+'r' 35 'out sequence'+tab+'r'
35 '*******************']; 36 '*******************'];
36 37
37mputl(desc,path+'/intsfoo.desc') 38mputl(desc,path+'/intsfoo.desc')
38 39
39foo_code=['#include ""stack-c.h""' 40foo_code=['#include ""stack-c.h""'
40 'void C2F(foo)(double *x,double *y,int *ITMAX,double *eps,double *r)' 41 'void C2F(foo)(double *x,double *y,int *ITMAX,double *eps,double *r)'
41 ' {' 42 ' {'
42 ' r[0]=*x; r[1]=*y; r[2]=*ITMAX; r[3]=*eps;' 43 ' r[0]=*x; r[1]=*y; r[2]=*ITMAX; r[3]=*eps;'
43 ' }']; 44 ' }'];
44 45
45mputl(foo_code,path+'/foo.c') 46mputl(foo_code,path+'/foo.c');
46 47
47intersci=getshortpathname(SCI+'/modules/intersci/bin/intersci-n') 48intersci=getshortpathname(SCI+'/modules/intersci/bin/intersci-n');
48 49
49curpath=pwd(); 50curpath=pwd();
50chdir(path); 51chdir(path);
51 52
52try 53try
53 unix_s(intersci+' intsfoo') 54 unix_s(intersci+' intsfoo');
54 ilib_build('buglib',['bug1957','intsfoo'],['foo.o','intsfoo.o'],[]) 55 ilib_build('buglib',['bug1957','intsfoo'],['foo.o','intsfoo.o'],[])
55 exec loader.sce 56 exec loader.sce;
56catch 57catch
57 if %T then pause,end 58 if %T then pause,end
58 return 59 return
59end 60end
60 61
61chdir(curpath); 62chdir(curpath);
62 63
63res=bug1957(1.2,-2.3); 64res=bug1957(1.2,-2.3);
64VAL = 2000; 65VAL = 2000;
65if norm(res-[1.2,-2.3,VAL,0.001])-VAL >= 2d-1 then pause,end 66if norm(res-[1.2,-2.3,VAL,0.001]) >= 2d-1 then pause,end
66
67ITMAX=33;
68res=bug1957(1.2,-2.3);
69if norm(res-[1.2,-2.3,33,0.001])-ITMAX >= 2d-1 then pause,end
70
71eps=1d-7;
72res=bug1957(1.2,-2.3);
73VAL = 2000;
74if norm(res-[1.2,-2.3,VAL,1d-7])-VAL >= 2d-1 then pause,end
75
76ITMAX=33;
77res=bug1957(1.2,-2.3);
78if norm(res-[1.2,-2.3,ITMAX,1d-7])-ITMAX >= 2d-1 then pause,end