| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlvme.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | using namespace QQmlVMETypes; | - | ||||||||||||
| 10 | - | |||||||||||||
| 11 | bool QQmlVME::s_enableComponentComplete = true; | - | ||||||||||||
| 12 | - | |||||||||||||
| 13 | void QQmlVME::enableComponentComplete() | - | ||||||||||||
| 14 | { | - | ||||||||||||
| 15 | s_enableComponentComplete = true; | - | ||||||||||||
| 16 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||
| 17 | - | |||||||||||||
| 18 | void QQmlVME::disableComponentComplete() | - | ||||||||||||
| 19 | { | - | ||||||||||||
| 20 | s_enableComponentComplete = false; | - | ||||||||||||
| 21 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||
| 22 | - | |||||||||||||
| 23 | bool QQmlVME::componentCompleteEnabled() | - | ||||||||||||
| 24 | { | - | ||||||||||||
| 25 | return executed 157780 times by 139 tests: s_enableComponentComplete;return s_enableComponentComplete;Executed by:
executed 157780 times by 139 tests: return s_enableComponentComplete;Executed by:
| 157780 | ||||||||||||
| 26 | } | - | ||||||||||||
| 27 | - | |||||||||||||
| 28 | QQmlVMEGuard::QQmlVMEGuard() | - | ||||||||||||
| 29 | : m_objectCount(0), m_objects(nullptr), m_contextCount(0), m_contexts(nullptr) | - | ||||||||||||
| 30 | { | - | ||||||||||||
| 31 | } executed 88821 times by 32 tests: end of blockExecuted by:
| 88821 | ||||||||||||
| 32 | - | |||||||||||||
| 33 | QQmlVMEGuard::~QQmlVMEGuard() | - | ||||||||||||
| 34 | { | - | ||||||||||||
| 35 | clear(); | - | ||||||||||||
| 36 | } executed 88672 times by 32 tests: end of blockExecuted by:
| 88672 | ||||||||||||
| 37 | - | |||||||||||||
| 38 | void QQmlVMEGuard::guard(QQmlObjectCreator *creator) | - | ||||||||||||
| 39 | { | - | ||||||||||||
| 40 | clear(); | - | ||||||||||||
| 41 | - | |||||||||||||
| 42 | QFiniteStack<QPointer<QObject> > &objects = creator->allCreatedObjects(); | - | ||||||||||||
| 43 | m_objectCount = objects.count(); | - | ||||||||||||
| 44 | m_objects = new QPointer<QObject>[m_objectCount]; | - | ||||||||||||
| 45 | for (int ii = 0; ii < m_objectCount
| 4577-5709 | ||||||||||||
| 46 | m_objects[ii] = objects[ii]; executed 5709 times by 8 tests: m_objects[ii] = objects[ii];Executed by:
| 5709 | ||||||||||||
| 47 | - | |||||||||||||
| 48 | m_contextCount = 1; | - | ||||||||||||
| 49 | m_contexts = new QQmlGuardedContextData[m_contextCount]; | - | ||||||||||||
| 50 | m_contexts[0] = creator->parentContextData(); | - | ||||||||||||
| 51 | } executed 4577 times by 11 tests: end of blockExecuted by:
| 4577 | ||||||||||||
| 52 | - | |||||||||||||
| 53 | void QQmlVMEGuard::clear() | - | ||||||||||||
| 54 | { | - | ||||||||||||
| 55 | delete [] m_objects; | - | ||||||||||||
| 56 | delete [] m_contexts; | - | ||||||||||||
| 57 | - | |||||||||||||
| 58 | m_objectCount = 0; | - | ||||||||||||
| 59 | m_objects = nullptr; | - | ||||||||||||
| 60 | m_contextCount = 0; | - | ||||||||||||
| 61 | m_contexts = nullptr; | - | ||||||||||||
| 62 | } executed 449624 times by 32 tests: end of blockExecuted by:
| 449624 | ||||||||||||
| 63 | - | |||||||||||||
| 64 | bool QQmlVMEGuard::isOK() const | - | ||||||||||||
| 65 | { | - | ||||||||||||
| 66 | for (int ii = 0; ii < m_objectCount
| 5719-356400 | ||||||||||||
| 67 | if (m_objects[ii].isNull()
| 10-5709 | ||||||||||||
| 68 | return executed 10 times by 1 test: false;return false;Executed by:
executed 10 times by 1 test: return false;Executed by:
| 10 | ||||||||||||
| 69 | - | |||||||||||||
| 70 | for (int ii = 0; ii < m_contextCount
| 4595-356326 | ||||||||||||
| 71 | if (m_contexts[ii].isNull()
| 4-4591 | ||||||||||||
| 72 | return executed 74 times by 3 tests: false;return false;Executed by:
executed 74 times by 3 tests: return false;Executed by:
| 74 | ||||||||||||
| 73 | - | |||||||||||||
| 74 | return executed 356326 times by 32 tests: true;return true;Executed by:
executed 356326 times by 32 tests: return true;Executed by:
| 356326 | ||||||||||||
| 75 | } | - | ||||||||||||
| 76 | - | |||||||||||||
| 77 | - | |||||||||||||
| Switch to Source code | Preprocessed file |