| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/global/qglobal.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | - | |||||||||||||||||||
| 9 | - | |||||||||||||||||||
| 10 | - | |||||||||||||||||||
| 11 | - | |||||||||||||||||||
| 12 | - | |||||||||||||||||||
| 13 | - | |||||||||||||||||||
| 14 | - | |||||||||||||||||||
| 15 | - | |||||||||||||||||||
| 16 | - | |||||||||||||||||||
| 17 | - | |||||||||||||||||||
| 18 | __attribute__((visibility("default"))) void *qMemCopy(void *dest, const void *src, size_t n); | - | ||||||||||||||||||
| 19 | __attribute__((visibility("default"))) void *qMemSet(void *dest, int c, size_t n); | - | ||||||||||||||||||
| 20 | - | |||||||||||||||||||
| 21 | - | |||||||||||||||||||
| 22 | - | |||||||||||||||||||
| 23 | - | |||||||||||||||||||
| 24 | - | |||||||||||||||||||
| 25 | - | |||||||||||||||||||
| 26 | static_assert(bool(sizeof(int) == 4), "Qt assumes that int is 32 bits"); | - | ||||||||||||||||||
| 27 | static_assert(bool((127 * 2 + 1) == 255), "Qt assumes that char is 8 bits"); | - | ||||||||||||||||||
| 28 | static_assert(bool(8 == sizeof(void *)), "QT_POINTER_SIZE defined incorrectly"); | - | ||||||||||||||||||
| 29 | const char *qVersion() noexcept | - | ||||||||||||||||||
| 30 | { | - | ||||||||||||||||||
| 31 | return executed 585 times by 2 tests: "5.7.1";return "5.7.1";Executed by:
executed 585 times by 2 tests: return "5.7.1";Executed by:
| 585 | ||||||||||||||||||
| 32 | } | - | ||||||||||||||||||
| 33 | - | |||||||||||||||||||
| 34 | bool qSharedBuild() noexcept | - | ||||||||||||||||||
| 35 | { | - | ||||||||||||||||||
| 36 | - | |||||||||||||||||||
| 37 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 38 | - | |||||||||||||||||||
| 39 | - | |||||||||||||||||||
| 40 | - | |||||||||||||||||||
| 41 | } | - | ||||||||||||||||||
| 42 | struct QUnixOSVersion | - | ||||||||||||||||||
| 43 | { | - | ||||||||||||||||||
| 44 | - | |||||||||||||||||||
| 45 | QString productType; | - | ||||||||||||||||||
| 46 | QString productVersion; | - | ||||||||||||||||||
| 47 | QString prettyName; | - | ||||||||||||||||||
| 48 | }; | - | ||||||||||||||||||
| 49 | - | |||||||||||||||||||
| 50 | static QString unquote(const char *begin, const char *end) | - | ||||||||||||||||||
| 51 | { | - | ||||||||||||||||||
| 52 | if (*
| 9-18 | ||||||||||||||||||
| 53 | ((!(end[-1] == '"')) ? qt_assert("end[-1] == '\"'",__FILE__,2217) : qt_noop()); | - | ||||||||||||||||||
| 54 | return executed 18 times by 3 tests: QString::fromLatin1(begin + 1, end - begin - 2);return QString::fromLatin1(begin + 1, end - begin - 2);Executed by:
executed 18 times by 3 tests: return QString::fromLatin1(begin + 1, end - begin - 2);Executed by:
| 18 | ||||||||||||||||||
| 55 | } | - | ||||||||||||||||||
| 56 | return executed 9 times by 3 tests: QString::fromLatin1(begin, end - begin);return QString::fromLatin1(begin, end - begin);Executed by:
executed 9 times by 3 tests: return QString::fromLatin1(begin, end - begin);Executed by:
| 9 | ||||||||||||||||||
| 57 | } | - | ||||||||||||||||||
| 58 | static QByteArray getEtcFileContent(const char *filename) | - | ||||||||||||||||||
| 59 | { | - | ||||||||||||||||||
| 60 | - | |||||||||||||||||||
| 61 | int fd = qt_safe_open(filename, 00); | - | ||||||||||||||||||
| 62 | if (fd == -1
| 0-9 | ||||||||||||||||||
| 63 | return never executed: QByteArray();return QByteArray();never executed: return QByteArray(); | 0 | ||||||||||||||||||
| 64 | - | |||||||||||||||||||
| 65 | struct stat64 sbuf; | - | ||||||||||||||||||
| 66 | if (::
| 0-9 | ||||||||||||||||||
| 67 | qt_safe_close(fd); | - | ||||||||||||||||||
| 68 | return never executed: QByteArray();return QByteArray();never executed: return QByteArray(); | 0 | ||||||||||||||||||
| 69 | } | - | ||||||||||||||||||
| 70 | - | |||||||||||||||||||
| 71 | QByteArray buffer(sbuf.st_size, Qt::Uninitialized); | - | ||||||||||||||||||
| 72 | buffer.resize(qt_safe_read(fd, buffer.data(), sbuf.st_size)); | - | ||||||||||||||||||
| 73 | qt_safe_close(fd); | - | ||||||||||||||||||
| 74 | return executed 9 times by 3 tests: buffer;return buffer;Executed by:
executed 9 times by 3 tests: return buffer;Executed by:
| 9 | ||||||||||||||||||
| 75 | } | - | ||||||||||||||||||
| 76 | - | |||||||||||||||||||
| 77 | static bool readEtcFile(QUnixOSVersion &v, const char *filename, | - | ||||||||||||||||||
| 78 | const QByteArray &idKey, const QByteArray &versionKey, const QByteArray &prettyNameKey) | - | ||||||||||||||||||
| 79 | { | - | ||||||||||||||||||
| 80 | - | |||||||||||||||||||
| 81 | QByteArray buffer = getEtcFileContent(filename); | - | ||||||||||||||||||
| 82 | if (buffer.isEmpty()
| 0-9 | ||||||||||||||||||
| 83 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 84 | - | |||||||||||||||||||
| 85 | const char *ptr = buffer.constData(); | - | ||||||||||||||||||
| 86 | const char *end = buffer.constEnd(); | - | ||||||||||||||||||
| 87 | const char *eol; | - | ||||||||||||||||||
| 88 | QByteArray line; | - | ||||||||||||||||||
| 89 | for ( ; ptr != end
| 9-72 | ||||||||||||||||||
| 90 | - | |||||||||||||||||||
| 91 | eol = static_cast<const char *>(memchr(ptr, '\n', end - ptr)); | - | ||||||||||||||||||
| 92 | if (!eol
| 0-72 | ||||||||||||||||||
| 93 | eol = end - 1; never executed: eol = end - 1; | 0 | ||||||||||||||||||
| 94 | line.setRawData(ptr, eol - ptr); | - | ||||||||||||||||||
| 95 | - | |||||||||||||||||||
| 96 | if (line.startsWith(idKey)
| 9-63 | ||||||||||||||||||
| 97 | ptr += idKey.length(); | - | ||||||||||||||||||
| 98 | v.productType = unquote(ptr, eol); | - | ||||||||||||||||||
| 99 | continue; executed 9 times by 3 tests: continue;Executed by:
| 9 | ||||||||||||||||||
| 100 | } | - | ||||||||||||||||||
| 101 | - | |||||||||||||||||||
| 102 | if (line.startsWith(prettyNameKey)
| 9-54 | ||||||||||||||||||
| 103 | ptr += prettyNameKey.length(); | - | ||||||||||||||||||
| 104 | v.prettyName = unquote(ptr, eol); | - | ||||||||||||||||||
| 105 | continue; executed 9 times by 3 tests: continue;Executed by:
| 9 | ||||||||||||||||||
| 106 | } | - | ||||||||||||||||||
| 107 | - | |||||||||||||||||||
| 108 | if (line.startsWith(versionKey)
| 9-45 | ||||||||||||||||||
| 109 | ptr += versionKey.length(); | - | ||||||||||||||||||
| 110 | v.productVersion = unquote(ptr, eol); | - | ||||||||||||||||||
| 111 | continue; executed 9 times by 3 tests: continue;Executed by:
| 9 | ||||||||||||||||||
| 112 | } | - | ||||||||||||||||||
| 113 | } executed 45 times by 3 tests: end of blockExecuted by:
| 45 | ||||||||||||||||||
| 114 | - | |||||||||||||||||||
| 115 | return executed 9 times by 3 tests: true;return true;Executed by:
executed 9 times by 3 tests: return true;Executed by:
| 9 | ||||||||||||||||||
| 116 | } | - | ||||||||||||||||||
| 117 | - | |||||||||||||||||||
| 118 | static bool readEtcOsRelease(QUnixOSVersion &v) | - | ||||||||||||||||||
| 119 | { | - | ||||||||||||||||||
| 120 | return executed 9 times by 3 tests: readEtcFile(v, "/etc/os-release", ([]() -> QByteArray { enum { Size = sizeof("ID=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "ID=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); returnreturn readEtcFile(v, "/etc/os-release", ([]() -> QByteArray { enum { Size = sizeof("ID=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "ID=" }; QByteArrayDataPtr holder = { qbyt...AME=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "PRETTY_NAME=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()));Executed by:
executed 9 times by 3 tests: ba;return ba;Executed by:
executed 9 times by 3 tests: }()),return ba;Executed by:
executed 9 times by 3 tests: return readEtcFile(v, "/etc/os-release", ([]() -> QByteArray { enum { Size = sizeof("ID=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "ID=" }; QByteArrayDataPtr holder = { qbyt...AME=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "PRETTY_NAME=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()));Executed by:
| 9 | ||||||||||||||||||
| 121 | ([]() -> QByteArray { enum { Size = sizeof("VERSION_ID=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "VERSION_ID=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return executed 9 times by 3 tests: ba;return ba;Executed by:
executed 9 times by 3 tests: }()), ([]() -> QByteArray { enum { Size = sizeof("PRETTY_NAME=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "PRETTY_NAME=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); returnreturn ba;Executed by:
executed 9 times by 3 tests: ba;return ba;Executed by:
executed 9 times by 3 tests: }()));return ba;Executed by:
executed 9 times by 3 tests: return readEtcFile(v, "/etc/os-release", ([]() -> QByteArray { enum { Size = sizeof("ID=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "ID=" }; QByteArrayDataPtr holder = { qbyt...AME=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "PRETTY_NAME=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()));Executed by:
| 9 | ||||||||||||||||||
| 122 | } | - | ||||||||||||||||||
| 123 | - | |||||||||||||||||||
| 124 | static bool readEtcLsbRelease(QUnixOSVersion &v) | - | ||||||||||||||||||
| 125 | { | - | ||||||||||||||||||
| 126 | bool ok = readEtcFile(v, "/etc/lsb-release", ([]() -> QByteArray { enum { Size = sizeof("DISTRIB_ID=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "DISTRIB_ID=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()),return ba; | 0 | ||||||||||||||||||
| 127 | ([]() -> QByteArray { enum { Size = sizeof("DISTRIB_RELEASE=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "DISTRIB_RELEASE=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), ([]() -> QByteArray { enum { Size = sizeof("DISTRIB_DESCRIPTION=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "DISTRIB_DESCRIPTION=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); returnreturn ba;never executed: ba;return ba;never executed: }()));return ba; | 0 | ||||||||||||||||||
| 128 | if (ok
| 0 | ||||||||||||||||||
| 129 | - | |||||||||||||||||||
| 130 | - | |||||||||||||||||||
| 131 | - | |||||||||||||||||||
| 132 | - | |||||||||||||||||||
| 133 | QByteArray distrorelease = "/etc/" + v.productType.toLatin1().toLower() + "-release"; | - | ||||||||||||||||||
| 134 | int fd = qt_safe_open(distrorelease, 00); | - | ||||||||||||||||||
| 135 | if (fd != -1
| 0 | ||||||||||||||||||
| 136 | struct stat64 sbuf; | - | ||||||||||||||||||
| 137 | if (::
| 0 | ||||||||||||||||||
| 138 | - | |||||||||||||||||||
| 139 | QByteArray buffer(sbuf.st_size, Qt::Uninitialized); | - | ||||||||||||||||||
| 140 | buffer.resize(qt_safe_read(fd, buffer.data(), sbuf.st_size)); | - | ||||||||||||||||||
| 141 | v.prettyName = QString::fromLatin1(buffer.trimmed()); | - | ||||||||||||||||||
| 142 | } never executed: end of block | 0 | ||||||||||||||||||
| 143 | qt_safe_close(fd); | - | ||||||||||||||||||
| 144 | } never executed: end of block | 0 | ||||||||||||||||||
| 145 | } never executed: end of block | 0 | ||||||||||||||||||
| 146 | - | |||||||||||||||||||
| 147 | - | |||||||||||||||||||
| 148 | - | |||||||||||||||||||
| 149 | - | |||||||||||||||||||
| 150 | - | |||||||||||||||||||
| 151 | return never executed: ok && !(v.productType.isEmpty() && v.productVersion.isEmpty());return ok && !(v.productType.isEmpty() && v.productVersion.isEmpty());never executed: return ok && !(v.productType.isEmpty() && v.productVersion.isEmpty()); | 0 | ||||||||||||||||||
| 152 | } | - | ||||||||||||||||||
| 153 | - | |||||||||||||||||||
| 154 | - | |||||||||||||||||||
| 155 | static QByteArray getEtcFileFirstLine(const char *fileName) | - | ||||||||||||||||||
| 156 | { | - | ||||||||||||||||||
| 157 | QByteArray buffer = getEtcFileContent(fileName); | - | ||||||||||||||||||
| 158 | if (buffer.isEmpty()
| 0 | ||||||||||||||||||
| 159 | return never executed: QByteArray();return QByteArray();never executed: return QByteArray(); | 0 | ||||||||||||||||||
| 160 | - | |||||||||||||||||||
| 161 | const char *ptr = buffer.constData(); | - | ||||||||||||||||||
| 162 | int eol = buffer.indexOf("\n"); | - | ||||||||||||||||||
| 163 | return never executed: QByteArray(ptr, eol).trimmed();return QByteArray(ptr, eol).trimmed();never executed: return QByteArray(ptr, eol).trimmed(); | 0 | ||||||||||||||||||
| 164 | } | - | ||||||||||||||||||
| 165 | - | |||||||||||||||||||
| 166 | static bool readEtcRedHatRelease(QUnixOSVersion &v) | - | ||||||||||||||||||
| 167 | { | - | ||||||||||||||||||
| 168 | - | |||||||||||||||||||
| 169 | - | |||||||||||||||||||
| 170 | - | |||||||||||||||||||
| 171 | QByteArray line = getEtcFileFirstLine("/etc/redhat-release"); | - | ||||||||||||||||||
| 172 | if (line.isEmpty()
| 0 | ||||||||||||||||||
| 173 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 174 | - | |||||||||||||||||||
| 175 | v.prettyName = QString::fromLatin1(line); | - | ||||||||||||||||||
| 176 | - | |||||||||||||||||||
| 177 | const char keyword[] = "release "; | - | ||||||||||||||||||
| 178 | int releaseIndex = line.indexOf(keyword); | - | ||||||||||||||||||
| 179 | v.productType = QString::fromLatin1(line.mid(0, releaseIndex)).remove(QLatin1Char(' ')); | - | ||||||||||||||||||
| 180 | int spaceIndex = line.indexOf(' ', releaseIndex + strlen(keyword)); | - | ||||||||||||||||||
| 181 | v.productVersion = QString::fromLatin1(line.mid(releaseIndex + strlen(keyword), | - | ||||||||||||||||||
| 182 | spaceIndex > -1 ? spaceIndex - releaseIndex - int(strlen(keyword)) : -1)); | - | ||||||||||||||||||
| 183 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 184 | } | - | ||||||||||||||||||
| 185 | - | |||||||||||||||||||
| 186 | static bool readEtcDebianVersion(QUnixOSVersion &v) | - | ||||||||||||||||||
| 187 | { | - | ||||||||||||||||||
| 188 | - | |||||||||||||||||||
| 189 | - | |||||||||||||||||||
| 190 | - | |||||||||||||||||||
| 191 | QByteArray line = getEtcFileFirstLine("/etc/debian_version"); | - | ||||||||||||||||||
| 192 | if (line.isEmpty()
| 0 | ||||||||||||||||||
| 193 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 194 | - | |||||||||||||||||||
| 195 | v.productType = ([]() -> QString { enum { Size = sizeof(u"" "Debian")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Debian" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||
| 196 | v.productVersion = QString::fromLatin1(line); | - | ||||||||||||||||||
| 197 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 198 | } | - | ||||||||||||||||||
| 199 | - | |||||||||||||||||||
| 200 | - | |||||||||||||||||||
| 201 | static bool findUnixOsVersion(QUnixOSVersion &v) | - | ||||||||||||||||||
| 202 | { | - | ||||||||||||||||||
| 203 | if (readEtcOsRelease(v)
| 0-9 | ||||||||||||||||||
| 204 | return executed 9 times by 3 tests: true;return true;Executed by:
executed 9 times by 3 tests: return true;Executed by:
| 9 | ||||||||||||||||||
| 205 | if (readEtcLsbRelease(v)
| 0 | ||||||||||||||||||
| 206 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 207 | - | |||||||||||||||||||
| 208 | if (readEtcRedHatRelease(v)
| 0 | ||||||||||||||||||
| 209 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 210 | if (readEtcDebianVersion(v)
| 0 | ||||||||||||||||||
| 211 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 212 | - | |||||||||||||||||||
| 213 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 214 | } | - | ||||||||||||||||||
| 215 | QString QSysInfo::buildCpuArchitecture() | - | ||||||||||||||||||
| 216 | { | - | ||||||||||||||||||
| 217 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "x86_64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "x86_64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return ([]() -> QString { enum { Size = sizeof(u"" "x86_64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||
| 218 | } | - | ||||||||||||||||||
| 219 | QString QSysInfo::currentCpuArchitecture() | - | ||||||||||||||||||
| 220 | { | - | ||||||||||||||||||
| 221 | long ret = -1; | - | ||||||||||||||||||
| 222 | struct utsname u; | - | ||||||||||||||||||
| 223 | if (ret == -1
| 0-1 | ||||||||||||||||||
| 224 | ret = uname(&u); executed 1 time by 1 test: ret = uname(&u);Executed by:
| 1 | ||||||||||||||||||
| 225 | - | |||||||||||||||||||
| 226 | - | |||||||||||||||||||
| 227 | if (ret != -1
| 0-1 | ||||||||||||||||||
| 228 | - | |||||||||||||||||||
| 229 | - | |||||||||||||||||||
| 230 | - | |||||||||||||||||||
| 231 | if (strcmp(u.machine, "aarch64") == 0
| 0-1 | ||||||||||||||||||
| 232 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "arm64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "arm64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "arm64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "arm64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return ([]() -> QString { enum { Size = sizeof(u"" "arm64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "arm64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||
| 233 | if (strncmp(u.machine, "armv", 4) == 0
| 0-1 | ||||||||||||||||||
| 234 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "arm")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "arm" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "arm")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "arm" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return ([]() -> QString { enum { Size = sizeof(u"" "arm")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "arm" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||
| 235 | - | |||||||||||||||||||
| 236 | - | |||||||||||||||||||
| 237 | - | |||||||||||||||||||
| 238 | if (strncmp(u.machine, "ppc", 3) == 0
| 0-1 | ||||||||||||||||||
| 239 | return never executed: QLatin1String("power") + QLatin1String(u.machine + 3);return QLatin1String("power") + QLatin1String(u.machine + 3);never executed: return QLatin1String("power") + QLatin1String(u.machine + 3); | 0 | ||||||||||||||||||
| 240 | if (strncmp(u.machine, "powerpc", 7) == 0
| 0-1 | ||||||||||||||||||
| 241 | return never executed: QLatin1String("power") + QLatin1String(u.machine + 7);return QLatin1String("power") + QLatin1String(u.machine + 7);never executed: return QLatin1String("power") + QLatin1String(u.machine + 7); | 0 | ||||||||||||||||||
| 242 | if (strcmp(u.machine, "Power Macintosh") == 0
| 0-1 | ||||||||||||||||||
| 243 | return never executed: QLatin1String("power");return QLatin1String("power");never executed: return QLatin1String("power"); | 0 | ||||||||||||||||||
| 244 | - | |||||||||||||||||||
| 245 | - | |||||||||||||||||||
| 246 | - | |||||||||||||||||||
| 247 | - | |||||||||||||||||||
| 248 | if (strcmp(u.machine, "sun4u") == 0
| 0-1 | ||||||||||||||||||
| 249 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "sparcv9")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "sparcv9" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "sparcv9")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "sparcv9" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return ([]() -> QString { enum { Size = sizeof(u"" "sparcv9")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "sparcv9" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||
| 250 | if (strcmp(u.machine, "sparc32") == 0
| 0-1 | ||||||||||||||||||
| 251 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "sparc")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "sparc" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "sparc")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "sparc" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return ([]() -> QString { enum { Size = sizeof(u"" "sparc")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "sparc" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||
| 252 | - | |||||||||||||||||||
| 253 | - | |||||||||||||||||||
| 254 | - | |||||||||||||||||||
| 255 | if (strlen(u.machine) == 4
| 0-1 | ||||||||||||||||||
| 256 | && u.machine[2] == '8'
| 0 | ||||||||||||||||||
| 257 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "i386")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "i386" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "i386")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "i386" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return ([]() -> QString { enum { Size = sizeof(u"" "i386")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "i386" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||
| 258 | if (strcmp(u.machine, "amd64") == 0
| 0-1 | ||||||||||||||||||
| 259 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "x86_64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "x86_64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return ([]() -> QString { enum { Size = sizeof(u"" "x86_64")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||
| 260 | - | |||||||||||||||||||
| 261 | return executed 1 time by 1 test: QString::fromLatin1(u.machine);return QString::fromLatin1(u.machine);Executed by:
executed 1 time by 1 test: return QString::fromLatin1(u.machine);Executed by:
| 1 | ||||||||||||||||||
| 262 | } | - | ||||||||||||||||||
| 263 | - | |||||||||||||||||||
| 264 | return never executed: buildCpuArchitecture();return buildCpuArchitecture();never executed: return buildCpuArchitecture(); | 0 | ||||||||||||||||||
| 265 | } | - | ||||||||||||||||||
| 266 | QString QSysInfo::buildAbi() | - | ||||||||||||||||||
| 267 | { | - | ||||||||||||||||||
| 268 | - | |||||||||||||||||||
| 269 | - | |||||||||||||||||||
| 270 | - | |||||||||||||||||||
| 271 | - | |||||||||||||||||||
| 272 | - | |||||||||||||||||||
| 273 | return executed 1 time by 1 test: ([]() -> QString { enum { Size = sizeof(u"" "x86_64" "-" "little_endian" "-" "lp64" "" "" "")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" "-" "little_endian" "-" "lp64" "" "" "" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "x86_64" "-" "little_endian" "-" "lp64" "" "" "")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" "-" "little_endian" "-" "lp64" "" "" "" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());Executed by:
executed 1 time by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 1 time by 1 test: }());return qstring_literal_temp;Executed by:
executed 1 time by 1 test: return ([]() -> QString { enum { Size = sizeof(u"" "x86_64" "-" "little_endian" "-" "lp64" "" "" "")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "x86_64" "-" "little_endian" "-" "lp64" "" "" "" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());Executed by:
| 1 | ||||||||||||||||||
| 274 | - | |||||||||||||||||||
| 275 | - | |||||||||||||||||||
| 276 | - | |||||||||||||||||||
| 277 | } | - | ||||||||||||||||||
| 278 | - | |||||||||||||||||||
| 279 | static QString unknownText() | - | ||||||||||||||||||
| 280 | { | - | ||||||||||||||||||
| 281 | return never executed: ([]() -> QString { enum { Size = sizeof(u"" "unknown")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "unknown" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn ([]() -> QString { enum { Size = sizeof(u"" "unknown")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "unknown" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp;never executed: return ([]() -> QString { enum { Size = sizeof(u"" "unknown")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "unknown" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | 0 | ||||||||||||||||||
| 282 | } | - | ||||||||||||||||||
| 283 | QString QSysInfo::kernelType() | - | ||||||||||||||||||
| 284 | { | - | ||||||||||||||||||
| 285 | - | |||||||||||||||||||
| 286 | - | |||||||||||||||||||
| 287 | - | |||||||||||||||||||
| 288 | - | |||||||||||||||||||
| 289 | - | |||||||||||||||||||
| 290 | struct utsname u; | - | ||||||||||||||||||
| 291 | if (uname(&u) == 0
| 0-4 | ||||||||||||||||||
| 292 | return executed 4 times by 2 tests: QString::fromLatin1(u.sysname).toLower();return QString::fromLatin1(u.sysname).toLower();Executed by:
executed 4 times by 2 tests: return QString::fromLatin1(u.sysname).toLower();Executed by:
| 4 | ||||||||||||||||||
| 293 | - | |||||||||||||||||||
| 294 | return never executed: unknownText();return unknownText();never executed: return unknownText(); | 0 | ||||||||||||||||||
| 295 | } | - | ||||||||||||||||||
| 296 | QString QSysInfo::kernelVersion() | - | ||||||||||||||||||
| 297 | { | - | ||||||||||||||||||
| 298 | - | |||||||||||||||||||
| 299 | - | |||||||||||||||||||
| 300 | - | |||||||||||||||||||
| 301 | - | |||||||||||||||||||
| 302 | - | |||||||||||||||||||
| 303 | struct utsname u; | - | ||||||||||||||||||
| 304 | if (uname(&u) == 0
| 0-1 | ||||||||||||||||||
| 305 | return executed 1 time by 1 test: QString::fromLatin1(u.release);return QString::fromLatin1(u.release);Executed by:
executed 1 time by 1 test: return QString::fromLatin1(u.release);Executed by:
| 1 | ||||||||||||||||||
| 306 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||
| 307 | - | |||||||||||||||||||
| 308 | } | - | ||||||||||||||||||
| 309 | QString QSysInfo::productType() | - | ||||||||||||||||||
| 310 | { | - | ||||||||||||||||||
| 311 | QUnixOSVersion unixOsVersion; | - | ||||||||||||||||||
| 312 | findUnixOsVersion(unixOsVersion); | - | ||||||||||||||||||
| 313 | if (!unixOsVersion.productType.isEmpty()
| 0-6 | ||||||||||||||||||
| 314 | return executed 6 times by 2 tests: unixOsVersion.productType;return unixOsVersion.productType;Executed by:
executed 6 times by 2 tests: return unixOsVersion.productType;Executed by:
| 6 | ||||||||||||||||||
| 315 | - | |||||||||||||||||||
| 316 | return never executed: unknownText();return unknownText();never executed: return unknownText(); | 0 | ||||||||||||||||||
| 317 | } | - | ||||||||||||||||||
| 318 | QString QSysInfo::productVersion() | - | ||||||||||||||||||
| 319 | { | - | ||||||||||||||||||
| 320 | QUnixOSVersion unixOsVersion; | - | ||||||||||||||||||
| 321 | findUnixOsVersion(unixOsVersion); | - | ||||||||||||||||||
| 322 | if (!unixOsVersion.productVersion.isEmpty()
| 0-2 | ||||||||||||||||||
| 323 | return executed 2 times by 1 test: unixOsVersion.productVersion;return unixOsVersion.productVersion;Executed by:
executed 2 times by 1 test: return unixOsVersion.productVersion;Executed by:
| 2 | ||||||||||||||||||
| 324 | - | |||||||||||||||||||
| 325 | - | |||||||||||||||||||
| 326 | - | |||||||||||||||||||
| 327 | return never executed: unknownText();return unknownText();never executed: return unknownText(); | 0 | ||||||||||||||||||
| 328 | } | - | ||||||||||||||||||
| 329 | QString QSysInfo::prettyProductName() | - | ||||||||||||||||||
| 330 | { | - | ||||||||||||||||||
| 331 | QUnixOSVersion unixOsVersion; | - | ||||||||||||||||||
| 332 | findUnixOsVersion(unixOsVersion); | - | ||||||||||||||||||
| 333 | if (!unixOsVersion.prettyName.isEmpty()
| 0-1 | ||||||||||||||||||
| 334 | return executed 1 time by 1 test: unixOsVersion.prettyName;return unixOsVersion.prettyName;Executed by:
executed 1 time by 1 test: return unixOsVersion.prettyName;Executed by:
| 1 | ||||||||||||||||||
| 335 | - | |||||||||||||||||||
| 336 | struct utsname u; | - | ||||||||||||||||||
| 337 | if (uname(&u) == 0
| 0 | ||||||||||||||||||
| 338 | return never executed: QString::fromLatin1(u.sysname) + QLatin1Char(' ') + QString::fromLatin1(u.release);return QString::fromLatin1(u.sysname) + QLatin1Char(' ') + QString::fromLatin1(u.release);never executed: return QString::fromLatin1(u.sysname) + QLatin1Char(' ') + QString::fromLatin1(u.release); | 0 | ||||||||||||||||||
| 339 | - | |||||||||||||||||||
| 340 | return never executed: unknownText();return unknownText();never executed: return unknownText(); | 0 | ||||||||||||||||||
| 341 | } | - | ||||||||||||||||||
| 342 | QString QSysInfo::machineHostName() | - | ||||||||||||||||||
| 343 | { | - | ||||||||||||||||||
| 344 | - | |||||||||||||||||||
| 345 | - | |||||||||||||||||||
| 346 | - | |||||||||||||||||||
| 347 | struct utsname u; | - | ||||||||||||||||||
| 348 | if (uname(&u) == 0
| 0-3 | ||||||||||||||||||
| 349 | return executed 3 times by 2 tests: QString::fromLocal8Bit(u.nodename);return QString::fromLocal8Bit(u.nodename);Executed by:
executed 3 times by 2 tests: return QString::fromLocal8Bit(u.nodename);Executed by:
| 3 | ||||||||||||||||||
| 350 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||
| 351 | } | - | ||||||||||||||||||
| 352 | void qt_check_pointer(const char *n, int l) | - | ||||||||||||||||||
| 353 | { | - | ||||||||||||||||||
| 354 | QMessageLogger(__FILE__, 3051, __PRETTY_FUNCTION__).fatal("In file %s, line %d: Out of memory", n, l); | - | ||||||||||||||||||
| 355 | } never executed: end of block | 0 | ||||||||||||||||||
| 356 | - | |||||||||||||||||||
| 357 | - | |||||||||||||||||||
| 358 | - | |||||||||||||||||||
| 359 | - | |||||||||||||||||||
| 360 | - | |||||||||||||||||||
| 361 | - | |||||||||||||||||||
| 362 | void qBadAlloc() | - | ||||||||||||||||||
| 363 | { | - | ||||||||||||||||||
| 364 | throw never executed: std::bad_alloc();throw std::bad_alloc();never executed: throw std::bad_alloc(); | 0 | ||||||||||||||||||
| 365 | } | - | ||||||||||||||||||
| 366 | - | |||||||||||||||||||
| 367 | - | |||||||||||||||||||
| 368 | - | |||||||||||||||||||
| 369 | - | |||||||||||||||||||
| 370 | - | |||||||||||||||||||
| 371 | - | |||||||||||||||||||
| 372 | - | |||||||||||||||||||
| 373 | __attribute__((__noreturn__)) void qTerminate() noexcept | - | ||||||||||||||||||
| 374 | { | - | ||||||||||||||||||
| 375 | std::terminate(); | - | ||||||||||||||||||
| 376 | } never executed: end of block | 0 | ||||||||||||||||||
| 377 | - | |||||||||||||||||||
| 378 | - | |||||||||||||||||||
| 379 | - | |||||||||||||||||||
| 380 | - | |||||||||||||||||||
| 381 | - | |||||||||||||||||||
| 382 | void qt_assert(const char *assertion, const char *file, int line) noexcept | - | ||||||||||||||||||
| 383 | { | - | ||||||||||||||||||
| 384 | QMessageLogger(__FILE__, 3081, __PRETTY_FUNCTION__).fatal("ASSERT: \"%s\" in file %s, line %d", assertion, file, line); | - | ||||||||||||||||||
| 385 | } never executed: end of block | 0 | ||||||||||||||||||
| 386 | - | |||||||||||||||||||
| 387 | - | |||||||||||||||||||
| 388 | - | |||||||||||||||||||
| 389 | - | |||||||||||||||||||
| 390 | void qt_assert_x(const char *where, const char *what, const char *file, int line) noexcept | - | ||||||||||||||||||
| 391 | { | - | ||||||||||||||||||
| 392 | QMessageLogger(__FILE__, 3089, __PRETTY_FUNCTION__).fatal("ASSERT failure in %s: \"%s\", file %s, line %d", where, what, file, line); | - | ||||||||||||||||||
| 393 | } never executed: end of block | 0 | ||||||||||||||||||
| 394 | - | |||||||||||||||||||
| 395 | - | |||||||||||||||||||
| 396 | - | |||||||||||||||||||
| 397 | - | |||||||||||||||||||
| 398 | - | |||||||||||||||||||
| 399 | - | |||||||||||||||||||
| 400 | - | |||||||||||||||||||
| 401 | __attribute__((visibility("default"))) unsigned int qt_int_sqrt(unsigned int n) | - | ||||||||||||||||||
| 402 | { | - | ||||||||||||||||||
| 403 | - | |||||||||||||||||||
| 404 | if (n >= ((2147483647 * 2U + 1U)>>2)
| 0-23 | ||||||||||||||||||
| 405 | unsigned int r = 2 * qt_int_sqrt(n / 4); | - | ||||||||||||||||||
| 406 | unsigned int r2 = r + 1; | - | ||||||||||||||||||
| 407 | return never executed: (n >= r2 * r2) ? r2 : r;return (n >= r2 * r2) ? r2 : r;never executed: return (n >= r2 * r2) ? r2 : r; | 0 | ||||||||||||||||||
| 408 | } | - | ||||||||||||||||||
| 409 | uint h, p= 0, q= 1, r= n; | - | ||||||||||||||||||
| 410 | while (q <= n
| 23-190 | ||||||||||||||||||
| 411 | q <<= 2; executed 190 times by 4 tests: q <<= 2;Executed by:
| 190 | ||||||||||||||||||
| 412 | while (q != 1
| 23-190 | ||||||||||||||||||
| 413 | q >>= 2; | - | ||||||||||||||||||
| 414 | h= p + q; | - | ||||||||||||||||||
| 415 | p >>= 1; | - | ||||||||||||||||||
| 416 | if (r >= h
| 94-96 | ||||||||||||||||||
| 417 | p += q; | - | ||||||||||||||||||
| 418 | r -= h; | - | ||||||||||||||||||
| 419 | } executed 96 times by 4 tests: end of blockExecuted by:
| 96 | ||||||||||||||||||
| 420 | } executed 190 times by 4 tests: end of blockExecuted by:
| 190 | ||||||||||||||||||
| 421 | return executed 23 times by 4 tests: p;return p;Executed by:
executed 23 times by 4 tests: return p;Executed by:
| 23 | ||||||||||||||||||
| 422 | } | - | ||||||||||||||||||
| 423 | - | |||||||||||||||||||
| 424 | void *qMemCopy(void *dest, const void *src, size_t n) { return never executed: memcpy(dest, src, n);return memcpy(dest, src, n);never executed: }return memcpy(dest, src, n); | 0 | ||||||||||||||||||
| 425 | void *qMemSet(void *dest, int c, size_t n) { return never executed: memset(dest, c, n);return memset(dest, c, n);never executed: }return memset(dest, c, n); | 0 | ||||||||||||||||||
| 426 | - | |||||||||||||||||||
| 427 | - | |||||||||||||||||||
| 428 | - | |||||||||||||||||||
| 429 | namespace { | - | ||||||||||||||||||
| 430 | static inline __attribute__((__unused__)) QString fromstrerror_helper(int, const QByteArray &buf) | - | ||||||||||||||||||
| 431 | { | - | ||||||||||||||||||
| 432 | return never executed: QString::fromLocal8Bit(buf.constData());return QString::fromLocal8Bit(buf.constData());never executed: return QString::fromLocal8Bit(buf.constData()); | 0 | ||||||||||||||||||
| 433 | } | - | ||||||||||||||||||
| 434 | static inline __attribute__((__unused__)) QString fromstrerror_helper(const char *str, const QByteArray &) | - | ||||||||||||||||||
| 435 | { | - | ||||||||||||||||||
| 436 | return executed 17 times by 5 tests: QString::fromLocal8Bit(str);return QString::fromLocal8Bit(str);Executed by:
executed 17 times by 5 tests: return QString::fromLocal8Bit(str);Executed by:
| 17 | ||||||||||||||||||
| 437 | } | - | ||||||||||||||||||
| 438 | } | - | ||||||||||||||||||
| 439 | - | |||||||||||||||||||
| 440 | - | |||||||||||||||||||
| 441 | QString qt_error_string(int errorCode) | - | ||||||||||||||||||
| 442 | { | - | ||||||||||||||||||
| 443 | const char *s = 0; | - | ||||||||||||||||||
| 444 | QString ret; | - | ||||||||||||||||||
| 445 | if (errorCode == -1
| 9-3716 | ||||||||||||||||||
| 446 | - | |||||||||||||||||||
| 447 | - | |||||||||||||||||||
| 448 | - | |||||||||||||||||||
| 449 | errorCode = (*__errno_location ()); | - | ||||||||||||||||||
| 450 | - | |||||||||||||||||||
| 451 | } executed 9 times by 2 tests: end of blockExecuted by:
| 9 | ||||||||||||||||||
| 452 | switch (errorCode) { | - | ||||||||||||||||||
| 453 | case never executed: 0:case 0:never executed: case 0: | 0 | ||||||||||||||||||
| 454 | break; never executed: break; | 0 | ||||||||||||||||||
| 455 | case executed 47 times by 7 tests: 13:case 13:Executed by:
executed 47 times by 7 tests: case 13:Executed by:
| 47 | ||||||||||||||||||
| 456 | s = "Permission denied"; | - | ||||||||||||||||||
| 457 | break; executed 47 times by 7 tests: break;Executed by:
| 47 | ||||||||||||||||||
| 458 | case never executed: 24:case 24:never executed: case 24: | 0 | ||||||||||||||||||
| 459 | s = "Too many open files"; | - | ||||||||||||||||||
| 460 | break; never executed: break; | 0 | ||||||||||||||||||
| 461 | case executed 3655 times by 50 tests: 2:case 2:Executed by:
executed 3655 times by 50 tests: case 2:Executed by:
| 3655 | ||||||||||||||||||
| 462 | s = "No such file or directory"; | - | ||||||||||||||||||
| 463 | break; executed 3655 times by 50 tests: break;Executed by:
| 3655 | ||||||||||||||||||
| 464 | case executed 6 times by 1 test: 28:case 28:Executed by:
executed 6 times by 1 test: case 28:Executed by:
| 6 | ||||||||||||||||||
| 465 | s = "No space left on device"; | - | ||||||||||||||||||
| 466 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||
| 467 | default executed 17 times by 5 tests: :default:Executed by:
executed 17 times by 5 tests: {default:Executed by:
| 17 | ||||||||||||||||||
| 468 | QByteArray buf(1024, '\0'); | - | ||||||||||||||||||
| 469 | ret = fromstrerror_helper(strerror_r(errorCode, buf.data(), buf.size()), buf); | - | ||||||||||||||||||
| 470 | - | |||||||||||||||||||
| 471 | - | |||||||||||||||||||
| 472 | - | |||||||||||||||||||
| 473 | break; executed 17 times by 5 tests: }break;Executed by:
| 17 | ||||||||||||||||||
| 474 | } | - | ||||||||||||||||||
| 475 | if (s
| 17-3708 | ||||||||||||||||||
| 476 | - | |||||||||||||||||||
| 477 | - | |||||||||||||||||||
| 478 | ret = QString::fromLatin1(s); executed 3708 times by 52 tests: ret = QString::fromLatin1(s);Executed by:
| 3708 | ||||||||||||||||||
| 479 | return executed 3725 times by 53 tests: ret.trimmed();return ret.trimmed();Executed by:
executed 3725 times by 53 tests: return ret.trimmed();Executed by:
| 3725 | ||||||||||||||||||
| 480 | } | - | ||||||||||||||||||
| 481 | - | |||||||||||||||||||
| 482 | - | |||||||||||||||||||
| 483 | - | |||||||||||||||||||
| 484 | static QBasicMutex environmentMutex; | - | ||||||||||||||||||
| 485 | QByteArray qgetenv(const char *varName) | - | ||||||||||||||||||
| 486 | { | - | ||||||||||||||||||
| 487 | QMutexLocker locker(&environmentMutex); | - | ||||||||||||||||||
| 488 | return executed 48198 times by 361 tests: QByteArray(::getenv(varName));return QByteArray(::getenv(varName));Executed by:
executed 48198 times by 361 tests: return QByteArray(::getenv(varName));Executed by:
| 48198 | ||||||||||||||||||
| 489 | - | |||||||||||||||||||
| 490 | } | - | ||||||||||||||||||
| 491 | bool qEnvironmentVariableIsEmpty(const char *varName) noexcept | - | ||||||||||||||||||
| 492 | { | - | ||||||||||||||||||
| 493 | QMutexLocker locker(&environmentMutex); | - | ||||||||||||||||||
| 494 | const char * const value = ::getenv(varName); | - | ||||||||||||||||||
| 495 | return executed 1243771 times by 517 tests: !value || !*value;return !value || !*value;Executed by:
executed 1243771 times by 517 tests: return !value || !*value;Executed by:
| 1243771 | ||||||||||||||||||
| 496 | - | |||||||||||||||||||
| 497 | } | - | ||||||||||||||||||
| 498 | int qEnvironmentVariableIntValue(const char *varName, bool *ok) noexcept | - | ||||||||||||||||||
| 499 | { | - | ||||||||||||||||||
| 500 | QMutexLocker locker(&environmentMutex); | - | ||||||||||||||||||
| 501 | const char * const buffer = ::getenv(varName); | - | ||||||||||||||||||
| 502 | if (!buffer
| 2-2761 | ||||||||||||||||||
| 503 | if (ok
| 1260-1503 | ||||||||||||||||||
| 504 | * executed 1503 times by 503 tests: ok = false;*ok = false;Executed by:
executed 1503 times by 503 tests: *ok = false;Executed by:
| 1503 | ||||||||||||||||||
| 505 | return executed 2763 times by 507 tests: 0;return 0;Executed by:
executed 2763 times by 507 tests: return 0;Executed by:
| 2763 | ||||||||||||||||||
| 506 | } | - | ||||||||||||||||||
| 507 | - | |||||||||||||||||||
| 508 | bool ok_ = true; | - | ||||||||||||||||||
| 509 | const qlonglong value = qstrtoll(buffer, nullptr, 0, &ok_); | - | ||||||||||||||||||
| 510 | if (int(value) != value
| 14-29 | ||||||||||||||||||
| 511 | if (ok
| 7 | ||||||||||||||||||
| 512 | * executed 7 times by 1 test: ok = false;*ok = false;Executed by:
executed 7 times by 1 test: *ok = false;Executed by:
| 7 | ||||||||||||||||||
| 513 | return executed 14 times by 1 test: 0;return 0;Executed by:
executed 14 times by 1 test: return 0;Executed by:
| 14 | ||||||||||||||||||
| 514 | } else if (ok
| 14-15 | ||||||||||||||||||
| 515 | *ok = ok_; | - | ||||||||||||||||||
| 516 | } executed 15 times by 2 tests: end of blockExecuted by:
| 15 | ||||||||||||||||||
| 517 | return executed 29 times by 2 tests: int(value);return int(value);Executed by:
executed 29 times by 2 tests: return int(value);Executed by:
| 29 | ||||||||||||||||||
| 518 | } | - | ||||||||||||||||||
| 519 | bool qEnvironmentVariableIsSet(const char *varName) noexcept | - | ||||||||||||||||||
| 520 | { | - | ||||||||||||||||||
| 521 | QMutexLocker locker(&environmentMutex); | - | ||||||||||||||||||
| 522 | - | |||||||||||||||||||
| 523 | - | |||||||||||||||||||
| 524 | - | |||||||||||||||||||
| 525 | - | |||||||||||||||||||
| 526 | - | |||||||||||||||||||
| 527 | return executed 1985 times by 178 tests: ::getenv(varName) != 0;return ::getenv(varName) != 0;Executed by:
executed 1985 times by 178 tests: return ::getenv(varName) != 0;Executed by:
| 1985 | ||||||||||||||||||
| 528 | - | |||||||||||||||||||
| 529 | } | - | ||||||||||||||||||
| 530 | bool qputenv(const char *varName, const QByteArray& value) | - | ||||||||||||||||||
| 531 | { | - | ||||||||||||||||||
| 532 | QMutexLocker locker(&environmentMutex); | - | ||||||||||||||||||
| 533 | - | |||||||||||||||||||
| 534 | - | |||||||||||||||||||
| 535 | - | |||||||||||||||||||
| 536 | - | |||||||||||||||||||
| 537 | return executed 1846 times by 13 tests: setenv(varName, value.constData(), true) == 0;return setenv(varName, value.constData(), true) == 0;Executed by:
executed 1846 times by 13 tests: return setenv(varName, value.constData(), true) == 0;Executed by:
| 1846 | ||||||||||||||||||
| 538 | } | - | ||||||||||||||||||
| 539 | bool qunsetenv(const char *varName) | - | ||||||||||||||||||
| 540 | { | - | ||||||||||||||||||
| 541 | QMutexLocker locker(&environmentMutex); | - | ||||||||||||||||||
| 542 | - | |||||||||||||||||||
| 543 | - | |||||||||||||||||||
| 544 | - | |||||||||||||||||||
| 545 | - | |||||||||||||||||||
| 546 | return executed 74 times by 4 tests: unsetenv(varName) == 0;return unsetenv(varName) == 0;Executed by:
executed 74 times by 4 tests: return unsetenv(varName) == 0;Executed by:
| 74 | ||||||||||||||||||
| 547 | } | - | ||||||||||||||||||
| 548 | - | |||||||||||||||||||
| 549 | - | |||||||||||||||||||
| 550 | - | |||||||||||||||||||
| 551 | - | |||||||||||||||||||
| 552 | - | |||||||||||||||||||
| 553 | - | |||||||||||||||||||
| 554 | - | |||||||||||||||||||
| 555 | typedef uint SeedStorageType; | - | ||||||||||||||||||
| 556 | - | |||||||||||||||||||
| 557 | - | |||||||||||||||||||
| 558 | typedef QThreadStorage<SeedStorageType *> SeedStorage; | - | ||||||||||||||||||
| 559 | namespace { namespace Q_QGS_randTLS { typedef SeedStorage Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
executed 52 times by 51 tests: }guard.store(QtGlobalStatic::Destroyed);Executed by:
executed 52 times by 51 tests: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blockExecuted by:
executed 20183061 times by 51 tests: &holder.value;return &holder.value;Executed by:
executed 20183061 times by 51 tests: } } } static QGlobalStatic<SeedStorage, Q_QGS_randTLS::innerFunction, Q_QGS_randTLS::guard> randTLS;return &holder.value;Executed by:
| 0-20183061 | ||||||||||||||||||
| 560 | void qsrand(uint seed) | - | ||||||||||||||||||
| 561 | { | - | ||||||||||||||||||
| 562 | - | |||||||||||||||||||
| 563 | SeedStorage *seedStorage = randTLS(); | - | ||||||||||||||||||
| 564 | if (seedStorage
| 0-30 | ||||||||||||||||||
| 565 | SeedStorageType *pseed = seedStorage->localData(); | - | ||||||||||||||||||
| 566 | if (!pseed
| 7-23 | ||||||||||||||||||
| 567 | seedStorage->setLocalData(pseed = new SeedStorageType); executed 23 times by 2 tests: seedStorage->setLocalData(pseed = new SeedStorageType);Executed by:
| 23 | ||||||||||||||||||
| 568 | *pseed = seed; | - | ||||||||||||||||||
| 569 | } executed 30 times by 6 tests: else {end of blockExecuted by:
| 30 | ||||||||||||||||||
| 570 | - | |||||||||||||||||||
| 571 | - | |||||||||||||||||||
| 572 | - | |||||||||||||||||||
| 573 | - | |||||||||||||||||||
| 574 | srand(seed); | - | ||||||||||||||||||
| 575 | } never executed: end of block | 0 | ||||||||||||||||||
| 576 | } | - | ||||||||||||||||||
| 577 | int qrand() | - | ||||||||||||||||||
| 578 | { | - | ||||||||||||||||||
| 579 | - | |||||||||||||||||||
| 580 | SeedStorage *seedStorage = randTLS(); | - | ||||||||||||||||||
| 581 | if (seedStorage
| 1-20183031 | ||||||||||||||||||
| 582 | SeedStorageType *pseed = seedStorage->localData(); | - | ||||||||||||||||||
| 583 | if (!pseed
| 649-20182382 | ||||||||||||||||||
| 584 | seedStorage->setLocalData(pseed = new SeedStorageType); | - | ||||||||||||||||||
| 585 | *pseed = 1; | - | ||||||||||||||||||
| 586 | } executed 649 times by 48 tests: end of blockExecuted by:
| 649 | ||||||||||||||||||
| 587 | return executed 20183031 times by 50 tests: rand_r(pseed);return rand_r(pseed);Executed by:
executed 20183031 times by 50 tests: return rand_r(pseed);Executed by:
| 20183031 | ||||||||||||||||||
| 588 | } else { | - | ||||||||||||||||||
| 589 | - | |||||||||||||||||||
| 590 | - | |||||||||||||||||||
| 591 | - | |||||||||||||||||||
| 592 | - | |||||||||||||||||||
| 593 | return executed 1 time by 1 test: rand();return rand();Executed by:
executed 1 time by 1 test: return rand();Executed by:
| 1 | ||||||||||||||||||
| 594 | } | - | ||||||||||||||||||
| 595 | } | - | ||||||||||||||||||
| 596 | struct QInternal_CallBackTable { | - | ||||||||||||||||||
| 597 | QVector<QList<qInternalCallback> > callbacks; | - | ||||||||||||||||||
| 598 | }; | - | ||||||||||||||||||
| 599 | - | |||||||||||||||||||
| 600 | namespace { namespace Q_QGS_global_callback_table { typedef QInternal_CallBackTable Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
executed 1172 times by 420 tests: }guard.store(QtGlobalStatic::Destroyed);Executed by:
executed 1172 times by 420 tests: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blockExecuted by:
executed 1768577 times by 526 tests: &holder.value;return &holder.value;Executed by:
executed 1768577 times by 526 tests: } } } static QGlobalStatic<QInternal_CallBackTable, Q_QGS_global_callback_table::innerFunction, Q_QGS_global_callback_table::guard> global_callback_table;return &holder.value;Executed by:
| 0-1768577 | ||||||||||||||||||
| 601 | - | |||||||||||||||||||
| 602 | bool QInternal::registerCallback(Callback cb, qInternalCallback callback) | - | ||||||||||||||||||
| 603 | { | - | ||||||||||||||||||
| 604 | if (cb >= 0
| 0 | ||||||||||||||||||
| 605 | QInternal_CallBackTable *cbt = global_callback_table(); | - | ||||||||||||||||||
| 606 | cbt->callbacks.resize(cb + 1); | - | ||||||||||||||||||
| 607 | cbt->callbacks[cb].append(callback); | - | ||||||||||||||||||
| 608 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 609 | } | - | ||||||||||||||||||
| 610 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 611 | } | - | ||||||||||||||||||
| 612 | - | |||||||||||||||||||
| 613 | bool QInternal::unregisterCallback(Callback cb, qInternalCallback callback) | - | ||||||||||||||||||
| 614 | { | - | ||||||||||||||||||
| 615 | if (cb >= 0
| 0 | ||||||||||||||||||
| 616 | QInternal_CallBackTable *cbt = global_callback_table(); | - | ||||||||||||||||||
| 617 | return never executed: (bool) cbt->callbacks[cb].removeAll(callback);return (bool) cbt->callbacks[cb].removeAll(callback);never executed: return (bool) cbt->callbacks[cb].removeAll(callback); | 0 | ||||||||||||||||||
| 618 | } | - | ||||||||||||||||||
| 619 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 620 | } | - | ||||||||||||||||||
| 621 | - | |||||||||||||||||||
| 622 | bool QInternal::activateCallbacks(Callback cb, void **parameters) | - | ||||||||||||||||||
| 623 | { | - | ||||||||||||||||||
| 624 | ((!(cb >= 0)) ? qt_assert_x("QInternal::activateCallback()", "Callback id must be a valid id",__FILE__,4032) : qt_noop()); | - | ||||||||||||||||||
| 625 | - | |||||||||||||||||||
| 626 | QInternal_CallBackTable *cbt = global_callback_table(); | - | ||||||||||||||||||
| 627 | if (cbt
| 0-1768591 | ||||||||||||||||||
| 628 | QList<qInternalCallback> callbacks = cbt->callbacks[cb]; | - | ||||||||||||||||||
| 629 | bool ret = false; | - | ||||||||||||||||||
| 630 | for (int i=0; i<callbacks.size()
| 0 | ||||||||||||||||||
| 631 | ret |= (callbacks.at(i))(parameters); never executed: ret |= (callbacks.at(i))(parameters); | 0 | ||||||||||||||||||
| 632 | return never executed: ret;return ret;never executed: return ret; | 0 | ||||||||||||||||||
| 633 | } | - | ||||||||||||||||||
| 634 | return executed 1768594 times by 527 tests: false;return false;Executed by:
executed 1768594 times by 527 tests: return false;Executed by:
| 1768594 | ||||||||||||||||||
| 635 | } | - | ||||||||||||||||||
| 636 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |