diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-08-08 10:24:25 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-09 15:07:40 +0200 |
commit | c07a9fe847f536d1090c6876ed516baa8607b786 (patch) | |
tree | b93b26269148f97493edfda466751e260924435d /tests/auto/qscriptengine | |
parent | 973f54fc75e8dd3ddc132942be55f9d5fabde19c (diff) | |
download | qtscript-c07a9fe847f536d1090c6876ed516baa8607b786.tar.gz |
Move test helper function to separate header file
Makes it possible to use the collectGarbage_helper function in other
autotests too (e.g., tst_qscriptextqobject).
Change-Id: I4fefa36aba13ebf9f931f0e2b90d7ddbc0036a6c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/qscriptengine')
-rw-r--r-- | tests/auto/qscriptengine/qscriptengine.pro | 1 | ||||
-rw-r--r-- | tests/auto/qscriptengine/tst_qscriptengine.cpp | 17 |
2 files changed, 3 insertions, 15 deletions
diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro index 71e04ab..adc1a46 100644 --- a/tests/auto/qscriptengine/qscriptengine.pro +++ b/tests/auto/qscriptengine/qscriptengine.pro @@ -3,6 +3,7 @@ CONFIG += testcase QT = core gui widgets script script-private testlib SOURCES += tst_qscriptengine.cpp RESOURCES += qscriptengine.qrc +include(../shared/util.pri) wince* { DEFINES += SRCDIR=\\\"./\\\" diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 514d29a..3be9d62 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -53,6 +53,8 @@ #include <QtScript/private/qscriptdeclarativeclass_p.h> +#include "../shared/util.h" + Q_DECLARE_METATYPE(QList<int>) Q_DECLARE_METATYPE(QObjectList) Q_DECLARE_METATYPE(QScriptProgram) @@ -63,21 +65,6 @@ Q_DECLARE_METATYPE(QScriptProgram) # define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) #endif -// The JavaScriptCore GC marks the C stack. To try to ensure that there is -// no JSObject* left in stack memory by the compiler, we call this function -// to zap some bytes of memory before calling collectGarbage(). -static void zapSomeStack() -{ - char buf[4096]; - memset(buf, 0, sizeof(buf)); -} - -static void collectGarbage_helper(QScriptEngine &eng) -{ - zapSomeStack(); - eng.collectGarbage(); -} - class tst_QScriptEngine : public QObject { Q_OBJECT |