qdataurl.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qdataurl.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10__attribute__((visibility("default"))) bool qDecodeDataUrl(const QUrl &uri, QString &mimeType, QByteArray &payload)-
11{-
12 if (uri.scheme() != QLatin1String("data")
uri.scheme() !...String("data")Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDataUrl
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_QDataUrl
  • tst_QNetworkReply
|| !uri.host().isEmpty()
!uri.host().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_QDataUrl
  • tst_QNetworkReply
)
0-32
13 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QDataUrl
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QDataUrl
1
14-
15 mimeType = QLatin1String("text/plain;charset=US-ASCII");-
16-
17-
18-
19-
20-
21 QByteArray data = QByteArray::fromPercentEncoding(uri.url(QUrl::FullyEncoded | QUrl::RemoveScheme).toLatin1());-
22-
23-
24 int pos = data.indexOf(',');-
25 if (pos != -1
pos != -1Description
TRUEevaluated 31 times by 2 tests
Evaluated by:
  • tst_QDataUrl
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDataUrl
) {
1-31
26 payload = data.mid(pos + 1);-
27 data.truncate(pos);-
28 data = data.trimmed();-
29-
30-
31 if (data.endsWith(";base64")
data.endsWith(";base64")Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QDataUrl
  • tst_QNetworkReply
) {
11-20
32 payload = QByteArray::fromBase64(payload);-
33 data.chop(7);-
34 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
11
35-
36 if (data.toLower().startsWith("charset")
data.toLower()...ith("charset")Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 27 times by 2 tests
Evaluated by:
  • tst_QDataUrl
  • tst_QNetworkReply
) {
4-27
37 int i = 7;-
38 while (data.at(i) == ' '
data.at(i) == ' 'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1-4
39 ++
executed 1 time by 1 test: ++i;
Executed by:
  • tst_QNetworkReply
i;
executed 1 time by 1 test: ++i;
Executed by:
  • tst_QNetworkReply
1
40 if (data.at(i) == '='
data.at(i) == '='Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-4
41 data.prepend("text/plain;");
executed 4 times by 1 test: data.prepend("text/plain;");
Executed by:
  • tst_QNetworkReply
4
42 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
4
43-
44 if (!data.isEmpty()
!data.isEmpty()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QDataUrl
  • tst_QNetworkReply
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
15-16
45 mimeType = QLatin1String(data.trimmed());
executed 16 times by 2 tests: mimeType = QLatin1String(data.trimmed());
Executed by:
  • tst_QDataUrl
  • tst_QNetworkReply
16
46-
47 }
executed 31 times by 2 tests: end of block
Executed by:
  • tst_QDataUrl
  • tst_QNetworkReply
31
48-
49 return
executed 32 times by 2 tests: return true;
Executed by:
  • tst_QDataUrl
  • tst_QNetworkReply
true;
executed 32 times by 2 tests: return true;
Executed by:
  • tst_QDataUrl
  • tst_QNetworkReply
32
50}-
51-
52-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9