lua-users home
lua-l archive

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


On 29 March 2011 18:25, Simon Bernard <sbernard@sierrawireless.com> wrote:
> Hi,
>
>   I have a strange behavior with the popen function when I use it with
> luajava on winXP 32bit.(On linux no problem detected).
>
>
>
>   I use the luajava eclipse plugin, and try to execute this code (in a
> plugin Junit Test case) :
>
>
>
> ===============================================
>
> Junit Test case :
>
> @Test
>
> public void popen()
>
> {
>
>       l.getGlobal("require");
>
>       l.pushString("tests.simpletest");
>
>       if (l.pcall( 1, 1, 0) != 0)
>
>         l.error();
>
>       l.pop(-1);

Have a look at:

  http://www.lua.org/manual/5.1/manual.html#lua_pop

lua_pop takes a positive argument of n elements to remove from top of the stack.

>       l.getGlobal("popenTest");
>
>       if (l.pcall( 0, 0, 0) != 0)
>
>         l.error();
>
> }