efl/src/tests/elua/elua_lib.c

40 lines
597 B
C
Raw Normal View History

2015-04-16 02:55:27 -07:00
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include<Eina.h>
#include "Elua.h"
#include "elua_suite.h"
START_TEST(elua_api)
2015-04-16 02:55:27 -07:00
{
2015-04-16 06:02:21 -07:00
Elua_State *st;
lua_State *lst;
fail_if(!elua_init());
2015-04-16 06:02:21 -07:00
st = elua_state_new("test");
fail_if(!st);
2015-04-16 06:02:21 -07:00
lst = elua_state_lua_state_get(st);
fail_if(!lst);
fail_if(elua_state_from_lua_state_get(lst) != st);
2015-04-16 06:08:28 -07:00
fail_if(strcmp(elua_state_prog_name_get(st), "test"));
elua_state_free(st);
elua_shutdown();
2015-04-16 02:55:27 -07:00
}
END_TEST
2015-04-16 02:55:27 -07:00
void elua_lib_test(TCase *tc)
{
tcase_add_test(tc, elua_api);
2015-04-16 02:55:27 -07:00
}