summaryrefslogtreecommitdiff
path: root/src/tests/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-04-16 15:33:10 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:21 +0100
commit07133df0b59a176c6ad895c4c3010d33fcad8a71 (patch)
tree7dddea78df2961b8fe2ba889f623759aa767340d /src/tests/elua
parente8a4f47f93605c75700d826a8339ca60bc7d32b4 (diff)
elua lib: test error reporting + lua stack state
Diffstat (limited to 'src/tests/elua')
-rw-r--r--src/tests/elua/elua_lib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tests/elua/elua_lib.c b/src/tests/elua/elua_lib.c
index 6d261c8574..4bf77962d1 100644
--- a/src/tests/elua/elua_lib.c
+++ b/src/tests/elua/elua_lib.c
@@ -60,7 +60,17 @@ START_TEST(elua_api)
60 fail_if(elua_util_string_run(st, "return 1337", "foo")); 60 fail_if(elua_util_string_run(st, "return 1337", "foo"));
61 fail_if(!elua_util_string_run(st, "foo bar", "foo")); /* invalid code */ 61 fail_if(!elua_util_string_run(st, "foo bar", "foo")); /* invalid code */
62 fail_if(!elua_util_app_load(st, "lualian")); 62 fail_if(!elua_util_app_load(st, "lualian"));
63 fail_if(lua_type(lst, -1) != LUA_TFUNCTION);
64 lua_pop(lst, 1);
63 fail_if(elua_util_app_load(st, "non_existent_app")); 65 fail_if(elua_util_app_load(st, "non_existent_app"));
66 fail_if(lua_type(lst, -1) != LUA_TSTRING);
67 lua_pop(lst, 1);
68
69 /* halfassed testing here, but not possible otherwise */
70 fail_if(elua_util_error_report(st, "foo", 0));
71 lua_pushliteral(lst, "msg");
72 fail_if(!elua_util_error_report(st, "foo", 5));
73 fail_if(lua_gettop(lst) > 0);
64 74
65 elua_state_free(st); 75 elua_state_free(st);
66 76