lua-users home
lua-l archive

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


Hi,

In my research group we have a tool that generates test cases from formal specifications (B-Method, specifically). We have created a B specification to represent the Lua API and we want to validate our model by verifying if the tests created from it are consistent with the real API.

Our tool is capable of defining positive and negative tests. Positive test cases use input data that are valid according to the source specification and negative test cases use input data that are not predicted by the specification. Negative test cases are important to evaluate the behaviour of the system when it receives input combinations that were not foreseen in the model.

In some negative test cases created for the Lua API, the test requires a Stack which is full (or that is not possible to push a new element to it). I understand that the Stack is "full" when I call lua_checkstack and it returns false, that means I cannot push a new element because we don't have free stack slots in the stack. I tried to force this situation by calling lua_settop with big numbers or calling lua_pushnil several times, but neither worked.

I want to know if anyone knows how I can force this situation, forcing lua_checkstack returns false. I need this to validate my model and to see what is the behavior of the API when I try to push a new element when the stack is "full".

Thanks!
João Batista.