aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine/tst_qjsengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qjsengine/tst_qjsengine.cpp')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 0491ccd473..0b1f1e0bca 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -236,6 +236,7 @@ private slots:
void importExportErrors();
void equality();
+ void aggressiveGc();
public:
Q_INVOKABLE QJSValue throwingCppMethod1();
@@ -4632,6 +4633,18 @@ void tst_QJSEngine::equality()
QCOMPARE(ok.toString(), QString("ok"));
}
+void tst_QJSEngine::aggressiveGc()
+{
+ const QByteArray origAggressiveGc = qgetenv("QV4_MM_AGGRESSIVE_GC");
+ qputenv("QV4_MM_AGGRESSIVE_GC", "true");
+ {
+ QJSEngine engine; // ctor crashes if core allocation methods don't properly scope things.
+ QJSValue obj = engine.newObject();
+ QVERIFY(obj.isObject());
+ }
+ qputenv("QV4_MM_AGGRESSIVE_GC", origAggressiveGc);
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"