OpenCoverage

qmimemagicrulematcher.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/mimetypes/qmimemagicrulematcher.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QMimeMagicRuleMatcher::QMimeMagicRuleMatcher(const QString &mime, unsigned thePriority) :-
7 m_list(),-
8 m_priority(thePriority),-
9 m_mimetype(mime)-
10{-
11}
executed 1733 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
1733
12-
13bool QMimeMagicRuleMatcher::operator==(const QMimeMagicRuleMatcher &other) const-
14{-
15 return
never executed: return m_list == other.m_list && m_priority == other.m_priority;
m_list == other.m_list &&
never executed: return m_list == other.m_list && m_priority == other.m_priority;
0
16 m_priority == other.m_priority;
never executed: return m_list == other.m_list && m_priority == other.m_priority;
0
17}-
18-
19void QMimeMagicRuleMatcher::addRule(const QMimeMagicRule &rule)-
20{-
21 m_list.append(rule);-
22}
never executed: end of block
0
23-
24void QMimeMagicRuleMatcher::addRules(const QList<QMimeMagicRule> &rules)-
25{-
26 m_list.append(rules);-
27}
executed 1733 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
1733
28-
29QList<QMimeMagicRule> QMimeMagicRuleMatcher::magicRules() const-
30{-
31 return
never executed: return m_list;
m_list;
never executed: return m_list;
0
32}-
33-
34-
35bool QMimeMagicRuleMatcher::matches(const QByteArray &data) const-
36{-
37 for (const QMimeMagicRule &magicRule : m_list) {-
38 if (magicRule.matches(data)
magicRule.matches(data)Description
TRUEevaluated 37 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 19185 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
37-19185
39 return
executed 37 times by 1 test: return true;
Executed by:
  • tst_QMimeDatabase
true;
executed 37 times by 1 test: return true;
Executed by:
  • tst_QMimeDatabase
37
40 }
executed 19185 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
19185
41-
42 return
executed 11003 times by 1 test: return false;
Executed by:
  • tst_QMimeDatabase
false;
executed 11003 times by 1 test: return false;
Executed by:
  • tst_QMimeDatabase
11003
43}-
44-
45-
46unsigned QMimeMagicRuleMatcher::priority() const-
47{-
48 return
executed 37 times by 1 test: return m_priority;
Executed by:
  • tst_QMimeDatabase
m_priority;
executed 37 times by 1 test: return m_priority;
Executed by:
  • tst_QMimeDatabase
37
49}-
50-
51-
Switch to Source codePreprocessed file

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