| 25 | }; |
| 26 | |
| 27 | TEST_F(ScriptJsonTest, TestJson) |
| 28 | { |
| 29 | int top = lua_gettop(L); |
| 30 | |
| 31 | ASSERT_TRUE(RunFile(L, "test_json.luac")); |
| 32 | |
| 33 | lua_getglobal(L, "functions"); |
| 34 | ASSERT_EQ(LUA_TTABLE, lua_type(L, -1)); |
| 35 | lua_getfield(L, -1, "test_json"); |
| 36 | ASSERT_EQ(LUA_TFUNCTION, lua_type(L, -1)); |
| 37 | int result = dmScript::PCall(L, 0, LUA_MULTRET); |
| 38 | if (result == LUA_ERRRUN) |
| 39 | { |
| 40 | ASSERT_TRUE(false); |
| 41 | } |
| 42 | else |
| 43 | { |
| 44 | ASSERT_EQ(0, result); |
| 45 | } |
| 46 | lua_pop(L, 1); |
| 47 | |
| 48 | |
| 49 | ASSERT_EQ(top, lua_gettop(L)); |
| 50 | } |
| 51 | |
| 52 | TEST_F(ScriptJsonTest, TestJsonToLua) |
| 53 | { |
nothing calls this directly
no test coverage detected