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

Function LuaSourceFromText

engine/script/src/test/test_script_module.cpp:31–43  ·  view source on GitHub ↗

NOTE: we don't generate actual bytecode for this test-data, so just pass in regular lua source instead.

Source from the content-addressed store, hash-verified

29// NOTE: we don't generate actual bytecode for this test-data, so
30// just pass in regular lua source instead.
31static dmLuaDDF::LuaSource* LuaSourceFromText(const char *text)
32{
33 static dmLuaDDF::LuaSource tmp;
34 memset(&tmp, 0x00, sizeof(tmp));
35 tmp.m_Script.m_Data = (uint8_t*)text;
36 tmp.m_Script.m_Count = strlen(text);
37 tmp.m_Bytecode.m_Data = (uint8_t*)text;
38 tmp.m_Bytecode.m_Count = strlen(text);
39 tmp.m_Bytecode64.m_Data = (uint8_t*)text;
40 tmp.m_Bytecode64.m_Count = strlen(text);
41 tmp.m_Filename = "dummy";
42 return &tmp;
43}
44
45TEST_F(ScriptModuleTest, TestModule)
46{

Callers 1

TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected