help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to wrap "lighting phong;" with a mock funtion?


From: Andreas Romeyke
Subject: How to wrap "lighting phong;" with a mock funtion?
Date: Mon, 14 May 2007 15:38:24 +0200
User-agent: IceDove 1.5.0.10 (X11/20070329)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

In a testsuite I want to test functions written originally in matlab.
One of them contains a line "lighting phong;". This line produces an
error under Octave2.9.x:

    >> lighting phong;
    parse error:

      syntax error


How can I write a mock function to make Octave 2.9.x ignore this line?

In my testsuite I use something like this to ignore a set of GUI
functions:

   if any(which('OCTAVE_VERSION')) && strncmp(OCTAVE_VERSION, '2.9', 3)
        disp ('adding ''octavefun/'' containing wrappers');
        %%% update dispatch table
        if ~exist('findobj'), dispatch('findobj',
strcat(pwd,'/octavefun/findobj.m', 'any')), end;
        if ~exist('gca'), dispatch('gca',
strcat(pwd,'/octavefun/gca.m', 'any')), end;
        if ~exist('gcf'), dispatch('gcf',
strcat(pwd,'/octavefun/gcf.m', 'any')), end;
        if ~exist('get'), dispatch('get',
strcat(pwd,'/octavefun/get.m', 'any')), end;
        if ~exist('jet'), dispatch('jet',
strcat(pwd,'/octavefun/jet.m', 'any')), end;
        if ~exist('lasterror'), dispatch('lasterror',
strcat(pwd,'/octavefun/lasterror.m', 'any')), end;
        if ~exist('lighting'), dispatch('lighting',
strcat(pwd,'/octavefun/lighting.m', 'any')), end;
        if ~exist('rotate3d'), dispatch('rotate3d',
strcat(pwd,'/octavefun/rotate3d.m', 'any')), end;
        if ~exist('set'), dispatch('set',
strcat(pwd,'/octavefun/set.m', 'any')), end;
        if ~exist('uicontrol'), dispatch('uicontrol',
strcat(pwd,'/octavefun/uicontrol.m', 'any')), end;
        if ~exist('uimenu'), dispatch('uimenu',
strcat(pwd,'/octavefun/uimenu.m', 'any')), end;
        if ~exist('what'), dispatch('what',
strcat(pwd,'/octavefun/what.m', 'any')), end;
        if ~exist('x_addpath'), dispatch('x_addpath',
strcat(pwd,'/octavefun/x_addpath.m', 'any')), end;
    end;

In octavefun/ there are my mockfunction, pE. "gca.m":

    function ret=gca(varargin)
    ret = [1]
    disp('<-- gca');


But how can I write a mock for "lighting", so that the line described
on top will not fail in Octave 2.9.x?

Any hints?

- --
Software Developer / Dipl. Inform. (FH)
Max Planck Institute for Human Cognitive and Brain Sciences
Department of Psychology
Stephanstr. 1a, 04103 Leipzig, Germany

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGSGZPGBhgJGthyeERAo5OAKC0Dgc+JhtuPJfsKxiHNfxVgsmnjgCdEENr
IKg2LSNZ3/T1I7WtrxnYhqA=
=ymW0
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]