qsignaldumper.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/testlib/qsignaldumper.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7namespace QTest-
8{-
9-
10inline static void qPrintMessage(const QByteArray &ba)-
11{-
12 QTestLog::info(ba.constData(), 0, 0);-
13}
never executed: end of block
0
14-
15namespace { namespace Q_QGS_ignoreClasses { typedef QList<QByteArray> Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QList<QByteArray>, Q_QGS_ignoreClasses::innerFunction, Q_QGS_ignoreClasses::guard> ignoreClasses;
0
16static int iLevel = 0;-
17static int ignoreLevel = 0;-
18enum { IndentSpacesCount = 4 };-
19-
20static void qSignalDumperCallback(QObject *caller, int signal_index, void **argv)-
21{-
22 ((!(caller)) ? qt_assert("caller",__FILE__,69) : qt_noop()); ((!(argv)) ? qt_assert("argv",__FILE__,69) : qt_noop()); (void)argv;;-
23 const QMetaObject *mo = caller->metaObject();-
24 ((!(mo)) ? qt_assert("mo",__FILE__,71) : qt_noop());-
25 QMetaMethod member = QMetaObjectPrivate::signal(mo, signal_index);-
26 ((!(member.isValid())) ? qt_assert("member.isValid()",__FILE__,73) : qt_noop());-
27-
28 if (QTest::ignoreClasses()
QTest::ignoreClasses()Description
TRUEnever evaluated
FALSEnever evaluated
&& QTest::ignoreClasses()->contains(mo->className())
QTest::ignoreC...->className())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
29 ++QTest::ignoreLevel;-
30 return;
never executed: return;
0
31 }-
32-
33 QByteArray str;-
34 str.fill(' ', QTest::iLevel++ * QTest::IndentSpacesCount);-
35 str += "Signal: ";-
36 str += mo->className();-
37 str += '(';-
38-
39 QString objname = caller->objectName();-
40 str += objname.toLocal8Bit();-
41 if (!objname.isEmpty()
!objname.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
42 str += ' ';
never executed: str += ' ';
0
43 str += QByteArray::number(quintptr(caller), 16);-
44-
45 str += ") ";-
46 str += member.name();-
47 str += " (";-
48-
49 QList<QByteArray> args = member.parameterTypes();-
50 for (int i = 0; i < args.count()
i < args.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
51 const QByteArray &arg = args.at(i);-
52 int typeId = QMetaType::type(args.at(i).constData());-
53 if (arg.endsWith('*')
arg.endsWith('*')Description
TRUEnever evaluated
FALSEnever evaluated
|| arg.endsWith('&')
arg.endsWith('&')Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
54 str += '(';-
55 str += arg;-
56 str += ')';-
57 if (arg.endsWith('&')
arg.endsWith('&')Description
TRUEnever evaluated
FALSEnever evaluated
)
0
58 str += '@';
never executed: str += '@';
0
59-
60 quintptr addr = quintptr(*reinterpret_cast<void **>(argv[i + 1]));-
61 str.append(QByteArray::number(addr, 16));-
62 }
never executed: end of block
else if (typeId != QMetaType::UnknownType
typeId != QMet...e::UnknownTypeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
63 ((!(typeId != QMetaType::Void)) ? qt_assert("typeId != QMetaType::Void",__FILE__,110) : qt_noop());-
64 str.append(arg)-
65 .append('(')-
66 .append(QVariant(typeId, argv[i + 1]).toString().toLocal8Bit())-
67 .append(')');-
68 }
never executed: end of block
0
69 str.append(", ");-
70 }
never executed: end of block
0
71 if (str.endsWith(", ")
str.endsWith(", ")Description
TRUEnever evaluated
FALSEnever evaluated
)
0
72 str.chop(2);
never executed: str.chop(2);
0
73 str.append(')');-
74 qPrintMessage(str);-
75}
never executed: end of block
0
76-
77static void qSignalDumperCallbackSlot(QObject *caller, int method_index, void **argv)-
78{-
79 ((!(caller)) ? qt_assert("caller",__FILE__,126) : qt_noop()); ((!(argv)) ? qt_assert("argv",__FILE__,126) : qt_noop()); (void)argv;;-
80 const QMetaObject *mo = caller->metaObject();-
81 ((!(mo)) ? qt_assert("mo",__FILE__,128) : qt_noop());-
82 QMetaMethod member = mo->method(method_index);-
83 if (!member.isValid()
!member.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
84 return;
never executed: return;
0
85-
86 if (QTest::ignoreLevel
QTest::ignoreLevelDescription
TRUEnever evaluated
FALSEnever evaluated
||
0
87 (QTest::ignoreClasses()
QTest::ignoreClasses()Description
TRUEnever evaluated
FALSEnever evaluated
&& QTest::ignoreClasses()->contains(mo->className())
QTest::ignoreC...->className())Description
TRUEnever evaluated
FALSEnever evaluated
))
0
88 return;
never executed: return;
0
89-
90 QByteArray str;-
91 str.fill(' ', QTest::iLevel * QTest::IndentSpacesCount);-
92 str += "Slot: ";-
93 str += mo->className();-
94 str += '(';-
95-
96 QString objname = caller->objectName();-
97 str += objname.toLocal8Bit();-
98 if (!objname.isEmpty()
!objname.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
99 str += ' ';
never executed: str += ' ';
0
100 str += QByteArray::number(quintptr(caller), 16);-
101-
102 str += ") ";-
103 str += member.methodSignature();-
104 qPrintMessage(str);-
105}
never executed: end of block
0
106-
107static void qSignalDumperCallbackEndSignal(QObject *caller, int )-
108{-
109 ((!(caller)) ? qt_assert("caller",__FILE__,156) : qt_noop()); ((!(caller->metaObject())) ? qt_assert("caller->metaObject()",__FILE__,156) : qt_noop());-
110 if (QTest::ignoreClasses()
QTest::ignoreClasses()Description
TRUEnever evaluated
FALSEnever evaluated
0
111 && QTest::ignoreClasses()->contains(caller->metaObject()->className())
QTest::ignoreC...->className())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
112 --QTest::ignoreLevel;-
113 ((!(QTest::ignoreLevel >= 0)) ? qt_assert("QTest::ignoreLevel >= 0",__FILE__,160) : qt_noop());-
114 return;
never executed: return;
0
115 }-
116 --QTest::iLevel;-
117 ((!(QTest::iLevel >= 0)) ? qt_assert("QTest::iLevel >= 0",__FILE__,164) : qt_noop());-
118}
never executed: end of block
0
119-
120}-
121-
122void QSignalDumper::startDump()-
123{-
124 static QSignalSpyCallbackSet set = { QTest::qSignalDumperCallback,-
125 QTest::qSignalDumperCallbackSlot, QTest::qSignalDumperCallbackEndSignal, 0 };-
126 qt_register_signal_spy_callbacks(set);-
127}
never executed: end of block
0
128-
129void QSignalDumper::endDump()-
130{-
131 static QSignalSpyCallbackSet nset = { 0, 0, 0 ,0 };-
132 qt_register_signal_spy_callbacks(nset);-
133}
executed 1238 times by 508 tests: end of block
Executed by:
  • tst_collections - unknown status
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_q_func_info - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractfileengine - unknown status
  • tst_qabstractitemmodel - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • ...
1238
134-
135void QSignalDumper::ignoreClass(const QByteArray &klass)-
136{-
137 if (QTest::ignoreClasses()
QTest::ignoreClasses()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
138 QTest::ignoreClasses()->append(klass);
never executed: QTest::ignoreClasses()->append(klass);
0
139}
never executed: end of block
0
140-
141void QSignalDumper::clearIgnoredClasses()-
142{-
143 if (QTest::ignoreClasses()
QTest::ignoreClasses()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
144 QTest::ignoreClasses()->clear();
never executed: QTest::ignoreClasses()->clear();
0
145}
never executed: end of block
0
146-
147-
Switch to Source codePreprocessed file

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