MCPcopy Create free account
hub / github.com/anjo76/angelscript / DebugCall

Function DebugCall

sdk/tests/test_feature/source/test_debug.cpp:1065–1081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1063// In this test we'll use the debug functions to update a script parameter directly on the stack
1064
1065void DebugCall()
1066{
1067 asIScriptContext *ctx = asGetActiveContext();
1068
1069 // Get the address of the output parameter
1070 void *varPointer = ctx->GetAddressOfVar(0, 0);
1071
1072 // We got the address to the handle
1073 CScriptString **str = (CScriptString**)varPointer;
1074
1075 // Set the handle to point to a new string
1076 *str = new CScriptString("test");
1077
1078 // It is possible to determine the function that is being called too
1079 asIScriptFunction *func = ctx->GetSystemFunction();
1080 assert( std::string(func->GetDeclaration()) == "void debugCall()" );
1081}
1082
1083bool Test2()
1084{

Callers

nothing calls this directly

Calls 3

GetAddressOfVarMethod · 0.80
GetSystemFunctionMethod · 0.80
GetDeclarationMethod · 0.80

Tested by

no test coverage detected