MCPcopy Create free account
hub / github.com/defold/defold / TEST_F

Function TEST_F

engine/script/src/test/test_script_json.cpp:27–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25};
26
27TEST_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
52TEST_F(ScriptJsonTest, TestJsonToLua)
53{

Callers

nothing calls this directly

Calls 14

lua_gettopFunction · 0.85
lua_typeFunction · 0.85
lua_getfieldFunction · 0.85
PCallFunction · 0.85
mallocFunction · 0.85
JsonToLuaFunction · 0.85
freeFunction · 0.85
lua_pushstringFunction · 0.85
lua_setfieldFunction · 0.85
lua_pushnumberFunction · 0.85
lua_pushintegerFunction · 0.85
LuaToJsonFunction · 0.85

Tested by

no test coverage detected