summaryrefslogtreecommitdiffstats
path: root/scilab/modules/intersci/tests/nonreg_tests/bug_1957.dia.ref
blob: 1bcbedc1305ec1862cf9caed339b163ed3d9ce9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2006-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- Non-regression test for bug 1957 -->
//
// <-- Bugzilla URL -->
// http://bugzilla.scilab.org/show_bug.cgi?id=1957
//
// <-- Short Description -->
//    Non fonctionnement de intersci pour les variables optionnelles (au
//    moins scalaires)
tab  = ascii(9);
path = TMPDIR;
ilib_verbose(0);
desc=['foo'+tab+'x'+tab+'y'+tab+'[ITMAX 2000]'+tab+'[eps 0.001]'
        'x'+tab+'scalar'
        'y'+tab+'scalar'
        'ITMAX'+tab+'scalar'
        'eps '+tab+'scalar'
        'r'+tab+'vector 4'
        ''
        'foo'+tab+'x'+tab+'y'+tab+' ITMAX'+tab+'eps'+tab+'r'
        'x'+tab+'double'
        'y'+tab+'double'
        'ITMAX'+tab+'integer'
        'eps'+tab+'double'
        'r'+tab+'double'
        ''
        'out sequence'+tab+'r'
        '*******************'];
mputl(desc,path+'/intsfoo.desc')
 ans  =
 
  T  
foo_code=['#include ""stack-c.h""'
        'void C2F(foo)(double *x,double *y,int *ITMAX,double *eps,double *r)'
        '  {'
        '    r[0]=*x; r[1]=*y; r[2]=*ITMAX; r[3]=*eps;'
        '  }'];
mputl(foo_code,path+'/foo.c');
intersci=getshortpathname(SCI+'/modules/intersci/bin/intersci-n');
curpath=pwd();
chdir(path);
try
    unix_s(intersci+' intsfoo');
    ilib_build('buglib',['bug1957','intsfoo'],['foo.o','intsfoo.o'],[])
    exec loader.sce;
catch
    if %T then bugmes();quit;end
    return
end
chdir(curpath);
res=bug1957(1.2,-2.3);
VAL = 2000;
if norm(res-[1.2,-2.3,VAL,0.001])  >= 2d-1 then bugmes();quit;end