luasandbox  1.4.0
Generic Lua sandbox for dynamic data analysis
Macros | Functions | Variables
sandbox.h File Reference

Test interface for the generic lua sandbox. More...

#include <stddef.h>
#include "../../luasandbox.h"
#include "../error.h"
#include "../lua.h"
Include dependency graph for sandbox.h:

Go to the source code of this file.

Macros

#define LSB_TEST_EXPORT
 

Functions

LSB_TEST_EXPORT int lsb_test_process (lsb_lua_sandbox *lsb, double tc)
 Function to emulate processing data. More...
 
LSB_TEST_EXPORT int lsb_test_report (lsb_lua_sandbox *lsb, double tc)
 Function to emulate outputting summary data. More...
 
LSB_TEST_EXPORT int lsb_test_write_output (lua_State *lua)
 Callback for collecting output, places a pointer to the results in the global lsb_test_output variable )not thread safe) More...
 

Variables

LSB_TEST_EXPORT const char * lsb_test_output
 Global variable to store the test output. More...
 
LSB_TEST_EXPORT size_t lsb_test_output_len
 Global variable storing the length of the current test output string. More...
 
LSB_TEST_EXPORT lsb_logger lsb_test_logger
 Generaly purpose stderr logger. More...
 

Detailed Description

Test interface for the generic lua sandbox.

Definition in file sandbox.h.

Macro Definition Documentation

#define LSB_TEST_EXPORT

Definition at line 27 of file sandbox.h.

Function Documentation

LSB_TEST_EXPORT int lsb_test_process ( lsb_lua_sandbox lsb,
double  tc 
)

Function to emulate processing data.

Parameters
lsbPointer to a lua sandbox
tcTest case number to control how the sandbox state is updated
Returns
LSB_TEST_EXPORT int Status value returned from the sandbox
LSB_TEST_EXPORT int lsb_test_report ( lsb_lua_sandbox lsb,
double  tc 
)

Function to emulate outputting summary data.

Parameters
lsbPointer to a lua sandbox
tcTest case number to control what data is returned and how the state is updated
Returns
LSB_TEST_EXPORT int 0 on success, 1 on failure
LSB_TEST_EXPORT int lsb_test_write_output ( lua_State lua)

Callback for collecting output, places a pointer to the results in the global lsb_test_output variable )not thread safe)

Parameters
luaLua state
Returns
LSB_TEST_EXPORT int 0 or lua_error

Variable Documentation

LSB_TEST_EXPORT lsb_logger lsb_test_logger

Generaly purpose stderr logger.

LSB_TEST_EXPORT const char* lsb_test_output

Global variable to store the test output.

LSB_TEST_EXPORT size_t lsb_test_output_len

Global variable storing the length of the current test output string.