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://bugzilla.scilab.org/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_directory = pwd();
24 TMP_directory = pwd();
25 mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[''mexfunction16.c''],[],''Makelib'','''','''','''')','builder.sce');
29 'void mexFunction(nlhs, plhs, nrhs, prhs)'
31 ' mxArray *plhs[]; mxArray *prhs[];'
33 ' int *dims = mxGetDimensions(prhs[0]);'
34 ' sciprint(""%d %d %d\n"",dims[0],dims[1],dims[2]);'
45 dia = mgetl('bug614.dia');
46 cd(my_current_directory);
48 if find(dia == "2 3 2") == [] then pause,end