Changeset 56689 in webkit for trunk/JavaScriptCore/qt/tests
- Timestamp:
- Mar 28, 2010, 3:43:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
r56686 r56689 39 39 void evaluate(); 40 40 void collectGarbage(); 41 void reportAdditionalMemoryCost(); 41 42 void nullValue(); 42 43 void undefinedValue(); … … 73 74 engine.collectGarbage(); 74 75 QCOMPARE(foo.call().toString(), QString::fromAscii("pong")); 76 } 77 78 void tst_QScriptEngine::reportAdditionalMemoryCost() 79 { 80 // There isn't any easy way to test the responsiveness of the GC; 81 // just try to call the function a few times with various sizes. 82 QScriptEngine eng; 83 for (int i = 0; i < 100; ++i) { 84 eng.reportAdditionalMemoryCost(0); 85 eng.reportAdditionalMemoryCost(10); 86 eng.reportAdditionalMemoryCost(1000); 87 eng.reportAdditionalMemoryCost(10000); 88 eng.reportAdditionalMemoryCost(100000); 89 eng.reportAdditionalMemoryCost(1000000); 90 eng.reportAdditionalMemoryCost(10000000); 91 eng.reportAdditionalMemoryCost(-1); 92 eng.reportAdditionalMemoryCost(-1000); 93 QScriptValue obj = eng.evaluate("new Object"); 94 eng.collectGarbage(); 95 } 75 96 } 76 97
Note:
See TracChangeset
for help on using the changeset viewer.