diff options
Diffstat (limited to 'tests/auto/qscriptengine/tst_qscriptengine.cpp')
-rw-r--r-- | tests/auto/qscriptengine/tst_qscriptengine.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index e71d7c3..0615b63 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -121,6 +121,7 @@ private slots: void castWithPrototypeChain(); void castWithMultipleInheritance(); void collectGarbage(); + void reportAdditionalMemoryCost(); void gcWithNestedDataStructure(); void processEventsWhileRunning(); void throwErrorFromProcessEvents(); @@ -2369,6 +2370,24 @@ void tst_QScriptEngine::collectGarbage() QVERIFY(ptr == 0); } +void tst_QScriptEngine::reportAdditionalMemoryCost() +{ + QScriptEngine eng; + for (int x = 0; x < 1000; ++x) { + eng.reportAdditionalMemoryCost(0); + eng.reportAdditionalMemoryCost(10); + eng.reportAdditionalMemoryCost(1000); + eng.reportAdditionalMemoryCost(10000); + eng.reportAdditionalMemoryCost(100000); + eng.reportAdditionalMemoryCost(1000000); + eng.reportAdditionalMemoryCost(10000000); + eng.reportAdditionalMemoryCost(-1); + eng.reportAdditionalMemoryCost(-1000); + QScriptValue obj = eng.newObject(); + eng.collectGarbage(); + } +} + void tst_QScriptEngine::gcWithNestedDataStructure() { QScriptEngine eng; |