| 45 | } |
| 46 | |
| 47 | string WhoIsCalling() |
| 48 | { |
| 49 | asIScriptContext* ctx = asGetActiveContext(); |
| 50 | string callingFunction; |
| 51 | |
| 52 | // Test calling GetThisPointer at each level, including the ones indicating nested states |
| 53 | for (asUINT n = 0; n < ctx->GetCallstackSize(); n++) |
| 54 | { |
| 55 | asIScriptFunction *func = ctx->GetFunction(n); |
| 56 | callingFunction = func ? func->GetName() : ""; |
| 57 | |
| 58 | void *obj = ctx->GetThisPointer(n); |
| 59 | assert(obj == 0); |
| 60 | void* var = ctx->GetAddressOfVar(0, n); |
| 61 | } |
| 62 | return callingFunction; |
| 63 | } |
| 64 | |
| 65 | bool TestNested() |
| 66 | { |
nothing calls this directly
no test coverage detected