1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2006-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
8 // <-- Non-regression test for bug 614 -->
10 // <-- Bugzilla URL -->
11 // http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=614
13 // <-- Short Description -->
14 // mxGetDimensions() from mex.h and mexlib.c do not work
15 // properly. The reason is that it returns a pointer to int
16 // like Matlab, but in fact, the dimensions in scilab are in
19 // Also occur in other OS's.
21 my_current_direcory = pwd();
24 mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[],[],''Makelib'','''','''','''')','builder.sce')
28 'void mexFunction(nlhs, plhs, nrhs, prhs)'
30 ' mxArray *plhs[]; mxArray *prhs[];'
32 ' int *dims = mxGetDimensions(prhs[0]);'
33 ' sciprint(""%d %d %d\n"",dims[0],dims[1],dims[2]);'
37 exec(TMPDIR+'/builder.sce');
38 exec(TMPDIR+'/loader.sce');
44 dia = mgetl('bug614.dia');
45 cd(my_current_direcory)
47 if find(dia == "2 3 2") == [] then pause,end