| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlscriptstring.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | const QQmlScriptStringPrivate* QQmlScriptStringPrivate::get(const QQmlScriptString &script) | - | ||||||||||||
| 4 | { | - | ||||||||||||
| 5 | return never executed: script.d.constData();return script.d.constData();never executed: return script.d.constData(); | 0 | ||||||||||||
| 6 | } | - | ||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | - | |||||||||||||
| 11 | QQmlScriptString::QQmlScriptString() | - | ||||||||||||
| 12 | : d(new QQmlScriptStringPrivate) | - | ||||||||||||
| 13 | { | - | ||||||||||||
| 14 | } executed 9218 times by 14 tests: end of blockExecuted by:
| 9218 | ||||||||||||
| 15 | - | |||||||||||||
| 16 | - | |||||||||||||
| 17 | - | |||||||||||||
| 18 | - | |||||||||||||
| 19 | QQmlScriptString::QQmlScriptString(const QString &script, QQmlContext *context, QObject *scope) | - | ||||||||||||
| 20 | : d(new QQmlScriptStringPrivate) | - | ||||||||||||
| 21 | { | - | ||||||||||||
| 22 | d->script = script; | - | ||||||||||||
| 23 | d->context = context; | - | ||||||||||||
| 24 | d->scope = scope; | - | ||||||||||||
| 25 | } executed 4340 times by 13 tests: end of blockExecuted by:
| 4340 | ||||||||||||
| 26 | - | |||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | - | |||||||||||||
| 30 | QQmlScriptString::QQmlScriptString(const QQmlScriptString &other) | - | ||||||||||||
| 31 | : d(other.d) | - | ||||||||||||
| 32 | { | - | ||||||||||||
| 33 | } executed 18266 times by 11 tests: end of blockExecuted by:
| 18266 | ||||||||||||
| 34 | - | |||||||||||||
| 35 | - | |||||||||||||
| 36 | - | |||||||||||||
| 37 | - | |||||||||||||
| 38 | QQmlScriptString::~QQmlScriptString() | - | ||||||||||||
| 39 | { | - | ||||||||||||
| 40 | } | - | ||||||||||||
| 41 | - | |||||||||||||
| 42 | - | |||||||||||||
| 43 | - | |||||||||||||
| 44 | - | |||||||||||||
| 45 | QQmlScriptString &QQmlScriptString::operator=(const QQmlScriptString &other) | - | ||||||||||||
| 46 | { | - | ||||||||||||
| 47 | d = other.d; | - | ||||||||||||
| 48 | return executed 4340 times by 13 tests: *this;return *this;Executed by:
executed 4340 times by 13 tests: return *this;Executed by:
| 4340 | ||||||||||||
| 49 | } | - | ||||||||||||
| 50 | - | |||||||||||||
| 51 | - | |||||||||||||
| 52 | - | |||||||||||||
| 53 | - | |||||||||||||
| 54 | - | |||||||||||||
| 55 | - | |||||||||||||
| 56 | bool QQmlScriptString::operator==(const QQmlScriptString &other) const | - | ||||||||||||
| 57 | { | - | ||||||||||||
| 58 | if (d == other.d
| 0-8 | ||||||||||||
| 59 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 60 | - | |||||||||||||
| 61 | if (d->isNumberLiteral
| 0-8 | ||||||||||||
| 62 | return never executed: d->isNumberLiteral && other.d->isNumberLiteral && d->numberValue == other.d->numberValue;return d->isNumberLiteral && other.d->isNumberLiteral && d->numberValue == other.d->numberValue;never executed: return d->isNumberLiteral && other.d->isNumberLiteral && d->numberValue == other.d->numberValue; | 0 | ||||||||||||
| 63 | - | |||||||||||||
| 64 | if (d->isStringLiteral
| 0-8 | ||||||||||||
| 65 | return never executed: d->isStringLiteral && other.d->isStringLiteral && d->script == other.d->script;return d->isStringLiteral && other.d->isStringLiteral && d->script == other.d->script;never executed: return d->isStringLiteral && other.d->isStringLiteral && d->script == other.d->script; | 0 | ||||||||||||
| 66 | - | |||||||||||||
| 67 | if (d->script == QLatin1String("true")
| 0-8 | ||||||||||||
| 68 | d->script == QLatin1String("false")
| 0-8 | ||||||||||||
| 69 | d->script == QLatin1String("undefined")
| 0-8 | ||||||||||||
| 70 | d->script == QLatin1String("null")
| 0-8 | ||||||||||||
| 71 | return never executed: d->script == other.d->script;return d->script == other.d->script;never executed: return d->script == other.d->script; | 0 | ||||||||||||
| 72 | - | |||||||||||||
| 73 | return executed 8 times by 2 tests: d->context == other.d->context &&return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;Executed by:
executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;Executed by:
| 8 | ||||||||||||
| 74 | d->scope == other.d->scope && executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;Executed by:
| 8 | ||||||||||||
| 75 | d->script == other.d->script && executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;Executed by:
| 8 | ||||||||||||
| 76 | d->bindingId == other.d->bindingId; executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;Executed by:
| 8 | ||||||||||||
| 77 | } | - | ||||||||||||
| 78 | - | |||||||||||||
| 79 | - | |||||||||||||
| 80 | - | |||||||||||||
| 81 | - | |||||||||||||
| 82 | - | |||||||||||||
| 83 | - | |||||||||||||
| 84 | bool QQmlScriptString::operator!=(const QQmlScriptString &other) const | - | ||||||||||||
| 85 | { | - | ||||||||||||
| 86 | return never executed: !operator==(other);return !operator==(other);never executed: return !operator==(other); | 0 | ||||||||||||
| 87 | } | - | ||||||||||||
| 88 | - | |||||||||||||
| 89 | - | |||||||||||||
| 90 | - | |||||||||||||
| 91 | - | |||||||||||||
| 92 | bool QQmlScriptString::isEmpty() const | - | ||||||||||||
| 93 | { | - | ||||||||||||
| 94 | if (!d->script.isEmpty()
| 0-18086 | ||||||||||||
| 95 | return executed 18086 times by 11 tests: false;return false;Executed by:
executed 18086 times by 11 tests: return false;Executed by:
| 18086 | ||||||||||||
| 96 | return never executed: d->bindingId == -1;return d->bindingId == -1;never executed: return d->bindingId == -1; | 0 | ||||||||||||
| 97 | } | - | ||||||||||||
| 98 | - | |||||||||||||
| 99 | - | |||||||||||||
| 100 | - | |||||||||||||
| 101 | - | |||||||||||||
| 102 | bool QQmlScriptString::isUndefinedLiteral() const | - | ||||||||||||
| 103 | { | - | ||||||||||||
| 104 | return executed 96 times by 5 tests: d->script == QLatin1String("undefined");return d->script == QLatin1String("undefined");Executed by:
executed 96 times by 5 tests: return d->script == QLatin1String("undefined");Executed by:
| 96 | ||||||||||||
| 105 | } | - | ||||||||||||
| 106 | - | |||||||||||||
| 107 | - | |||||||||||||
| 108 | - | |||||||||||||
| 109 | - | |||||||||||||
| 110 | bool QQmlScriptString::isNullLiteral() const | - | ||||||||||||
| 111 | { | - | ||||||||||||
| 112 | return never executed: d->script == QLatin1String("null");return d->script == QLatin1String("null");never executed: return d->script == QLatin1String("null"); | 0 | ||||||||||||
| 113 | } | - | ||||||||||||
| 114 | - | |||||||||||||
| 115 | - | |||||||||||||
| 116 | - | |||||||||||||
| 117 | - | |||||||||||||
| 118 | - | |||||||||||||
| 119 | QString QQmlScriptString::stringLiteral() const | - | ||||||||||||
| 120 | { | - | ||||||||||||
| 121 | if (d->isStringLiteral
| 0 | ||||||||||||
| 122 | return never executed: d->script.mid(1, d->script.length()-2);return d->script.mid(1, d->script.length()-2);never executed: return d->script.mid(1, d->script.length()-2); | 0 | ||||||||||||
| 123 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||
| 124 | } | - | ||||||||||||
| 125 | - | |||||||||||||
| 126 | - | |||||||||||||
| 127 | - | |||||||||||||
| 128 | - | |||||||||||||
| 129 | - | |||||||||||||
| 130 | qreal QQmlScriptString::numberLiteral(bool *ok) const | - | ||||||||||||
| 131 | { | - | ||||||||||||
| 132 | if (ok
| 0-186 | ||||||||||||
| 133 | * executed 186 times by 4 tests: ok = d->isNumberLiteral;*ok = d->isNumberLiteral;Executed by:
executed 186 times by 4 tests: *ok = d->isNumberLiteral;Executed by:
| 186 | ||||||||||||
| 134 | return executed 186 times by 4 tests: d->isNumberLiteral ? d->numberValue : 0.;return d->isNumberLiteral ? d->numberValue : 0.;Executed by:
executed 186 times by 4 tests: return d->isNumberLiteral ? d->numberValue : 0.;Executed by:
| 186 | ||||||||||||
| 135 | } | - | ||||||||||||
| 136 | - | |||||||||||||
| 137 | - | |||||||||||||
| 138 | - | |||||||||||||
| 139 | - | |||||||||||||
| 140 | - | |||||||||||||
| 141 | bool QQmlScriptString::booleanLiteral(bool *ok) const | - | ||||||||||||
| 142 | { | - | ||||||||||||
| 143 | bool isTrue = d->script == QLatin1String("true"); | - | ||||||||||||
| 144 | bool isFalse = !isTrue
| 0 | ||||||||||||
| 145 | if (ok
| 0 | ||||||||||||
| 146 | * never executed: ok = isTrue*ok = isTrue || isFalse;
never executed: *ok = isTrue || isFalse; | 0 | ||||||||||||
| 147 | return never executed: isTrue ? true : false;return isTrue ? true : false;never executed: return isTrue ? true : false; | 0 | ||||||||||||
| 148 | } | - | ||||||||||||
| 149 | - | |||||||||||||
| 150 | - | |||||||||||||
| Switch to Source code | Preprocessed file |