diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-09-03 15:21:27 (GMT) |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-09-07 08:00:11 (GMT) |
commit | 4a1c5f08328e369ae285a26738694b33542f5047 (patch) | |
tree | 917ec7d6ba7ef040ebc624f95cdfcda3aace462f /tests/auto/qscriptengineagent | |
parent | d9abfdc26d711ffdfcbb8ac04a314aa80396e56f (diff) | |
download | Qt-4a1c5f08328e369ae285a26738694b33542f5047.zip Qt-4a1c5f08328e369ae285a26738694b33542f5047.tar.gz Qt-4a1c5f08328e369ae285a26738694b33542f5047.tar.bz2 |
New function added to QScriptEngineAgent autotest
Function convert numeric ScriptEngineEvent::Type to QString. It is not
used in test but really useful in debugging
Reviewed-by: Kent Hansen
Diffstat (limited to 'tests/auto/qscriptengineagent')
-rw-r--r-- | tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index f92bec3..3d1cbe8 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -176,6 +176,22 @@ struct ScriptEngineEvent : type(ExceptionThrow), scriptId(scriptId), value(exception), hasExceptionHandler(hasHandler) { } + + static QString typeToQString(Type t) + { + switch (t) { + case ScriptEngineEvent::ScriptLoad: return "ScriptLoad"; + case ScriptEngineEvent::ScriptUnload: return "ScriptUnload"; + case ScriptEngineEvent::ContextPush: return "ContextPush"; + case ScriptEngineEvent::ContextPop: return "ContextPop"; + case ScriptEngineEvent::FunctionEntry: return "FunctionEntry"; + case ScriptEngineEvent::FunctionExit: return "FunctionExit"; + case ScriptEngineEvent::PositionChange: return "PositionChange"; + case ScriptEngineEvent::ExceptionThrow: return "ExceptionThrow"; + case ScriptEngineEvent::ExceptionCatch: return "ExceptionCatch"; + case ScriptEngineEvent::DebuggerInvocationRequest: return "DebuggerInvocationRequest"; + } + } }; class ScriptEngineSpy : public QScriptEngineAgent, public QList<ScriptEngineEvent> |