OpenCoverage

qnumeric.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/global/qnumeric.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8__attribute__((visibility("default"))) bool qIsInf(double d) { return
executed 796 times by 68 tests: return qt_is_inf(d);
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDesktopWidget
  • tst_QDialog
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontDialog
  • tst_QGestureRecognizer
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • ...
qt_is_inf(d);
executed 796 times by 68 tests: return qt_is_inf(d);
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QDesktopWidget
  • tst_QDialog
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontDialog
  • tst_QGestureRecognizer
  • tst_QGraphicsItem
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsSceneIndex
  • tst_QGraphicsView
  • ...
}
796
9-
10-
11-
12-
13-
14__attribute__((visibility("default"))) bool qIsNaN(double d) { return
executed 749317 times by 135 tests: return qt_is_nan(d);
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • ...
qt_is_nan(d);
executed 749317 times by 135 tests: return qt_is_nan(d);
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • ...
}
749317
15-
16-
17-
18-
19-
20__attribute__((visibility("default"))) bool qIsFinite(double d) { return
executed 4223 times by 29 tests: return qt_is_finite(d);
Executed by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QNumeric
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • ...
qt_is_finite(d);
executed 4223 times by 29 tests: return qt_is_finite(d);
Executed by:
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDoubleSpinBox
  • tst_QDoubleValidator
  • tst_QEasingCurve
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QNumeric
  • tst_QObject
  • tst_QPrinter
  • tst_QSpinBox
  • tst_QSqlDatabase
  • tst_QString
  • tst_QStringRef
  • tst_QStyleSheetStyle
  • tst_QTextDocument
  • tst_QTextDocumentFragment
  • tst_QTextDocumentLayout
  • tst_QTextEdit
  • tst_QTextList
  • ...
}
4223
21-
22-
23-
24-
25-
26__attribute__((visibility("default"))) bool qIsInf(float f) { return
executed 11 times by 2 tests: return qt_is_inf(f);
Executed by:
  • tst_QString
  • tst_QTextStream
qt_is_inf(f);
executed 11 times by 2 tests: return qt_is_inf(f);
Executed by:
  • tst_QString
  • tst_QTextStream
}
11
27-
28-
29-
30-
31-
32__attribute__((visibility("default"))) bool qIsNaN(float f) { return
executed 18 times by 2 tests: return qt_is_nan(f);
Executed by:
  • tst_QTextStream
  • tst_QVariant
qt_is_nan(f);
executed 18 times by 2 tests: return qt_is_nan(f);
Executed by:
  • tst_QTextStream
  • tst_QVariant
}
18
33-
34-
35-
36-
37-
38__attribute__((visibility("default"))) bool qIsFinite(float f) { return
executed 44 times by 1 test: return qt_is_finite(f);
Executed by:
  • tst_QNumeric
qt_is_finite(f);
executed 44 times by 1 test: return qt_is_finite(f);
Executed by:
  • tst_QNumeric
}
44
39-
40-
41-
42-
43-
44__attribute__((visibility("default"))) double qSNaN() { return
executed 21 times by 2 tests: return qt_snan();
Executed by:
  • tst_QPainterPath
  • tst_QTextStream
qt_snan();
executed 21 times by 2 tests: return qt_snan();
Executed by:
  • tst_QPainterPath
  • tst_QTextStream
}
21
45-
46-
47-
48-
49-
50__attribute__((visibility("default"))) double qQNaN() { return
executed 64 times by 6 tests: return qt_qnan();
Executed by:
  • tst_QBrush
  • tst_QGraphicsTransform
  • tst_QNumeric
  • tst_QPainterPath
  • tst_QScroller
  • tst_QTextStream
qt_qnan();
executed 64 times by 6 tests: return qt_qnan();
Executed by:
  • tst_QBrush
  • tst_QGraphicsTransform
  • tst_QNumeric
  • tst_QPainterPath
  • tst_QScroller
  • tst_QTextStream
}
64
51-
52-
53-
54-
55-
56__attribute__((visibility("default"))) double qInf() { return
executed 168 times by 9 tests: return qt_inf();
Executed by:
  • tst_QNumeric
  • tst_QPainterPath
  • tst_QScroller
  • tst_QString
  • tst_QTextStream
  • tst_QVariant
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
qt_inf();
executed 168 times by 9 tests: return qt_inf();
Executed by:
  • tst_QNumeric
  • tst_QPainterPath
  • tst_QScroller
  • tst_QString
  • tst_QTextStream
  • tst_QVariant
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
}
168
57-
58-
59-
60-
61-
62-
63static inline quint32 f2i(float f)-
64{-
65 quint32 i;-
66 memcpy(&i, &f, sizeof(f));-
67 return
executed 23 times by 1 test: return i;
Executed by:
  • tst_QNumeric
i;
executed 23 times by 1 test: return i;
Executed by:
  • tst_QNumeric
23
68}-
69__attribute__((visibility("default"))) quint32 qFloatDistance(float a, float b)-
70{-
71 static const quint32 smallestPositiveFloatAsBits = 0x00000001;-
72-
73-
74-
75-
76 static_assert(bool(sizeof(quint32) == sizeof(float)), "sizeof(quint32) == sizeof(float)");-
77 ((!(qIsFinite(a) && qIsFinite(b))) ? qt_assert("qIsFinite(a) && qIsFinite(b)",__FILE__,152) : qt_noop());-
78 if (a == b
a == bDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_QNumeric
)
1-21
79 return
executed 1 time by 1 test: return 0;
Executed by:
  • tst_QNumeric
0;
executed 1 time by 1 test: return 0;
Executed by:
  • tst_QNumeric
1
80 if ((
(a < 0) != (b < 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QNumeric
a < 0) != (b < 0)
(a < 0) != (b < 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QNumeric
) {
4-17
81-
82 if (a < 0
a < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEnever evaluated
)
0-4
83 a = -a;
executed 4 times by 1 test: a = -a;
Executed by:
  • tst_QNumeric
4
84 else-
85 b = -b;
never executed: b = -b;
0
86 return
executed 4 times by 1 test: return qFloatDistance(0.0F, a) + qFloatDistance(0.0F, b);
Executed by:
  • tst_QNumeric
qFloatDistance(0.0F, a) + qFloatDistance(0.0F, b);
executed 4 times by 1 test: return qFloatDistance(0.0F, a) + qFloatDistance(0.0F, b);
Executed by:
  • tst_QNumeric
4
87 }-
88 if (a < 0
a < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_QNumeric
) {
2-15
89 a = -a;-
90 b = -b;-
91 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QNumeric
2
92-
93-
94-
95 if (!a
!aDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNumeric
)
6-11
96 return
executed 11 times by 1 test: return f2i(b) - smallestPositiveFloatAsBits + 1;
Executed by:
  • tst_QNumeric
f2i(b) - smallestPositiveFloatAsBits + 1;
executed 11 times by 1 test: return f2i(b) - smallestPositiveFloatAsBits + 1;
Executed by:
  • tst_QNumeric
11
97 if (!b
!bDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNumeric
)
0-6
98 return
never executed: return f2i(a) - smallestPositiveFloatAsBits + 1;
f2i(a) - smallestPositiveFloatAsBits + 1;
never executed: return f2i(a) - smallestPositiveFloatAsBits + 1;
0
99-
100-
101 return
executed 6 times by 1 test: return a > b ? f2i(a) - f2i(b) : f2i(b) - f2i(a);
Executed by:
  • tst_QNumeric
a > b ? f2i(a) - f2i(b) : f2i(b) - f2i(a);
executed 6 times by 1 test: return a > b ? f2i(a) - f2i(b) : f2i(b) - f2i(a);
Executed by:
  • tst_QNumeric
6
102}-
103-
104-
105-
106-
107-
108static inline quint64 d2i(double d)-
109{-
110 quint64 i;-
111 memcpy(&i, &d, sizeof(d));-
112 return
executed 23 times by 1 test: return i;
Executed by:
  • tst_QNumeric
i;
executed 23 times by 1 test: return i;
Executed by:
  • tst_QNumeric
23
113}-
114__attribute__((visibility("default"))) quint64 qFloatDistance(double a, double b)-
115{-
116 static const quint64 smallestPositiveFloatAsBits = 0x1;-
117-
118-
119-
120-
121 static_assert(bool(sizeof(quint64) == sizeof(double)), "sizeof(quint64) == sizeof(double)");-
122 ((!(qIsFinite(a) && qIsFinite(b))) ? qt_assert("qIsFinite(a) && qIsFinite(b)",__FILE__,210) : qt_noop());-
123 if (a == b
a == bDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_QNumeric
)
1-21
124 return
executed 1 time by 1 test: return 0;
Executed by:
  • tst_QNumeric
0;
executed 1 time by 1 test: return 0;
Executed by:
  • tst_QNumeric
1
125 if ((
(a < 0) != (b < 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QNumeric
a < 0) != (b < 0)
(a < 0) != (b < 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QNumeric
) {
4-17
126-
127 if (a < 0
a < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEnever evaluated
)
0-4
128 a = -a;
executed 4 times by 1 test: a = -a;
Executed by:
  • tst_QNumeric
4
129 else-
130 b = -b;
never executed: b = -b;
0
131 return
executed 4 times by 1 test: return qFloatDistance(0.0, a) + qFloatDistance(0.0, b);
Executed by:
  • tst_QNumeric
qFloatDistance(0.0, a) + qFloatDistance(0.0, b);
executed 4 times by 1 test: return qFloatDistance(0.0, a) + qFloatDistance(0.0, b);
Executed by:
  • tst_QNumeric
4
132 }-
133 if (a < 0
a < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_QNumeric
) {
2-15
134 a = -a;-
135 b = -b;-
136 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QNumeric
2
137-
138-
139-
140 if (!a
!aDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QNumeric
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNumeric
)
6-11
141 return
executed 11 times by 1 test: return d2i(b) - smallestPositiveFloatAsBits + 1;
Executed by:
  • tst_QNumeric
d2i(b) - smallestPositiveFloatAsBits + 1;
executed 11 times by 1 test: return d2i(b) - smallestPositiveFloatAsBits + 1;
Executed by:
  • tst_QNumeric
11
142 if (!b
!bDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNumeric
)
0-6
143 return
never executed: return d2i(a) - smallestPositiveFloatAsBits + 1;
d2i(a) - smallestPositiveFloatAsBits + 1;
never executed: return d2i(a) - smallestPositiveFloatAsBits + 1;
0
144-
145-
146 return
executed 6 times by 1 test: return a > b ? d2i(a) - d2i(b) : d2i(b) - d2i(a);
Executed by:
  • tst_QNumeric
a > b ? d2i(a) - d2i(b) : d2i(b) - d2i(a);
executed 6 times by 1 test: return a > b ? d2i(a) - d2i(b) : d2i(b) - d2i(a);
Executed by:
  • tst_QNumeric
6
147}-
148-
149-
150-
Switch to Source codePreprocessed file

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