OpenCoverage

qdatetimeparser.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qdatetimeparser.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3int QDateTimeParser::getDigit(const QDateTime &t, int index) const-
4{-
5 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 3487 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
|| index >= sectionNodes.size()
index >= sectionNodes.size()Description
TRUEnever evaluated
FALSEevaluated 3487 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
0-3487
6-
7 QMessageLogger(__FILE__, 76, __PRETTY_FUNCTION__).warning("QDateTimeParser::getDigit() Internal error (%s %d)",-
8 QString(t.toString()).toLocal8Bit().constData(), index);-
9-
10-
11-
12 return
never executed: return -1;
-1;
never executed: return -1;
0
13 }-
14 const SectionNode &node = sectionNodes.at(index);-
15 switch (node.type) {-
16 case
executed 419 times by 1 test: case Hour24Section:
Executed by:
  • tst_QDateTimeEdit
Hour24Section:
executed 419 times by 1 test: case Hour24Section:
Executed by:
  • tst_QDateTimeEdit
case
executed 305 times by 2 tests: case Hour12Section:
Executed by:
  • tst_QDateTimeEdit
  • tst_QItemDelegate
Hour12Section:
executed 305 times by 2 tests: case Hour12Section:
Executed by:
  • tst_QDateTimeEdit
  • tst_QItemDelegate
return
executed 724 times by 2 tests: return t.time().hour();
Executed by:
  • tst_QDateTimeEdit
  • tst_QItemDelegate
t.time().hour();
executed 724 times by 2 tests: return t.time().hour();
Executed by:
  • tst_QDateTimeEdit
  • tst_QItemDelegate
305-724
17 case
executed 316 times by 1 test: case MinuteSection:
Executed by:
  • tst_QDateTimeEdit
MinuteSection:
executed 316 times by 1 test: case MinuteSection:
Executed by:
  • tst_QDateTimeEdit
return
executed 316 times by 1 test: return t.time().minute();
Executed by:
  • tst_QDateTimeEdit
t.time().minute();
executed 316 times by 1 test: return t.time().minute();
Executed by:
  • tst_QDateTimeEdit
316
18 case
executed 299 times by 1 test: case SecondSection:
Executed by:
  • tst_QDateTimeEdit
SecondSection:
executed 299 times by 1 test: case SecondSection:
Executed by:
  • tst_QDateTimeEdit
return
executed 299 times by 1 test: return t.time().second();
Executed by:
  • tst_QDateTimeEdit
t.time().second();
executed 299 times by 1 test: return t.time().second();
Executed by:
  • tst_QDateTimeEdit
299
19 case
never executed: case MSecSection:
MSecSection:
never executed: case MSecSection:
return
never executed: return t.time().msec();
t.time().msec();
never executed: return t.time().msec();
0
20 case
executed 566 times by 2 tests: case YearSection2Digits:
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
YearSection2Digits:
executed 566 times by 2 tests: case YearSection2Digits:
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
566
21 case
executed 183 times by 1 test: case YearSection:
Executed by:
  • tst_QDateTimeEdit
YearSection:
executed 183 times by 1 test: case YearSection:
Executed by:
  • tst_QDateTimeEdit
return
executed 749 times by 2 tests: return t.date().year();
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
t.date().year();
executed 749 times by 2 tests: return t.date().year();
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
183-749
22 case
executed 159 times by 4 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
MonthSection:
executed 159 times by 4 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
return
executed 159 times by 4 tests: return t.date().month();
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
t.date().month();
executed 159 times by 4 tests: return t.date().month();
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
159
23 case
executed 131 times by 1 test: case DaySection:
Executed by:
  • tst_QDateTimeEdit
DaySection:
executed 131 times by 1 test: case DaySection:
Executed by:
  • tst_QDateTimeEdit
return
executed 131 times by 1 test: return t.date().day();
Executed by:
  • tst_QDateTimeEdit
t.date().day();
executed 131 times by 1 test: return t.date().day();
Executed by:
  • tst_QDateTimeEdit
131
24 case
executed 90 times by 1 test: case DayOfWeekSectionShort:
Executed by:
  • tst_QDateTimeEdit
DayOfWeekSectionShort:
executed 90 times by 1 test: case DayOfWeekSectionShort:
Executed by:
  • tst_QDateTimeEdit
90
25 case
executed 1013 times by 1 test: case DayOfWeekSectionLong:
Executed by:
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 1013 times by 1 test: case DayOfWeekSectionLong:
Executed by:
  • tst_QDateTimeEdit
return
executed 1103 times by 1 test: return t.date().day();
Executed by:
  • tst_QDateTimeEdit
t.date().day();
executed 1103 times by 1 test: return t.date().day();
Executed by:
  • tst_QDateTimeEdit
1013-1103
26 case
executed 6 times by 1 test: case AmPmSection:
Executed by:
  • tst_QDateTimeEdit
AmPmSection:
executed 6 times by 1 test: case AmPmSection:
Executed by:
  • tst_QDateTimeEdit
return
executed 6 times by 1 test: return t.time().hour() > 11 ? 1 : 0;
Executed by:
  • tst_QDateTimeEdit
t.time().hour() > 11 ? 1 : 0;
executed 6 times by 1 test: return t.time().hour() > 11 ? 1 : 0;
Executed by:
  • tst_QDateTimeEdit
6
27-
28 default
never executed: default:
:
never executed: default:
break;
never executed: break;
0
29 }-
30-
31-
32 QMessageLogger(__FILE__, 101, __PRETTY_FUNCTION__).warning("QDateTimeParser::getDigit() Internal error 2 (%s %d)",-
33 QString(t.toString()).toLocal8Bit().constData(), index);-
34-
35-
36-
37 return
never executed: return -1;
-1;
never executed: return -1;
0
38}-
39bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const-
40{-
41 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEevaluated 4310 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
|| index >= sectionNodes.size()
index >= sectionNodes.size()Description
TRUEnever evaluated
FALSEevaluated 4310 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
) {
0-4310
42-
43 QMessageLogger(__FILE__, 125, __PRETTY_FUNCTION__).warning("QDateTimeParser::setDigit() Internal error (%s %d %d)",-
44 QString(v.toString()).toLocal8Bit().constData(), index, newVal);-
45-
46-
47-
48 return
never executed: return false;
false;
never executed: return false;
0
49 }-
50 const SectionNode &node = sectionNodes.at(index);-
51-
52 const QDate date = v.date();-
53 const QTime time = v.time();-
54 int year = date.year();-
55 int month = date.month();-
56 int day = date.day();-
57 int hour = time.hour();-
58 int minute = time.minute();-
59 int second = time.second();-
60 int msec = time.msec();-
61-
62 switch (node.type) {-
63 case
executed 478 times by 2 tests: case Hour24Section:
Executed by:
  • tst_QDateTimeEdit
  • tst_QTime
Hour24Section:
executed 478 times by 2 tests: case Hour24Section:
Executed by:
  • tst_QDateTimeEdit
  • tst_QTime
case
executed 378 times by 2 tests: case Hour12Section:
Executed by:
  • tst_QDateTimeEdit
  • tst_QItemDelegate
Hour12Section:
executed 378 times by 2 tests: case Hour12Section:
Executed by:
  • tst_QDateTimeEdit
  • tst_QItemDelegate
hour = newVal; break;
executed 856 times by 3 tests: break;
Executed by:
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
378-856
64 case
executed 470 times by 1 test: case MinuteSection:
Executed by:
  • tst_QDateTimeEdit
MinuteSection:
executed 470 times by 1 test: case MinuteSection:
Executed by:
  • tst_QDateTimeEdit
minute = newVal; break;
executed 470 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
470
65 case
executed 434 times by 1 test: case SecondSection:
Executed by:
  • tst_QDateTimeEdit
SecondSection:
executed 434 times by 1 test: case SecondSection:
Executed by:
  • tst_QDateTimeEdit
second = newVal; break;
executed 434 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
434
66 case
executed 36 times by 1 test: case MSecSection:
Executed by:
  • tst_QDateTimeEdit
MSecSection:
executed 36 times by 1 test: case MSecSection:
Executed by:
  • tst_QDateTimeEdit
msec = newVal; break;
executed 36 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
36
67 case
executed 565 times by 2 tests: case YearSection2Digits:
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
YearSection2Digits:
executed 565 times by 2 tests: case YearSection2Digits:
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
565
68 case
executed 154 times by 1 test: case YearSection:
Executed by:
  • tst_QDateTimeEdit
YearSection:
executed 154 times by 1 test: case YearSection:
Executed by:
  • tst_QDateTimeEdit
year = newVal; break;
executed 719 times by 2 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
154-719
69 case
executed 241 times by 4 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
MonthSection:
executed 241 times by 4 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
month = newVal; break;
executed 241 times by 4 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
241
70 case
executed 445 times by 2 tests: case DaySection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
DaySection:
executed 445 times by 2 tests: case DaySection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
445
71 case
executed 90 times by 1 test: case DayOfWeekSectionShort:
Executed by:
  • tst_QDateTimeEdit
DayOfWeekSectionShort:
executed 90 times by 1 test: case DayOfWeekSectionShort:
Executed by:
  • tst_QDateTimeEdit
90
72 case
executed 1013 times by 1 test: case DayOfWeekSectionLong:
Executed by:
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 1013 times by 1 test: case DayOfWeekSectionLong:
Executed by:
  • tst_QDateTimeEdit
1013
73 if (newVal > 31
newVal > 31Description
TRUEnever evaluated
FALSEevaluated 1548 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
0-1548
74-
75-
76-
77 return
never executed: return false;
false;
never executed: return false;
0
78 }-
79 day = newVal;-
80 break;
executed 1548 times by 2 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
1548
81 case
executed 6 times by 1 test: case AmPmSection:
Executed by:
  • tst_QDateTimeEdit
AmPmSection:
executed 6 times by 1 test: case AmPmSection:
Executed by:
  • tst_QDateTimeEdit
hour = (newVal == 0
newVal == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
? hour % 12 : (hour % 12) + 12); break;
executed 6 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
2-6
82 default
never executed: default:
:
never executed: default:
0
83 QMessageLogger(__FILE__, 165, __PRETTY_FUNCTION__).warning("QDateTimeParser::setDigit() Internal error (%s)",-
84 QString(node.name()).toLocal8Bit().constData());-
85 break;
never executed: break;
0
86 }-
87-
88 if (!(node.type & DaySectionMask)
!(node.type & DaySectionMask)Description
TRUEevaluated 2762 times by 6 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 1548 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
1548-2762
89 if (day < cachedDay
day < cachedDayDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 2741 times by 6 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
)
21-2741
90 day = cachedDay;
executed 21 times by 1 test: day = cachedDay;
Executed by:
  • tst_QDateTimeEdit
21
91 const int max = QDate(year, month, 1).daysInMonth();-
92 if (day > max
day > maxDescription
TRUEevaluated 76 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
FALSEevaluated 2686 times by 6 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
) {
76-2686
93 day = max;-
94 }
executed 76 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
76
95 }
executed 2762 times by 6 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
2762
96 if (QDate::isValid(year, month, day)
QDate::isValid...r, month, day)Description
TRUEevaluated 4271 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 39 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
&& QTime::isValid(hour, minute, second, msec)
QTime::isValid... second, msec)Description
TRUEevaluated 4271 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEnever evaluated
) {
0-4271
97 v = QDateTime(QDate(year, month, day), QTime(hour, minute, second, msec), spec);-
98 return
executed 4271 times by 7 tests: return true;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
true;
executed 4271 times by 7 tests: return true;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
4271
99 }-
100 return
executed 39 times by 2 tests: return false;
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
false;
executed 39 times by 2 tests: return false;
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
39
101}-
102int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const-
103{-
104 const SectionNode &sn = sectionNode(s);-
105 switch (sn.type) {-
106 case
executed 1665 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1665 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1665
107 case
executed 1157 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
Hour12Section:
executed 1157 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
return
executed 2822 times by 8 tests: return 23;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
23;
executed 2822 times by 8 tests: return 23;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1157-2822
108-
109-
110 case
executed 2268 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
MinuteSection:
executed 2268 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
2268
111 case
executed 2062 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 2062 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
return
executed 4330 times by 8 tests: return 59;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
59;
executed 4330 times by 8 tests: return 59;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
2062-4330
112 case
executed 237 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
MSecSection:
executed 237 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
return
executed 237 times by 2 tests: return 999;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
999;
executed 237 times by 2 tests: return 999;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
237
113 case
executed 1439 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
YearSection2Digits:
executed 1439 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
1439
114 case
executed 2034 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 2034 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
return
executed 3473 times by 10 tests: return 9999;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
9999;
executed 3473 times by 10 tests: return 9999;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
2034-3473
115-
116-
117-
118 case
executed 1928 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
MonthSection:
executed 1928 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
return
executed 1928 times by 7 tests: return 12;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
12;
executed 1928 times by 7 tests: return 12;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
1928
119 case
executed 2979 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
DaySection:
executed 2979 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
2979
120 case
executed 90 times by 1 test: case DayOfWeekSectionShort:
Executed by:
  • tst_QDateTimeEdit
DayOfWeekSectionShort:
executed 90 times by 1 test: case DayOfWeekSectionShort:
Executed by:
  • tst_QDateTimeEdit
90
121 case
executed 1013 times by 1 test: case DayOfWeekSectionLong:
Executed by:
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 1013 times by 1 test: case DayOfWeekSectionLong:
Executed by:
  • tst_QDateTimeEdit
return
executed 4082 times by 10 tests: return cur.isValid() ? cur.date().daysInMonth() : 31;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
cur.isValid() ? cur.date().daysInMonth() : 31;
executed 4082 times by 10 tests: return cur.isValid() ? cur.date().daysInMonth() : 31;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
1013-4082
122 case
executed 6 times by 1 test: case AmPmSection:
Executed by:
  • tst_QDateTimeEdit
AmPmSection:
executed 6 times by 1 test: case AmPmSection:
Executed by:
  • tst_QDateTimeEdit
return
executed 6 times by 1 test: return 1;
Executed by:
  • tst_QDateTimeEdit
1;
executed 6 times by 1 test: return 1;
Executed by:
  • tst_QDateTimeEdit
6
123 default
never executed: default:
:
never executed: default:
break;
never executed: break;
0
124 }-
125 QMessageLogger(__FILE__, 216, __PRETTY_FUNCTION__).warning("QDateTimeParser::absoluteMax() Internal error (%s)",-
126 QString(sn.name()).toLocal8Bit().constData());-
127 return
never executed: return -1;
-1;
never executed: return -1;
0
128}-
129-
130-
131-
132-
133-
134-
135-
136int QDateTimeParser::absoluteMin(int s) const-
137{-
138 const SectionNode &sn = sectionNode(s);-
139 switch (sn.type) {-
140 case
executed 1665 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1665 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1665
141 case
executed 1157 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
Hour12Section:
executed 1157 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
1157
142 case
executed 2257 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
MinuteSection:
executed 2257 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
2257
143 case
executed 2050 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 2050 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
2050
144 case
executed 237 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
MSecSection:
executed 237 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
237
145 case
executed 1436 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
YearSection2Digits:
executed 1436 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
1436
146 case
executed 2034 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 2034 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
return
executed 10836 times by 11 tests: return 0;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
0;
executed 10836 times by 11 tests: return 0;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
2034-10836
147 case
executed 1916 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
MonthSection:
executed 1916 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
1916
148 case
executed 2955 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
DaySection:
executed 2955 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
2955
149 case
executed 90 times by 1 test: case DayOfWeekSectionShort:
Executed by:
  • tst_QDateTimeEdit
DayOfWeekSectionShort:
executed 90 times by 1 test: case DayOfWeekSectionShort:
Executed by:
  • tst_QDateTimeEdit
90
150 case
executed 1013 times by 1 test: case DayOfWeekSectionLong:
Executed by:
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 1013 times by 1 test: case DayOfWeekSectionLong:
Executed by:
  • tst_QDateTimeEdit
return
executed 5974 times by 10 tests: return 1;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
1;
executed 5974 times by 10 tests: return 1;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
1013-5974
151 case
executed 6 times by 1 test: case AmPmSection:
Executed by:
  • tst_QDateTimeEdit
AmPmSection:
executed 6 times by 1 test: case AmPmSection:
Executed by:
  • tst_QDateTimeEdit
return
executed 6 times by 1 test: return 0;
Executed by:
  • tst_QDateTimeEdit
0;
executed 6 times by 1 test: return 0;
Executed by:
  • tst_QDateTimeEdit
6
152 default
never executed: default:
:
never executed: default:
break;
never executed: break;
0
153 }-
154 QMessageLogger(__FILE__, 245, __PRETTY_FUNCTION__).warning("QDateTimeParser::absoluteMin() Internal error (%s, %0x)",-
155 QString(sn.name()).toLocal8Bit().constData(), sn.type);-
156 return
never executed: return -1;
-1;
never executed: return -1;
0
157}-
158-
159-
160-
161-
162-
163-
164-
165const QDateTimeParser::SectionNode &QDateTimeParser::sectionNode(int sectionIndex) const-
166{-
167 if (sectionIndex < 0
sectionIndex < 0Description
TRUEevaluated 709 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
FALSEevaluated 148184 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
709-148184
168 switch (sectionIndex) {-
169 case
executed 229 times by 4 tests: case FirstSectionIndex:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
FirstSectionIndex:
executed 229 times by 4 tests: case FirstSectionIndex:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
229
170 return
executed 229 times by 4 tests: return first;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
first;
executed 229 times by 4 tests: return first;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
229
171 case
executed 7 times by 1 test: case LastSectionIndex:
Executed by:
  • tst_QDateTimeEdit
LastSectionIndex:
executed 7 times by 1 test: case LastSectionIndex:
Executed by:
  • tst_QDateTimeEdit
7
172 return
executed 7 times by 1 test: return last;
Executed by:
  • tst_QDateTimeEdit
last;
executed 7 times by 1 test: return last;
Executed by:
  • tst_QDateTimeEdit
7
173 case
executed 473 times by 7 tests: case NoSectionIndex:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
NoSectionIndex:
executed 473 times by 7 tests: case NoSectionIndex:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
473
174 return
executed 473 times by 7 tests: return none;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
none;
executed 473 times by 7 tests: return none;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
473
175 }-
176 }
never executed: end of block
else if (sectionIndex < sectionNodes.size()
sectionIndex <...onNodes.size()Description
TRUEevaluated 148184 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEnever evaluated
) {
0-148184
177 return
executed 148184 times by 11 tests: return sectionNodes.at(sectionIndex);
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
sectionNodes.at(sectionIndex);
executed 148184 times by 11 tests: return sectionNodes.at(sectionIndex);
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
148184
178 }-
179-
180 QMessageLogger(__FILE__, 271, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionNode() Internal error (%d)",-
181 sectionIndex);-
182 return
never executed: return none;
none;
never executed: return none;
0
183}-
184-
185QDateTimeParser::Section QDateTimeParser::sectionType(int sectionIndex) const-
186{-
187 return
executed 6740 times by 10 tests: return sectionNode(sectionIndex).type;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
sectionNode(sectionIndex).type;
executed 6740 times by 10 tests: return sectionNode(sectionIndex).type;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
6740
188}-
189int QDateTimeParser::sectionPos(int sectionIndex) const-
190{-
191 return
executed 49357 times by 4 tests: return sectionPos(sectionNode(sectionIndex));
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
sectionPos(sectionNode(sectionIndex));
executed 49357 times by 4 tests: return sectionPos(sectionNode(sectionIndex));
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
49357
192}-
193-
194int QDateTimeParser::sectionPos(const SectionNode &sn) const-
195{-
196 switch (sn.type) {-
197 case
executed 117 times by 4 tests: case FirstSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
FirstSection:
executed 117 times by 4 tests: case FirstSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
return
executed 117 times by 4 tests: return 0;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
0;
executed 117 times by 4 tests: return 0;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
117
198 case
never executed: case LastSection:
LastSection:
never executed: case LastSection:
return
never executed: return displayText().size() - 1;
displayText().size() - 1;
never executed: return displayText().size() - 1;
0
199 default
executed 51900 times by 4 tests: default:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
:
executed 51900 times by 4 tests: default:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
break;
executed 51900 times by 4 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
51900
200 }-
201 if (sn.pos == -1
sn.pos == -1Description
TRUEnever evaluated
FALSEevaluated 51900 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
0-51900
202 QMessageLogger(__FILE__, 301, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionPos Internal error (%s)", QString(sn.name()).toLocal8Bit().constData());-
203 return
never executed: return -1;
-1;
never executed: return -1;
0
204 }-
205 return
executed 51900 times by 4 tests: return sn.pos;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
sn.pos;
executed 51900 times by 4 tests: return sn.pos;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
51900
206}-
207static QString unquote(const QStringRef &str)-
208{-
209 const QChar quote(QLatin1Char('\''));-
210 const QChar slash(QLatin1Char('\\'));-
211 const QChar zero(QLatin1Char('0'));-
212 QString ret;-
213 QChar status(zero);-
214 const int max = str.size();-
215 for (int i=0; i<max
i<maxDescription
TRUEevaluated 476 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 991 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
; ++i) {
476-991
216 if (str.at(i) == quote
str.at(i) == quoteDescription
TRUEevaluated 21 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEevaluated 455 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
) {
21-455
217 if (status != quote
status != quoteDescription
TRUEevaluated 11 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
) {
10-11
218 status = quote;-
219 }
executed 11 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
else if (!ret.isEmpty()
!ret.isEmpty()Description
TRUEevaluated 9 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTime
&& str.at(i - 1) == slash
str.at(i - 1) == slashDescription
TRUEnever evaluated
FALSEevaluated 9 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
) {
0-11
220 ret[ret.size() - 1] = quote;-
221 }
never executed: end of block
else {
0
222 status = zero;-
223 }
executed 10 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
10
224 } else {-
225 ret += str.at(i);-
226 }
executed 455 times by 5 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
455
227 }-
228 return
executed 991 times by 10 tests: return ret;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
ret;
executed 991 times by 10 tests: return ret;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
991
229}-
230static inline int countRepeat(const QString &str, int index, int maxCount)-
231{-
232 int count = 1;-
233 const QChar ch(str.at(index));-
234 const int max = qMin(index + maxCount, str.size());-
235 while (index + count < max
index + count < maxDescription
TRUEevaluated 7926 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 1950 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
&& str.at(index + count) == ch
str.at(index + count) == chDescription
TRUEevaluated 5978 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 1948 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
1948-7926
236 ++count;-
237 }
executed 5978 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
5978
238 return
executed 3898 times by 11 tests: return count;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
count;
executed 3898 times by 11 tests: return count;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
3898
239}-
240-
241static inline void appendSeparator(QStringList *list, const QString &string, int from, int size, int lastQuote)-
242{-
243 const QStringRef separator = string.midRef(from, size);-
244 list->append(lastQuote >= from ? unquote(separator) : separator.toString());-
245}
executed 3025 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
3025
246-
247-
248bool QDateTimeParser::parseFormat(const QString &newFormat)-
249{-
250 const QLatin1Char quote('\'');-
251 const QLatin1Char slash('\\');-
252 const QLatin1Char zero('0');-
253 if (newFormat == displayFormat
newFormat == displayFormatDescription
TRUEevaluated 175 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
FALSEevaluated 1149 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
&& !newFormat.isEmpty()
!newFormat.isEmpty()Description
TRUEevaluated 173 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDate
) {
2-1149
254 return
executed 173 times by 1 test: return true;
Executed by:
  • tst_QDateTimeEdit
true;
executed 173 times by 1 test: return true;
Executed by:
  • tst_QDateTimeEdit
173
255 }-
256-
257 if (false) QMessageLogger(__FILE__, 374, __PRETTY_FUNCTION__).debug("parseFormat: %s", newFormat.toLatin1().constData());
dead code: QMessageLogger(__FILE__, 374, __PRETTY_FUNCTION__).debug("parseFormat: %s", newFormat.toLatin1().constData());
-
258-
259 QVector<SectionNode> newSectionNodes;-
260 Sections newDisplay = 0;-
261 QStringList newSeparators;-
262 int i, index = 0;-
263 int add = 0;-
264 QChar status(zero);-
265 const int max = newFormat.size();-
266 int lastQuote = -1;-
267 for (i = 0; i<max
i<maxDescription
TRUEevaluated 7177 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 1151 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
; ++i) {
1151-7177
268 if (newFormat.at(i) == quote
newFormat.at(i) == quoteDescription
TRUEevaluated 21 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEevaluated 7156 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
21-7156
269 lastQuote = i;-
270 ++add;-
271 if (status != quote
status != quoteDescription
TRUEevaluated 11 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
) {
10-11
272 status = quote;-
273 }
executed 11 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
else if (i > 0
i > 0Description
TRUEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEnever evaluated
&& newFormat.at(i - 1) != slash
newFormat.at(i - 1) != slashDescription
TRUEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEnever evaluated
) {
0-11
274 status = zero;-
275 }
executed 10 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
10
276 }
executed 21 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
else if (status != quote
status != quoteDescription
TRUEevaluated 7117 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 39 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
) {
21-7117
277 const char sect = newFormat.at(i).toLatin1();-
278 switch (sect) {-
279 case
executed 81 times by 4 tests: case 'H':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QTime
'H':
executed 81 times by 4 tests: case 'H':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QTime
81
280 case
executed 319 times by 8 tests: case 'h':
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QTime
'h':
executed 319 times by 8 tests: case 'h':
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QTime
319
281 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 397 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
) {
3-397
282 const Section hour = (
(sect == 'h')Description
TRUEevaluated 316 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 81 times by 4 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QTime
sect == 'h')
(sect == 'h')Description
TRUEevaluated 316 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 81 times by 4 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QTime
? Hour12Section : Hour24Section;
81-316
283 const SectionNode sn = { hour, i - add, countRepeat(newFormat, i, 2), 0 };-
284 newSectionNodes.append(sn);-
285 appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);-
286 i += sn.count - 1;-
287 index = i + 1;-
288 newDisplay |= hour;-
289 }
executed 397 times by 8 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
397
290 break;
executed 400 times by 9 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
400
291 case
executed 379 times by 8 tests: case 'm':
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
'm':
executed 379 times by 8 tests: case 'm':
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
379
292 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 379 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
FALSEnever evaluated
) {
0-379
293 const SectionNode sn = { MinuteSection, i - add, countRepeat(newFormat, i, 2), 0 };-
294 newSectionNodes.append(sn);-
295 appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);-
296 i += sn.count - 1;-
297 index = i + 1;-
298 newDisplay |= MinuteSection;-
299 }
executed 379 times by 8 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
379
300 break;
executed 379 times by 8 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
379
301 case
executed 236 times by 4 tests: case 's':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
's':
executed 236 times by 4 tests: case 's':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
236
302 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 236 times by 4 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
FALSEnever evaluated
) {
0-236
303 const SectionNode sn = { SecondSection, i - add, countRepeat(newFormat, i, 2), 0 };-
304 newSectionNodes.append(sn);-
305 appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);-
306 i += sn.count - 1;-
307 index = i + 1;-
308 newDisplay |= SecondSection;-
309 }
executed 236 times by 4 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
236
310 break;
executed 236 times by 4 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
236
311-
312 case
executed 47 times by 2 tests: case 'z':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
'z':
executed 47 times by 2 tests: case 'z':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
47
313 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 47 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-47
314 const SectionNode sn = { MSecSection, i - add, countRepeat(newFormat, i, 3) < 3 ? 1 : 3, 0 };-
315 newSectionNodes.append(sn);-
316 appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);-
317 i += sn.count - 1;-
318 index = i + 1;-
319 newDisplay |= MSecSection;-
320 }
executed 47 times by 2 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
47
321 break;
executed 47 times by 2 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
47
322 case
executed 16 times by 5 tests: case 'A':
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
'A':
executed 16 times by 5 tests: case 'A':
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
16
323 case
executed 79 times by 4 tests: case 'a':
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
'a':
executed 79 times by 4 tests: case 'a':
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
79
324 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 93 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDate
) {
2-93
325 const bool cap = (sect == 'A');-
326 const SectionNode sn = { AmPmSection, i - add, (cap ? 1 : 0), 0 };-
327 newSectionNodes.append(sn);-
328 appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);-
329 newDisplay |= AmPmSection;-
330 if (i + 1 < newFormat.size()
i + 1 < newFormat.size()Description
TRUEevaluated 92 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
1-92
331 && newFormat.at(i+1) == (cap
capDescription
TRUEevaluated 16 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 76 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
? QLatin1Char('P') : QLatin1Char('p'))
newFormat.at(i...tin1Char('p'))Description
TRUEevaluated 92 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEnever evaluated
) {
0-92
332 ++i;-
333 }
executed 92 times by 5 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
92
334 index = i + 1;-
335 }
executed 93 times by 5 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
93
336 break;
executed 95 times by 6 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
95
337 case
executed 863 times by 10 tests: case 'y':
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
'y':
executed 863 times by 10 tests: case 'y':
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
863
338 if (parserType != QVariant::Time
parserType != QVariant::TimeDescription
TRUEevaluated 859 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
4-859
339 const int repeat = countRepeat(newFormat, i, 4);-
340 if (repeat >= 2
repeat >= 2Description
TRUEevaluated 858 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
1-858
341 const SectionNode sn = { repeat == 4 ? YearSection : YearSection2Digits,-
342 i - add, repeat == 4 ? 4 : 2, 0 };-
343 newSectionNodes.append(sn);-
344 appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);-
345 i += sn.count - 1;-
346 index = i + 1;-
347 newDisplay |= sn.type;-
348 }
executed 858 times by 10 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
858
349 }
executed 859 times by 10 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
859
350 break;
executed 863 times by 10 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
863
351 case
executed 981 times by 10 tests: case 'M':
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
'M':
executed 981 times by 10 tests: case 'M':
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
981
352 if (parserType != QVariant::Time
parserType != QVariant::TimeDescription
TRUEevaluated 981 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
FALSEnever evaluated
) {
0-981
353 const SectionNode sn = { MonthSection, i - add, countRepeat(newFormat, i, 4), 0 };-
354 newSectionNodes.append(sn);-
355 newSeparators.append(unquote(newFormat.midRef(index, i - index)));-
356 i += sn.count - 1;-
357 index = i + 1;-
358 newDisplay |= MonthSection;-
359 }
executed 981 times by 10 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
981
360 break;
executed 981 times by 10 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
981
361 case
executed 999 times by 10 tests: case 'd':
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
'd':
executed 999 times by 10 tests: case 'd':
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
999
362 if (parserType != QVariant::Time
parserType != QVariant::TimeDescription
TRUEevaluated 999 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
FALSEnever evaluated
) {
0-999
363 const int repeat = countRepeat(newFormat, i, 4);-
364 const Section sectionType = (repeat == 4
repeat == 4Description
TRUEevaluated 31 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 968 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
? DayOfWeekSectionLong
31-968
365 : (repeat == 3
repeat == 3Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 962 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
? DayOfWeekSectionShort : DaySection));
6-962
366 const SectionNode sn = { sectionType, i - add, repeat, 0 };-
367 newSectionNodes.append(sn);-
368 appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);-
369 i += sn.count - 1;-
370 index = i + 1;-
371 newDisplay |= sn.type;-
372 }
executed 999 times by 10 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
999
373 break;
executed 999 times by 10 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
999
374-
375 default
executed 3117 times by 10 tests: default:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
:
executed 3117 times by 10 tests: default:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
3117
376 break;
executed 3117 times by 10 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
3117
377 }-
378 }-
379 }
executed 7177 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
7177
380 if (newSectionNodes.isEmpty()
newSectionNodes.isEmpty()Description
TRUEevaluated 11 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 1140 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
&& context == DateTimeEdit
context == DateTimeEditDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
) {
2-1140
381 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_QDateTimeEdit
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_QDateTimeEdit
2
382 }-
383-
384 if ((
(newDisplay & ... Hour12SectionDescription
TRUEevaluated 218 times by 5 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 931 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
  • tst_QTime
newDisplay & (AmPmSection|Hour12Section)) == Hour12Section
(newDisplay & ... Hour12SectionDescription
TRUEevaluated 218 times by 5 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 931 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
  • tst_QTime
) {
218-931
385 const int count = newSectionNodes.size();-
386 for (int i = 0; i < count
i < countDescription
TRUEevaluated 878 times by 5 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 218 times by 5 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
; ++i) {
218-878
387 SectionNode &node = newSectionNodes[i];-
388 if (node.type == Hour12Section
node.type == Hour12SectionDescription
TRUEevaluated 229 times by 5 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 649 times by 5 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
)
229-649
389 node.type = Hour24Section;
executed 229 times by 5 tests: node.type = Hour24Section;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
229
390 }
executed 878 times by 5 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
878
391 }
executed 218 times by 5 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkRequest
  • tst_QTime
218
392-
393 if (index < max
index < maxDescription
TRUEevaluated 16 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEevaluated 1133 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
  • tst_QTime
) {
16-1133
394 appendSeparator(&newSeparators, newFormat, index, index - max, lastQuote);-
395 }
executed 16 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
else {
16
396 newSeparators.append(QString());-
397 }
executed 1133 times by 10 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
  • tst_QTime
1133
398-
399 displayFormat = newFormat;-
400 separators = newSeparators;-
401 sectionNodes = newSectionNodes;-
402 display = newDisplay;-
403 last.pos = -1;-
404-
405-
406-
407-
408-
409 if (false) QMessageLogger(__FILE__, 526, __PRETTY_FUNCTION__).debug() << newFormat << displayFormat;
dead code: QMessageLogger(__FILE__, 526, __PRETTY_FUNCTION__).debug() << newFormat << displayFormat;
-
410 if (false) QMessageLogger(__FILE__, 527, __PRETTY_FUNCTION__).debug("separators:\n'%s'", separators.join(QLatin1String("\n")).toLatin1().constData());
dead code: QMessageLogger(__FILE__, 527, __PRETTY_FUNCTION__).debug("separators:\n'%s'", separators.join(QLatin1String("\n")).toLatin1().constData());
-
411-
412 return
executed 1149 times by 11 tests: return true;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
true;
executed 1149 times by 11 tests: return true;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
1149
413}-
414-
415-
416-
417-
418-
419-
420-
421int QDateTimeParser::sectionSize(int sectionIndex) const-
422{-
423 if (sectionIndex < 0
sectionIndex < 0Description
TRUEnever evaluated
FALSEevaluated 18759 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
)
0-18759
424 return
never executed: return 0;
0;
never executed: return 0;
0
425-
426 if (sectionIndex >= sectionNodes.size()
sectionIndex >...onNodes.size()Description
TRUEnever evaluated
FALSEevaluated 18759 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
0-18759
427 QMessageLogger(__FILE__, 544, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionSize Internal error (%d)", sectionIndex);-
428 return
never executed: return -1;
-1;
never executed: return -1;
0
429 }-
430-
431 if (sectionIndex == sectionNodes.size() - 1
sectionIndex =...des.size() - 1Description
TRUEevaluated 4554 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 14205 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
4554-14205
432-
433-
434-
435-
436 int sizeAdjustment = 0;-
437 const int displayTextSize = displayText().size();-
438 if (displayTextSize != text.size()
displayTextSize != text.size()Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 4531 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
23-4531
439-
440 int preceedingZeroesAdded = 0;-
441 if (sectionNodes.size() > 1
sectionNodes.size() > 1Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
&& context == DateTimeEdit
context == DateTimeEditDescription
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-23
442 const auto begin = sectionNodes.cbegin();-
443 const auto end = begin + sectionIndex;-
444 for (auto sectionIt = begin; sectionIt != end
sectionIt != endDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++sectionIt)
23-40
445 preceedingZeroesAdded += sectionIt->zeroesAdded;
executed 40 times by 1 test: preceedingZeroesAdded += sectionIt->zeroesAdded;
Executed by:
  • tst_QDateTimeEdit
40
446 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
23
447 sizeAdjustment = preceedingZeroesAdded;-
448 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
23
449-
450 return
executed 4554 times by 1 test: return displayTextSize + sizeAdjustment - sectionPos(sectionIndex) - separators.last().size();
Executed by:
  • tst_QDateTimeEdit
displayTextSize + sizeAdjustment - sectionPos(sectionIndex) - separators.last().size();
executed 4554 times by 1 test: return displayTextSize + sizeAdjustment - sectionPos(sectionIndex) - separators.last().size();
Executed by:
  • tst_QDateTimeEdit
4554
451 } else {-
452 return
executed 14205 times by 4 tests: return sectionPos(sectionIndex + 1) - sectionPos(sectionIndex) - separators.at(sectionIndex + 1).size();
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
sectionPos(sectionIndex + 1) - sectionPos(sectionIndex)
executed 14205 times by 4 tests: return sectionPos(sectionIndex + 1) - sectionPos(sectionIndex) - separators.at(sectionIndex + 1).size();
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
14205
453 - separators.at(sectionIndex + 1).size();
executed 14205 times by 4 tests: return sectionPos(sectionIndex + 1) - sectionPos(sectionIndex) - separators.at(sectionIndex + 1).size();
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
14205
454 }-
455}-
456-
457-
458int QDateTimeParser::sectionMaxSize(Section s, int count) const-
459{-
460-
461 int mcount = 12;-
462-
463-
464 switch (s) {-
465 case
never executed: case FirstSection:
FirstSection:
never executed: case FirstSection:
0
466 case
never executed: case NoSection:
NoSection:
never executed: case NoSection:
0
467 case
never executed: case LastSection:
LastSection:
never executed: case LastSection:
return
never executed: return 0;
0;
never executed: return 0;
0
468-
469 case
executed 1726 times by 5 tests: case AmPmSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
AmPmSection:
executed 1726 times by 5 tests: case AmPmSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
{
1726
470 const int lowerMax = qMin(getAmPmText(AmText, LowerCase).size(),-
471 getAmPmText(PmText, LowerCase).size());-
472 const int upperMax = qMin(getAmPmText(AmText, UpperCase).size(),-
473 getAmPmText(PmText, UpperCase).size());-
474 return
executed 1726 times by 5 tests: return qMin(4, qMin(lowerMax, upperMax));
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
qMin(4, qMin(lowerMax, upperMax));
executed 1726 times by 5 tests: return qMin(4, qMin(lowerMax, upperMax));
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
1726
475 }-
476-
477 case
executed 1483 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1483 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1483
478 case
executed 943 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
Hour12Section:
executed 943 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
943
479 case
executed 2232 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
MinuteSection:
executed 2232 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
2232
480 case
executed 1931 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 1931 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
1931
481 case
executed 3222 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
DaySection:
executed 3222 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
return
executed 9811 times by 11 tests: return 2;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
2;
executed 9811 times by 11 tests: return 2;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
3222-9811
482 case
executed 40 times by 3 tests: case DayOfWeekSectionShort:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionShort:
executed 40 times by 3 tests: case DayOfWeekSectionShort:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
40
483 case
executed 424 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 424 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
424
484-
485-
486-
487 mcount = 7;-
488-
489-
490 case
executed 3676 times by 10 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
MonthSection:
executed 3676 times by 10 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
code before this statement executed 464 times by 3 tests: case MonthSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
464-3676
491-
492-
493-
494 if (count <= 2
count <= 2Description
TRUEevaluated 2211 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
FALSEevaluated 1929 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
)
1929-2211
495 return
executed 2211 times by 7 tests: return 2;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
2;
executed 2211 times by 7 tests: return 2;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
2211
496-
497 {-
498 int ret = 0;-
499 const QLocale l = locale();-
500 const QLocale::FormatType format = count == 4
count == 4Description
TRUEevaluated 619 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 1310 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
? QLocale::LongFormat : QLocale::ShortFormat;
619-1310
501 for (int i=1; i<=mcount
i<=mcountDescription
TRUEevaluated 20828 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 1929 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
; ++i) {
1929-20828
502 const QString str = (s == MonthSection
s == MonthSectionDescription
TRUEevaluated 17580 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 3248 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
3248-17580
503 ? l.monthName(i, format)-
504 : l.dayName(i, format));-
505 ret = qMax(str.size(), ret);-
506 }
executed 20828 times by 6 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
20828
507 return
executed 1929 times by 6 tests: return ret;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
ret;
executed 1929 times by 6 tests: return ret;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1929
508 }-
509-
510 case
executed 283 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
MSecSection:
executed 283 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
return
executed 283 times by 2 tests: return 3;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
3;
executed 283 times by 2 tests: return 3;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
283
511 case
executed 2161 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 2161 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
return
executed 2161 times by 6 tests: return 4;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
4;
executed 2161 times by 6 tests: return 4;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
2161
512 case
executed 907 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
YearSection2Digits:
executed 907 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
return
executed 907 times by 7 tests: return 2;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
2;
executed 907 times by 7 tests: return 2;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
907
513-
514 case
never executed: case CalendarPopupSection:
CalendarPopupSection:
never executed: case CalendarPopupSection:
0
515 case
never executed: case Internal:
Internal:
never executed: case Internal:
0
516 case
never executed: case TimeSectionMask:
TimeSectionMask:
never executed: case TimeSectionMask:
0
517 case
never executed: case DateSectionMask:
DateSectionMask:
never executed: case DateSectionMask:
0
518 case
never executed: case HourSectionMask:
HourSectionMask:
never executed: case HourSectionMask:
0
519 case
never executed: case YearSectionMask:
YearSectionMask:
never executed: case YearSectionMask:
0
520 case
never executed: case DayOfWeekSectionMask:
DayOfWeekSectionMask:
never executed: case DayOfWeekSectionMask:
0
521 case
never executed: case DaySectionMask:
DaySectionMask:
never executed: case DaySectionMask:
0
522 QMessageLogger(__FILE__, 639, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionMaxSize: Invalid section %s",-
523 SectionNode::name(s).toLatin1().constData());-
524-
525 case
never executed: case NoSectionIndex:
NoSectionIndex:
never executed: case NoSectionIndex:
code before this statement never executed: case NoSectionIndex:
0
526 case
never executed: case FirstSectionIndex:
FirstSectionIndex:
never executed: case FirstSectionIndex:
0
527 case
never executed: case LastSectionIndex:
LastSectionIndex:
never executed: case LastSectionIndex:
0
528 case
never executed: case CalendarPopupIndex:
CalendarPopupIndex:
never executed: case CalendarPopupIndex:
0
529-
530 break;
never executed: break;
0
531 }-
532 return
never executed: return -1;
-1;
never executed: return -1;
0
533}-
534-
535-
536int QDateTimeParser::sectionMaxSize(int index) const-
537{-
538 const SectionNode &sn = sectionNode(index);-
539 return
executed 19028 times by 11 tests: return sectionMaxSize(sn.type, sn.count);
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
sectionMaxSize(sn.type, sn.count);
executed 19028 times by 11 tests: return sectionMaxSize(sn.type, sn.count);
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
19028
540}-
541QString QDateTimeParser::sectionText(const QString &text, int sectionIndex, int index) const-
542{-
543 const SectionNode &sn = sectionNode(sectionIndex);-
544 switch (sn.type) {-
545 case
never executed: case NoSectionIndex:
NoSectionIndex:
never executed: case NoSectionIndex:
0
546 case
never executed: case FirstSectionIndex:
FirstSectionIndex:
never executed: case FirstSectionIndex:
0
547 case
never executed: case LastSectionIndex:
LastSectionIndex:
never executed: case LastSectionIndex:
0
548 return
never executed: return QString();
QString();
never executed: return QString();
0
549 default
executed 175 times by 1 test: default:
Executed by:
  • tst_QDateTimeEdit
:
executed 175 times by 1 test: default:
Executed by:
  • tst_QDateTimeEdit
break;
executed 175 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
175
550 }-
551-
552 return
executed 175 times by 1 test: return text.mid(index, sectionSize(sectionIndex));
Executed by:
  • tst_QDateTimeEdit
text.mid(index, sectionSize(sectionIndex));
executed 175 times by 1 test: return text.mid(index, sectionSize(sectionIndex));
Executed by:
  • tst_QDateTimeEdit
175
553}-
554-
555QString QDateTimeParser::sectionText(int sectionIndex) const-
556{-
557 const SectionNode &sn = sectionNode(sectionIndex);-
558 return
executed 46 times by 1 test: return sectionText(displayText(), sectionIndex, sn.pos);
Executed by:
  • tst_QDateTimeEdit
sectionText(displayText(), sectionIndex, sn.pos);
executed 46 times by 1 test: return sectionText(displayText(), sectionIndex, sn.pos);
Executed by:
  • tst_QDateTimeEdit
46
559}-
560int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,-
561 QString &text, int &cursorPosition, int index,-
562 State &state, int *usedptr) const-
563{-
564 state = Invalid;-
565 int num = 0;-
566 const SectionNode &sn = sectionNode(sectionIndex);-
567 if ((
(sn.type & Int...l) == InternalDescription
TRUEnever evaluated
FALSEevaluated 15899 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
sn.type & Internal) == Internal
(sn.type & Int...l) == InternalDescription
TRUEnever evaluated
FALSEevaluated 15899 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
0-15899
568 QMessageLogger(__FILE__, 705, __PRETTY_FUNCTION__).warning("QDateTimeParser::parseSection Internal error (%s %d)",-
569 QString(sn.name()).toLocal8Bit().constData(), sectionIndex);-
570 return
never executed: return -1;
-1;
never executed: return -1;
0
571 }-
572-
573 const int sectionmaxsize = sectionMaxSize(sectionIndex);-
574 QStringRef sectionTextRef = text.midRef(index, sectionmaxsize);-
575 int sectiontextSize = sectionTextRef.size();-
576-
577 if (false) QMessageLogger(__FILE__, 714, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name()
dead code: QMessageLogger(__FILE__, 714, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectionTextRef << text.midRef(index, sectionmaxsize) << index;
-
578 << "with text" << text << "and st" << sectionTextRef
dead code: QMessageLogger(__FILE__, 714, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectionTextRef << text.midRef(index, sectionmaxsize) << index;
-
579 << text.midRef(index, sectionmaxsize)
dead code: QMessageLogger(__FILE__, 714, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectionTextRef << text.midRef(index, sectionmaxsize) << index;
-
580 << index;
dead code: QMessageLogger(__FILE__, 714, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectionTextRef << text.midRef(index, sectionmaxsize) << index;
-
581-
582 int used = 0;-
583 switch (sn.type) {-
584 case
executed 863 times by 5 tests: case AmPmSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
AmPmSection:
executed 863 times by 5 tests: case AmPmSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
{
863
585 QString sectiontext = sectionTextRef.toString();-
586 const int ampm = findAmPm(sectiontext, sectionIndex, &used);-
587 switch (ampm) {-
588 case
executed 758 times by 5 tests: case AM:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
AM:
executed 758 times by 5 tests: case AM:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
758
589 case
executed 103 times by 3 tests: case PM:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
PM:
executed 103 times by 3 tests: case PM:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
103
590 num = ampm;-
591 state = Acceptable;-
592 break;
executed 861 times by 5 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
861
593 case
never executed: case PossibleAM:
PossibleAM:
never executed: case PossibleAM:
0
594 case
never executed: case PossiblePM:
PossiblePM:
never executed: case PossiblePM:
0
595 num = ampm - 2;-
596 state = Intermediate;-
597 break;
never executed: break;
0
598 case
never executed: case PossibleBoth:
PossibleBoth:
never executed: case PossibleBoth:
0
599 num = 0;-
600 state = Intermediate;-
601 break;
never executed: break;
0
602 case
executed 2 times by 2 tests: case Neither:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
Neither:
executed 2 times by 2 tests: case Neither:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
2
603 state = Invalid;-
604 if (false) QMessageLogger(__FILE__, 741, __PRETTY_FUNCTION__).debug() << "invalid because findAmPm(" << sectiontext << ") returned -1";
dead code: QMessageLogger(__FILE__, 741, __PRETTY_FUNCTION__).debug() << "invalid because findAmPm(" << sectiontext << ") returned -1";
-
605 break;
executed 2 times by 2 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
2
606 default
never executed: default:
:
never executed: default:
0
607 if (false) QMessageLogger(__FILE__, 744, __PRETTY_FUNCTION__).debug("This should never happen (findAmPm returned %d)", ampm);
dead code: QMessageLogger(__FILE__, 744, __PRETTY_FUNCTION__).debug("This should never happen (findAmPm returned %d)", ampm);
-
608 break;
never executed: break;
0
609 }-
610 if (state != Invalid
state != InvalidDescription
TRUEevaluated 861 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
)
2-861
611 text.replace(index, used, sectiontext.constData(), used);
executed 861 times by 5 tests: text.replace(index, used, sectiontext.constData(), used);
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
861
612 break;
executed 863 times by 5 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
}
863
613 case
executed 3195 times by 10 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
MonthSection:
executed 3195 times by 10 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
3195
614 case
executed 40 times by 3 tests: case DayOfWeekSectionShort:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionShort:
executed 40 times by 3 tests: case DayOfWeekSectionShort:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
40
615 case
executed 424 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 424 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
424
616 if (sn.count >= 3
sn.count >= 3Description
TRUEevaluated 1926 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 1733 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
) {
1733-1926
617 QString sectiontext = sectionTextRef.toString();-
618 if (sn.type == MonthSection
sn.type == MonthSectionDescription
TRUEevaluated 1462 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 464 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
464-1462
619 int min = 1;-
620 const QDate minDate = getMinimum().date();-
621 if (currentValue.date().year() == minDate.year()
currentValue.d...minDate.year()Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 1445 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
) {
17-1445
622 min = minDate.month();-
623 }
executed 17 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
17
624 num = findMonth(sectiontext.toLower(), min, sectionIndex, &sectiontext, &used);-
625 }
executed 1462 times by 6 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
else {
1462
626 num = findDay(sectiontext.toLower(), 1, sectionIndex, &sectiontext, &used);-
627 }
executed 464 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
464
628-
629 if (num != -1
num != -1Description
TRUEevaluated 1921 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
5-1921
630 state = (used == sectiontext.size()
used == sectiontext.size()Description
TRUEevaluated 1814 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 107 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
? Acceptable : Intermediate);
107-1814
631 text.replace(index, used, sectiontext.constData(), used);-
632 }
executed 1921 times by 6 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
else {
1921
633 state = Intermediate;-
634 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
5
635 break;
executed 1926 times by 6 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1926
636 }-
637 case
executed 2691 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
DaySection:
executed 2691 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
code before this statement executed 1733 times by 7 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
1733-2691
638 case
executed 1932 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 1932 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
1932
639 case
executed 880 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
YearSection2Digits:
executed 880 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
880
640 case
executed 820 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
Hour12Section:
executed 820 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
820
641 case
executed 1246 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1246 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1246
642 case
executed 1886 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
MinuteSection:
executed 1886 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1886
643 case
executed 1703 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 1703 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
1703
644 case
executed 219 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
MSecSection:
executed 219 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
{
219
645 if (sectiontextSize == 0
sectiontextSize == 0Description
TRUEevaluated 17 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 13093 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
17-13093
646 num = 0;-
647 used = 0;-
648 state = Intermediate;-
649 }
executed 17 times by 2 tests: end of block
Executed by:
  • tst_QDateTimeEdit
  • tst_QTime
else {
17
650 const int absMax = absoluteMax(sectionIndex);-
651 QLocale loc;-
652 bool ok = true;-
653 int last = -1;-
654 used = -1;-
655-
656 QStringRef digitsStr = sectionTextRef;-
657 for (int i = 0; i < sectiontextSize
i < sectiontextSizeDescription
TRUEevaluated 29808 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 12847 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
; ++i) {
12847-29808
658 if (digitsStr.at(i).isSpace()
digitsStr.at(i).isSpace()Description
TRUEevaluated 246 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
FALSEevaluated 29562 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
246-29562
659 sectiontextSize = i;-
660 break;
executed 246 times by 4 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
246
661 }-
662 }
executed 29562 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
29562
663-
664 const int max = qMin(sectionmaxsize, sectiontextSize);-
665 for (int digits = max; digits >= 1
digits >= 1Description
TRUEevaluated 14065 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 48 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QFtp
; --digits) {
48-14065
666 digitsStr.truncate(digits);-
667 int tmp = (int)loc.toUInt(digitsStr, &ok);-
668 if (ok
okDescription
TRUEevaluated 13053 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 1012 times by 6 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
&& sn.type == Hour12Section
sn.type == Hour12SectionDescription
TRUEevaluated 822 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 12231 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
822-13053
669 if (tmp > 12
tmp > 12Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 820 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
) {
2-820
670 tmp = -1;-
671 ok = false;-
672 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else if (tmp == 12
tmp == 12Description
TRUEevaluated 100 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
FALSEevaluated 720 times by 4 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
) {
2-720
673 tmp = 0;-
674 }
executed 100 times by 3 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
100
675 }
executed 822 times by 5 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
822
676 if (ok
okDescription
TRUEevaluated 13051 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 1014 times by 6 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
&& tmp <= absMax
tmp <= absMaxDescription
TRUEevaluated 13045 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 6 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
6-13051
677 if (false) QMessageLogger(__FILE__, 814, __PRETTY_FUNCTION__).debug() << sectionTextRef.left(digits) << tmp << digits;
dead code: QMessageLogger(__FILE__, 814, __PRETTY_FUNCTION__).debug() << sectionTextRef.left(digits) << tmp << digits;
-
678 last = tmp;-
679 used = digits;-
680 break;
executed 13045 times by 11 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
13045
681 }-
682 }
executed 1020 times by 7 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
1020
683-
684 if (last == -1
last == -1Description
TRUEevaluated 48 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QFtp
FALSEevaluated 13045 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
48-13045
685 QChar first(sectionTextRef.at(0));-
686 if (separators.at(sectionIndex + 1).startsWith(first)
separators.at(...rtsWith(first)Description
TRUEevaluated 46 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QFtp
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDate
) {
2-46
687 used = 0;-
688 state = Intermediate;-
689 }
executed 46 times by 2 tests: end of block
Executed by:
  • tst_QDateTimeEdit
  • tst_QFtp
else {
46
690 state = Invalid;-
691 if (false) QMessageLogger(__FILE__, 828, __PRETTY_FUNCTION__).debug() << "invalid because" << sectionTextRef << "can't become a uint" << last << ok;
dead code: QMessageLogger(__FILE__, 828, __PRETTY_FUNCTION__).debug() << "invalid because" << sectionTextRef << "can't become a uint" << last << ok;
-
692 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QDate
2
693 } else {-
694 num += last;-
695 const FieldInfo fi = fieldInfo(sectionIndex);-
696 const bool done = (used == sectionmaxsize);-
697 if (!done
!doneDescription
TRUEevaluated 1515 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 11530 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
&& fi & Fraction) {
1515-11530
698 for (int i=used; i<sectionmaxsize
i<sectionmaxsizeDescription
TRUEevaluated 148 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 78 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++i) {
78-148
699 num *= 10;-
700 }
executed 148 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
148
701 }
executed 78 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
78
702 const int absMin = absoluteMin(sectionIndex);-
703 if (num < absMin
num < absMinDescription
TRUEevaluated 25 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 13020 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
25-13020
704 state = done
doneDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
? Invalid : Intermediate;
3-22
705 if (done
doneDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
3-22
706 if (false) QMessageLogger(__FILE__, 843, __PRETTY_FUNCTION__).debug() << "invalid because" << num << "is less than absoluteMin" << absMin;
dead code: QMessageLogger(__FILE__, 843, __PRETTY_FUNCTION__).debug() << "invalid because" << num << "is less than absoluteMin" << absMin;
-
707 }
executed 25 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else if (num > absMax
num > absMaxDescription
TRUEnever evaluated
FALSEevaluated 13020 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
0-13020
708 state = Intermediate;-
709 }
never executed: end of block
else if (!done
!doneDescription
TRUEevaluated 1493 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 11527 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
&& (
(fi & (FixedWi...Width|Numeric)Description
TRUEevaluated 465 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 1028 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
fi & (FixedWidth|Numeric)) == (FixedWidth|Numeric)
(fi & (FixedWi...Width|Numeric)Description
TRUEevaluated 465 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 1028 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
) {
0-11527
710 if (skipToNextSection(sectionIndex, currentValue, digitsStr)
skipToNextSect...ue, digitsStr)Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 438 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
27-438
711 state = Acceptable;-
712 const int missingZeroes = sectionmaxsize - digitsStr.size();-
713 text.insert(index, QString(missingZeroes, QLatin1Char('0')));-
714 used = sectionmaxsize;-
715 cursorPosition += missingZeroes;-
716 ++(const_cast<QDateTimeParser*>(this)->sectionNodes[sectionIndex].zeroesAdded);-
717 }
executed 27 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else {
27
718 state = Intermediate;;-
719 }
executed 438 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
438
720 } else {-
721 state = Acceptable;-
722 }
executed 12555 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
12555
723 }-
724 }-
725 break;
executed 13110 times by 11 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
}
13110
726 default
never executed: default:
:
never executed: default:
0
727 QMessageLogger(__FILE__, 864, __PRETTY_FUNCTION__).warning("QDateTimeParser::parseSection Internal error (%s %d)",-
728 QString(sn.name()).toLocal8Bit().constData(), sectionIndex);-
729 return
never executed: return -1;
-1;
never executed: return -1;
0
730 }-
731-
732 if (usedptr
usedptrDescription
TRUEevaluated 15899 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEnever evaluated
)
0-15899
733 *
executed 15899 times by 11 tests: *usedptr = used;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
usedptr = used;
executed 15899 times by 11 tests: *usedptr = used;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
15899
734-
735 return
executed 15899 times by 11 tests: return (state != Invalid ? num : -1);
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
(state != Invalid ? num : -1);
executed 15899 times by 11 tests: return (state != Invalid ? num : -1);
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
15899
736}-
737-
738-
739-
740-
741-
742-
743-
744QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPosition,-
745 const QDateTime &currentValue, bool fixup) const-
746{-
747 const QDateTime minimum = getMinimum();-
748 const QDateTime maximum = getMaximum();-
749-
750 State state = Acceptable;-
751-
752 QDateTime newCurrentValue;-
753 bool conflicts = false;-
754 const int sectionNodesCount = sectionNodes.size();-
755-
756 if (false) QMessageLogger(__FILE__, 893, __PRETTY_FUNCTION__).debug() << "parse" << input;
dead code: QMessageLogger(__FILE__, 893, __PRETTY_FUNCTION__).debug() << "parse" << input;
-
757 {-
758 int pos = 0;-
759 int year, month, day;-
760 const QDate currentDate = currentValue.date();-
761 const QTime currentTime = currentValue.time();-
762 currentDate.getDate(&year, &month, &day);-
763 int year2digits = year % 100;-
764 int hour = currentTime.hour();-
765 int hour12 = -1;-
766 int minute = currentTime.minute();-
767 int second = currentTime.second();-
768 int msec = currentTime.msec();-
769 int dayofweek = currentDate.dayOfWeek();-
770-
771 int ampm = -1;-
772 Sections isSet = NoSection;-
773 int num;-
774 State tmpstate;-
775-
776 for (int index=0; state != Invalid
state != InvalidDescription
TRUEevaluated 20637 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 7 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
&& index<sectionNodesCount
index<sectionNodesCountDescription
TRUEevaluated 16021 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 4616 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
; ++index) {
7-20637
777 if (QStringRef(&input, pos, separators.at(index).size()) != separators.at(index)
QStringRef(&in...tors.at(index)Description
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QFtp
FALSEevaluated 15899 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
122-15899
778 if (false) QMessageLogger(__FILE__, 915, __PRETTY_FUNCTION__).debug() << "invalid because" << input.midRef(pos, separators.at(index).size())
dead code: QMessageLogger(__FILE__, 915, __PRETTY_FUNCTION__).debug() << "invalid because" << input.midRef(pos, separators.at(index).size()) << "!=" << separators.at(index) << index << pos << currentSectionIndex;
-
779 << "!=" << separators.at(index)
dead code: QMessageLogger(__FILE__, 915, __PRETTY_FUNCTION__).debug() << "invalid because" << input.midRef(pos, separators.at(index).size()) << "!=" << separators.at(index) << index << pos << currentSectionIndex;
-
780 << index << pos << currentSectionIndex;
dead code: QMessageLogger(__FILE__, 915, __PRETTY_FUNCTION__).debug() << "invalid because" << input.midRef(pos, separators.at(index).size()) << "!=" << separators.at(index) << index << pos << currentSectionIndex;
-
781 state = Invalid;-
782 goto
executed 122 times by 2 tests: goto end;
Executed by:
  • tst_QDateTimeEdit
  • tst_QFtp
end;
executed 122 times by 2 tests: goto end;
Executed by:
  • tst_QDateTimeEdit
  • tst_QFtp
122
783 }-
784 pos += separators.at(index).size();-
785 sectionNodes[index].pos = pos;-
786 int *current = 0;-
787 const SectionNode sn = sectionNodes.at(index);-
788 int used;-
789-
790 num = parseSection(currentValue, index, input, cursorPosition, pos, tmpstate, &used);-
791 if (false) QMessageLogger(__FILE__, 928, __PRETTY_FUNCTION__).debug() << "sectionValue" << sn.name() << input
dead code: QMessageLogger(__FILE__, 928, __PRETTY_FUNCTION__).debug() << "sectionValue" << sn.name() << input << "pos" << pos << "used" << used << stateName(tmpstate);
-
792 << "pos" << pos << "used" << used << stateName(tmpstate);
dead code: QMessageLogger(__FILE__, 928, __PRETTY_FUNCTION__).debug() << "sectionValue" << sn.name() << input << "pos" << pos << "used" << used << stateName(tmpstate);
-
793 if (fixup
fixupDescription
TRUEevaluated 73 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 15826 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
&& tmpstate == Intermediate
tmpstate == IntermediateDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& used < sn.count
used < sn.countDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
1-15826
794 const FieldInfo fi = fieldInfo(index);-
795 if ((
(fi & (Numeric...ic|FixedWidth)Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
fi & (Numeric|FixedWidth)) == (Numeric|FixedWidth)
(fi & (Numeric...ic|FixedWidth)Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
3-17
796 const QString newText = QString::fromLatin1("%1").arg(num, sn.count, 10, QLatin1Char('0'));-
797 input.replace(pos, used, newText);-
798 used = sn.count;-
799 }
executed 17 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
17
800 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
20
801 pos += qMax(0, used);-
802-
803 state = qMin<State>(state, tmpstate);-
804 if (state == Intermediate
state == IntermediateDescription
TRUEevaluated 1353 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QTime
FALSEevaluated 14546 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
&& context == FromString
context == FromStringDescription
TRUEevaluated 12 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QTime
FALSEevaluated 1341 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
12-14546
805 state = Invalid;-
806 break;
executed 12 times by 4 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QTime
12
807 }-
808-
809 if (false) QMessageLogger(__FILE__, 946, __PRETTY_FUNCTION__).debug() << index << sn.name() << "is set to"
dead code: QMessageLogger(__FILE__, 946, __PRETTY_FUNCTION__).debug() << index << sn.name() << "is set to" << pos << "state is" << stateName(state);
-
810 << pos << "state is" << stateName(state);
dead code: QMessageLogger(__FILE__, 946, __PRETTY_FUNCTION__).debug() << index << sn.name() << "is set to" << pos << "state is" << stateName(state);
-
811-
812-
813 if (state != Invalid
state != InvalidDescription
TRUEevaluated 15880 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 7 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
7-15880
814 switch (sn.type) {-
815 case
executed 1245 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1245 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
current = &hour; break;
executed 1245 times by 6 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1245
816 case
executed 820 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
Hour12Section:
executed 820 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
current = &hour12; break;
executed 820 times by 5 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
820
817 case
executed 1885 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
MinuteSection:
executed 1885 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
current = &minute; break;
executed 1885 times by 8 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1885
818 case
executed 1703 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 1703 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
current = &second; break;
executed 1703 times by 4 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
1703
819 case
executed 219 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
MSecSection:
executed 219 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
current = &msec; break;
executed 219 times by 2 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
219
820 case
executed 1932 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 1932 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
current = &year; break;
executed 1932 times by 6 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
1932
821 case
executed 879 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
YearSection2Digits:
executed 879 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
current = &year2digits; break;
executed 879 times by 7 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
879
822 case
executed 3192 times by 10 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
MonthSection:
executed 3192 times by 10 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
current = &month; break;
executed 3192 times by 10 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
3192
823 case
executed 40 times by 3 tests: case DayOfWeekSectionShort:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionShort:
executed 40 times by 3 tests: case DayOfWeekSectionShort:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
40
824 case
executed 424 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 424 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
current = &dayofweek; break;
executed 464 times by 3 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
424-464
825 case
executed 2680 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
DaySection:
executed 2680 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
current = &day; num = qMax<int>(1, num); break;
executed 2680 times by 10 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
2680
826 case
executed 861 times by 5 tests: case AmPmSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
AmPmSection:
executed 861 times by 5 tests: case AmPmSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
current = &ampm; break;
executed 861 times by 5 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
861
827 default
never executed: default:
:
never executed: default:
0
828 QMessageLogger(__FILE__, 965, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error (%s)",-
829 QString(sn.name()).toLocal8Bit().constData());-
830 break;
never executed: break;
0
831 }-
832 if (!current
!currentDescription
TRUEnever evaluated
FALSEevaluated 15880 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
0-15880
833 QMessageLogger(__FILE__, 970, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 2");-
834 return
never executed: return StateNode();
StateNode();
never executed: return StateNode();
0
835 }-
836 if (isSet & sn.type && *
*current != numDescription
TRUEevaluated 101 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 416 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
current != num
*current != numDescription
TRUEevaluated 101 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 416 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
101-416
837 if (false) QMessageLogger(__FILE__, 974, __PRETTY_FUNCTION__).debug() << "CONFLICT " << sn.name() << *current << num;
dead code: QMessageLogger(__FILE__, 974, __PRETTY_FUNCTION__).debug() << "CONFLICT " << sn.name() << *current << num;
-
838 conflicts = true;-
839 if (index != currentSectionIndex
index != currentSectionIndexDescription
TRUEevaluated 96 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
|| num == -1
num == -1Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-96
840 continue;
executed 96 times by 3 tests: continue;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
96
841 }-
842 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
5
843 if (num != -1
num != -1Description
TRUEevaluated 15779 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
5-15779
844 *
executed 15779 times by 11 tests: *current = num;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
current = num;
executed 15779 times by 11 tests: *current = num;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
15779
845 isSet |= sn.type;-
846 }
executed 15784 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
15784
847 }
executed 15791 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
15791
848-
849 if (state != Invalid
state != InvalidDescription
TRUEevaluated 4616 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 19 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QTime
&& QStringRef(&input, pos, input.size() - pos) != separators.last()
QStringRef(&in...arators.last()Description
TRUEevaluated 15 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 4601 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
) {
15-4616
850 if (false) QMessageLogger(__FILE__, 987, __PRETTY_FUNCTION__).debug() << "invalid because" << input.midRef(pos)
dead code: QMessageLogger(__FILE__, 987, __PRETTY_FUNCTION__).debug() << "invalid because" << input.midRef(pos) << "!=" << separators.last() << pos;
-
851 << "!=" << separators.last() << pos;
dead code: QMessageLogger(__FILE__, 987, __PRETTY_FUNCTION__).debug() << "invalid because" << input.midRef(pos) << "!=" << separators.last() << pos;
-
852 state = Invalid;-
853 }
executed 15 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
15
854-
855 if (state != Invalid
state != InvalidDescription
TRUEevaluated 4601 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 34 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QTime
) {
34-4601
856 if (parserType != QVariant::Time
parserType != QVariant::TimeDescription
TRUEevaluated 4578 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
FALSEevaluated 23 times by 3 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
) {
23-4578
857 if (year % 100 != year2digits
year % 100 != year2digitsDescription
TRUEevaluated 359 times by 7 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
FALSEevaluated 4219 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
&& (isSet & YearSection2Digits)) {
359-4219
858 if (!(isSet & YearSection)
!(isSet & YearSection)Description
TRUEevaluated 16 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTime
) {
1-16
859 year = (year / 100) * 100;-
860 year += year2digits;-
861 }
executed 16 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
else {
16
862 conflicts = true;-
863 const SectionNode &sn = sectionNode(currentSectionIndex);-
864 if (sn.type == YearSection2Digits
sn.type == YearSection2DigitsDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTime
) {
0-1
865 year = (year / 100) * 100;-
866 year += year2digits;-
867 }
never executed: end of block
0
868 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QDateTime
1
869 }-
870-
871 const QDate date(year, month, day);-
872 const int diff = dayofweek - date.dayOfWeek();-
873 if (diff != 0
diff != 0Description
TRUEevaluated 524 times by 7 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
FALSEevaluated 4054 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
&& state == Acceptable
state == AcceptableDescription
TRUEevaluated 315 times by 7 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
FALSEevaluated 209 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& isSet & DayOfWeekSectionMask) {
209-4054
874 if (isSet & DaySection
isSet & DaySectionDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 26 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
)
2-26
875 conflicts = true;
executed 2 times by 1 test: conflicts = true;
Executed by:
  • tst_QDateTimeEdit
2
876 const SectionNode &sn = sectionNode(currentSectionIndex);-
877 if (sn.type & DayOfWeekSectionMask
sn.type & DayOfWeekSectionMaskDescription
TRUEnever evaluated
FALSEevaluated 28 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
|| currentSectionIndex == -1
currentSectionIndex == -1Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-28
878-
879 day += diff;-
880 if (day <= 0
day <= 0Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QDate
) {
6-8
881 day += 7;-
882 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
else if (day > date.daysInMonth()
day > date.daysInMonth()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QDate
) {
0-8
883 day -= 7;-
884 }
never executed: end of block
0
885 if (false) QMessageLogger(__FILE__, 1022, __PRETTY_FUNCTION__).debug() << year << month << day << dayofweek
dead code: QMessageLogger(__FILE__, 1022, __PRETTY_FUNCTION__).debug() << year << month << day << dayofweek << diff << QDate(year, month, day).dayOfWeek();
-
886 << diff << QDate(year, month, day).dayOfWeek();
dead code: QMessageLogger(__FILE__, 1022, __PRETTY_FUNCTION__).debug() << year << month << day << dayofweek << diff << QDate(year, month, day).dayOfWeek();
-
887 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
14
888 }
executed 28 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
28
889-
890 bool needfixday = false;-
891 if (sectionType(currentSectionIndex) & DaySectionMask
sectionType(cu...DaySectionMaskDescription
TRUEevaluated 1257 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3321 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
) {
1257-3321
892 cachedDay = day;-
893 }
executed 1257 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else if (cachedDay > day
cachedDay > dayDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3309 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
) {
12-3309
894 day = cachedDay;-
895 needfixday = true;-
896 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
12
897-
898 if (!QDate::isValid(year, month, day)
!QDate::isVali...r, month, day)Description
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 4490 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
) {
88-4490
899 if (day < 32
day < 32Description
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-88
900 cachedDay = day;-
901 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
88
902 if (day > 28
day > 28Description
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 37 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& QDate::isValid(year, month, 1)
QDate::isValid(year, month, 1)Description
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-51
903 needfixday = true;-
904 }
executed 51 times by 2 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
51
905 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
88
906 if (needfixday
needfixdayDescription
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 4527 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
) {
51-4527
907 if (context == FromString
context == FromStringDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTime
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
1-50
908 state = Invalid;-
909 goto
executed 1 time by 1 test: goto end;
Executed by:
  • tst_QDateTime
end;
executed 1 time by 1 test: goto end;
Executed by:
  • tst_QDateTime
1
910 }-
911 if (state == Acceptable
state == AcceptableDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
&& fixday
fixdayDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-50
912 day = qMin<int>(day, QDate(year, month, 1).daysInMonth());-
913-
914 const QLocale loc = locale();-
915 for (int i=0; i<sectionNodesCount
i<sectionNodesCountDescription
TRUEevaluated 149 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++i) {
50-149
916 const SectionNode sn = sectionNode(i);-
917 if (sn.type & DaySection
sn.type & DaySectionDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 111 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
38-111
918 input.replace(sectionPos(sn), sectionSize(i), loc.toString(day));-
919 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else if (sn.type & DayOfWeekSectionMask
sn.type & DayOfWeekSectionMaskDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 97 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
14-97
920 const int dayOfWeek = QDate(year, month, day).dayOfWeek();-
921 const QLocale::FormatType dayFormat =-
922 (sn.type == DayOfWeekSectionShort
sn.type == Day...ekSectionShortDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
1-13
923 ? QLocale::ShortFormat : QLocale::LongFormat);-
924 const QString dayName(loc.dayName(dayOfWeek, dayFormat));-
925 input.replace(sectionPos(sn), sectionSize(i), dayName);-
926 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
14
927 }
executed 149 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
149
928 }
executed 50 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else {
50
929 state = qMin(Intermediate, state);-
930 }
never executed: end of block
0
931 }-
932 }
executed 4577 times by 10 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
4577
933-
934 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 3681 times by 9 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 919 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
919-3681
935 if (isSet & Hour12Section
isSet & Hour12SectionDescription
TRUEevaluated 808 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 2873 times by 7 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
) {
808-2873
936 const bool hasHour = isSet & Hour24Section;-
937 if (ampm == -1
ampm == -1Description
TRUEnever evaluated
FALSEevaluated 808 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
) {
0-808
938 if (hasHour
hasHourDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
939 ampm = (hour < 12
hour < 12Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : 1);
0
940 }
never executed: end of block
else {
0
941 ampm = 0;-
942 }
never executed: end of block
0
943 }-
944 hour12 = (ampm == 0
ampm == 0Description
TRUEevaluated 730 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 78 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QTime
? hour12 % 12 : (hour12 % 12) + 12);
78-730
945 if (!hasHour
!hasHourDescription
TRUEevaluated 806 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
2-806
946 hour = hour12;-
947 }
executed 806 times by 5 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
else if (hour != hour12
hour != hour12Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-806
948 conflicts = true;-
949 }
never executed: end of block
0
950 }
executed 808 times by 5 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
else if (ampm != -1
ampm != -1Description
TRUEevaluated 51 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 2822 times by 7 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
) {
51-2822
951 if (!(isSet & (Hour24Section))
!(isSet & (Hour24Section))Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QTime
) {
3-48
952 hour = (12 * ampm);-
953 }
executed 3 times by 2 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
else if ((
(ampm == 0) != (hour < 12)Description
TRUEnever evaluated
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QTime
ampm == 0) != (hour < 12)
(ampm == 0) != (hour < 12)Description
TRUEnever evaluated
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QTime
) {
0-48
954 conflicts = true;-
955 }
never executed: end of block
0
956 }
executed 51 times by 3 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
51
957-
958 }
executed 3681 times by 9 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
3681
959-
960 newCurrentValue = QDateTime(QDate(year, month, day), QTime(hour, minute, second, msec), spec);-
961 if (false) QMessageLogger(__FILE__, 1098, __PRETTY_FUNCTION__).debug() << year << month << day << hour << minute << second << msec;
dead code: QMessageLogger(__FILE__, 1098, __PRETTY_FUNCTION__).debug() << year << month << day << hour << minute << second << msec;
-
962 }
executed 4600 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
4600
963 if (false) QMessageLogger(__FILE__, 1100, __PRETTY_FUNCTION__).debug("'%s' => '%s'(%s)", input.toLatin1().constData(),
dead code: QMessageLogger(__FILE__, 1100, __PRETTY_FUNCTION__).debug("'%s' => '%s'(%s)", input.toLatin1().constData(), newCurrentValue.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")).toLatin1().constData(), stateName(state).toLatin1().constData());
-
964 newCurrentValue.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")).toLatin1().constData(),
dead code: QMessageLogger(__FILE__, 1100, __PRETTY_FUNCTION__).debug("'%s' => '%s'(%s)", input.toLatin1().constData(), newCurrentValue.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")).toLatin1().constData(), stateName(state).toLatin1().constData());
-
965 stateName(state).toLatin1().constData());
dead code: QMessageLogger(__FILE__, 1100, __PRETTY_FUNCTION__).debug("'%s' => '%s'(%s)", input.toLatin1().constData(), newCurrentValue.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")).toLatin1().constData(), stateName(state).toLatin1().constData());
-
966 }-
967end:
code before this statement executed 4634 times by 11 tests: end:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
4634
968 if (newCurrentValue.isValid()
newCurrentValue.isValid()Description
TRUEevaluated 4563 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 194 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QTime
) {
194-4563
969 if (context != FromString
context != FromStringDescription
TRUEevaluated 4098 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
FALSEevaluated 465 times by 8 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
&& state != Invalid
state != InvalidDescription
TRUEevaluated 4098 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
FALSEnever evaluated
&& newCurrentValue < minimum
newCurrentValue < minimumDescription
TRUEevaluated 53 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 4045 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
0-4098
970 const QLatin1Char space(' ');-
971 if (newCurrentValue >= minimum
newCurrentValue >= minimumDescription
TRUEnever evaluated
FALSEevaluated 53 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
0-53
972 QMessageLogger(__FILE__, 1109, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 3 (%s %s)",
never executed: QMessageLogger(__FILE__, 1109, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 3 (%s %s)", QString(newCurrentValue.toString()).toLocal8Bit().constData(), QString(minimum.toString()).toLocal8Bit().constData());
0
973 QString(newCurrentValue.toString()).toLocal8Bit().constData(), QString(minimum.toString()).toLocal8Bit().constData());
never executed: QMessageLogger(__FILE__, 1109, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 3 (%s %s)", QString(newCurrentValue.toString()).toLocal8Bit().constData(), QString(minimum.toString()).toLocal8Bit().constData());
0
974-
975 bool done = false;-
976 state = Invalid;-
977 for (int i=0; i<sectionNodesCount
i<sectionNodesCountDescription
TRUEevaluated 138 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& !done
!doneDescription
TRUEevaluated 129 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++i) {
9-138
978 const SectionNode &sn = sectionNodes.at(i);-
979 QString t = sectionText(input, i, sn.pos).toLower();-
980 if ((t.size() < sectionMaxSize(i)
t.size() < sectionMaxSize(i)Description
TRUEevaluated 55 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& (((
(((int)fieldIn...)) != Numeric)Description
TRUEevaluated 55 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
int)fieldInfo(i) & (FixedWidth|Numeric)) != Numeric)
(((int)fieldIn...)) != Numeric)Description
TRUEevaluated 55 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
)
0-74
981 || t.contains(space)
t.contains(space)Description
TRUEnever evaluated
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-74
982 switch (sn.type) {-
983 case
never executed: case AmPmSection:
AmPmSection:
never executed: case AmPmSection:
0
984 switch (findAmPm(t, i)) {-
985 case
never executed: case AM:
AM:
never executed: case AM:
0
986 case
never executed: case PM:
PM:
never executed: case PM:
0
987 state = Acceptable;-
988 done = true;-
989 break;
never executed: break;
0
990 case
never executed: case Neither:
Neither:
never executed: case Neither:
0
991 state = Invalid;-
992 done = true;-
993 break;
never executed: break;
0
994 case
never executed: case PossibleAM:
PossibleAM:
never executed: case PossibleAM:
0
995 case
never executed: case PossiblePM:
PossiblePM:
never executed: case PossiblePM:
0
996 case
never executed: case PossibleBoth:
PossibleBoth:
never executed: case PossibleBoth:
{
0
997 const QDateTime copy(newCurrentValue.addSecs(12 * 60 * 60));-
998 if (copy >= minimum
copy >= minimumDescription
TRUEnever evaluated
FALSEnever evaluated
&& copy <= maximum
copy <= maximumDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
999 state = Intermediate;-
1000 done = true;-
1001 }
never executed: end of block
0
1002 break;
never executed: break;
}
0
1003 }-
1004 case
executed 3 times by 1 test: case MonthSection:
Executed by:
  • tst_QDateTimeEdit
code before this statement never executed: case MonthSection:
executed 3 times by 1 test: case MonthSection:
Executed by:
  • tst_QDateTimeEdit
MonthSection:
code before this statement never executed: case MonthSection:
executed 3 times by 1 test: case MonthSection:
Executed by:
  • tst_QDateTimeEdit
0-3
1005 if (sn.count >= 3
sn.count >= 3Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-3
1006 const int currentMonth = newCurrentValue.date().month();-
1007 int tmp = currentMonth;-
1008-
1009 while ((
(tmp = findMon...+ 1, i)) != -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
tmp = findMonth(t, tmp + 1, i)) != -1
(tmp = findMon...+ 1, i)) != -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
3-6
1010 const QDateTime copy(newCurrentValue.addMonths(tmp - currentMonth));-
1011 if (copy >= minimum
copy >= minimumDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& copy <= maximum
copy <= maximumDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-6
1012 break;
never executed: break;
0
1013 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
6
1014 if (tmp == -1
tmp == -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-3
1015 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
3
1016 }-
1017 state = Intermediate;-
1018 done = true;-
1019 break;
never executed: break;
0
1020 }-
1021-
1022 default
executed 52 times by 1 test: default:
Executed by:
  • tst_QDateTimeEdit
code before this statement never executed: default:
executed 52 times by 1 test: default:
Executed by:
  • tst_QDateTimeEdit
:
code before this statement never executed: default:
executed 52 times by 1 test: default:
Executed by:
  • tst_QDateTimeEdit
{
0-52
1023 int toMin;-
1024 int toMax;-
1025-
1026 if (sn.type & TimeSectionMask
sn.type & TimeSectionMaskDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
20-32
1027 if (newCurrentValue.daysTo(minimum) != 0
newCurrentValu...(minimum) != 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-20
1028 break;
never executed: break;
0
1029 }-
1030 const QTime time = newCurrentValue.time();-
1031 toMin = time.msecsTo(minimum.time());-
1032 if (newCurrentValue.daysTo(maximum) > 0
newCurrentValu...o(maximum) > 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-20
1033 toMax = -1;-
1034 }
never executed: end of block
else {
0
1035 toMax = time.msecsTo(maximum.time());-
1036 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
20
1037 } else {-
1038 toMin = newCurrentValue.daysTo(minimum);-
1039 toMax = newCurrentValue.daysTo(maximum);-
1040 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
32
1041 const int maxChange = sn.maxChange();-
1042 if (toMin > maxChange
toMin > maxChangeDescription
TRUEnever evaluated
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-52
1043 if (false) QMessageLogger(__FILE__, 1180, __PRETTY_FUNCTION__).debug() << "invalid because toMin > maxChange" << toMin
dead code: QMessageLogger(__FILE__, 1180, __PRETTY_FUNCTION__).debug() << "invalid because toMin > maxChange" << toMin << maxChange << t << newCurrentValue << minimum;
-
1044 << maxChange << t << newCurrentValue << minimum;
dead code: QMessageLogger(__FILE__, 1180, __PRETTY_FUNCTION__).debug() << "invalid because toMin > maxChange" << toMin << maxChange << t << newCurrentValue << minimum;
-
1045 state = Invalid;-
1046 done = true;-
1047 break;
never executed: break;
0
1048 } else if (toMax > maxChange
toMax > maxChangeDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
14-38
1049 toMax = -1;-
1050 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
14
1051-
1052 const int min = getDigit(minimum, i);-
1053 if (min == -1
min == -1Description
TRUEnever evaluated
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-52
1054 QMessageLogger(__FILE__, 1191, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 4 (%s)",-
1055 QString(sn.name()).toLocal8Bit().constData());-
1056 state = Invalid;-
1057 done = true;-
1058 break;
never executed: break;
0
1059 }-
1060-
1061 int max = toMax != -1
toMax != -1Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
? getDigit(maximum, i) : absoluteMax(i, newCurrentValue);
14-38
1062 int pos = cursorPosition - sn.pos;-
1063 if (pos < 0
pos < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
|| pos >= t.size()
pos >= t.size()Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
4-48
1064 pos = -1;
executed 45 times by 1 test: pos = -1;
Executed by:
  • tst_QDateTimeEdit
45
1065 if (!potentialValue(t.simplified(), min, max, i, newCurrentValue, pos)
!potentialValu...entValue, pos)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
2-50
1066 if (false) QMessageLogger(__FILE__, 1203, __PRETTY_FUNCTION__).debug() << "invalid because potentialValue(" << t.simplified() << min << max
dead code: QMessageLogger(__FILE__, 1203, __PRETTY_FUNCTION__).debug() << "invalid because potentialValue(" << t.simplified() << min << max << sn.name() << "returned" << toMax << toMin << pos;
-
1067 << sn.name() << "returned" << toMax << toMin << pos;
dead code: QMessageLogger(__FILE__, 1203, __PRETTY_FUNCTION__).debug() << "invalid because potentialValue(" << t.simplified() << min << max << sn.name() << "returned" << toMax << toMin << pos;
-
1068 state = Invalid;-
1069 done = true;-
1070 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
2
1071 }-
1072 state = Intermediate;-
1073 done = true;-
1074 break;
executed 50 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
}
50
1075 }-
1076 }-
1077 }
executed 129 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
129
1078 }
executed 53 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else {
53
1079 if (context == FromString
context == FromStringDescription
TRUEevaluated 465 times by 8 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 4045 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
465-4045
1080-
1081 ((!(getMaximum().date().toJulianDay() == 4642999)) ? qt_assert("getMaximum().date().toJulianDay() == 4642999",__FILE__,1218) : qt_noop());-
1082 if (newCurrentValue.date().toJulianDay() > 4642999
newCurrentValu...ay() > 4642999Description
TRUEnever evaluated
FALSEevaluated 465 times by 8 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
)
0-465
1083 state = Invalid;
never executed: state = Invalid;
0
1084 }
executed 465 times by 8 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
else {
465
1085 if (newCurrentValue > getMaximum()
newCurrentValue > getMaximum()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 4044 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
)
1-4044
1086 state = Invalid;
executed 1 time by 1 test: state = Invalid;
Executed by:
  • tst_QDateTimeEdit
1
1087 }
executed 4045 times by 4 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
4045
1088-
1089 if (false) QMessageLogger(__FILE__, 1226, __PRETTY_FUNCTION__).debug() << "not checking intermediate because newCurrentValue is" << newCurrentValue << getMinimum() << getMaximum();
dead code: QMessageLogger(__FILE__, 1226, __PRETTY_FUNCTION__).debug() << "not checking intermediate because newCurrentValue is" << newCurrentValue << getMinimum() << getMaximum();
-
1090 }
executed 4510 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
4510
1091 }-
1092 StateNode node;-
1093 node.input = input;-
1094 node.state = state;-
1095 node.conflicts = conflicts;-
1096 node.value = newCurrentValue.toTimeSpec(spec);-
1097 text = input;-
1098 return
executed 4757 times by 11 tests: return node;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
node;
executed 4757 times by 11 tests: return node;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
4757
1099}-
1100int QDateTimeParser::findMonth(const QString &str1, int startMonth, int sectionIndex,-
1101 QString *usedMonth, int *used) const-
1102{-
1103 int bestMatch = -1;-
1104 int bestCount = 0;-
1105 if (!str1.isEmpty()
!str1.isEmpty()Description
TRUEevaluated 1471 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEnever evaluated
) {
0-1471
1106 const SectionNode &sn = sectionNode(sectionIndex);-
1107 if (sn.type != MonthSection
sn.type != MonthSectionDescription
TRUEnever evaluated
FALSEevaluated 1471 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
) {
0-1471
1108 QMessageLogger(__FILE__, 1254, __PRETTY_FUNCTION__).warning("QDateTimeParser::findMonth Internal error");-
1109 return
never executed: return -1;
-1;
never executed: return -1;
0
1110 }-
1111-
1112 QLocale::FormatType type = sn.count == 3
sn.count == 3Description
TRUEevaluated 1270 times by 5 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 201 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
? QLocale::ShortFormat : QLocale::LongFormat;
201-1270
1113 QLocale l = locale();-
1114-
1115 for (int month=startMonth; month<=12
month<=12Description
TRUEevaluated 6035 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 118 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++month) {
118-6035
1116 const QString monthName = l.monthName(month, type);-
1117 QString str2 = monthName.toLower();-
1118-
1119 if (str1.startsWith(str2)
str1.startsWith(str2)Description
TRUEevaluated 1350 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 4685 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
) {
1350-4685
1120 if (used
usedDescription
TRUEevaluated 1350 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEnever evaluated
) {
0-1350
1121 if (false) QMessageLogger(__FILE__, 1267, __PRETTY_FUNCTION__).debug() << "used is set to" << str2.size();
dead code: QMessageLogger(__FILE__, 1267, __PRETTY_FUNCTION__).debug() << "used is set to" << str2.size();
-
1122 *used = str2.size();-
1123 }
executed 1350 times by 6 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1350
1124 if (usedMonth
usedMonthDescription
TRUEevaluated 1350 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEnever evaluated
)
0-1350
1125 *
executed 1350 times by 6 tests: *usedMonth = monthName;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
usedMonth = monthName;
executed 1350 times by 6 tests: *usedMonth = monthName;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1350
1126-
1127 return
executed 1350 times by 6 tests: return month;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
month;
executed 1350 times by 6 tests: return month;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1350
1128 }-
1129 if (context == FromString
context == FromStringDescription
TRUEevaluated 3086 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 1599 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
1599-3086
1130 continue;
executed 3086 times by 5 tests: continue;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
3086
1131-
1132 const int limit = qMin(str1.size(), str2.size());-
1133-
1134 if (false) QMessageLogger(__FILE__, 1280, __PRETTY_FUNCTION__).debug() << "limit is" << limit << str1 << str2;
dead code: QMessageLogger(__FILE__, 1280, __PRETTY_FUNCTION__).debug() << "limit is" << limit << str1 << str2;
-
1135 bool equal = true;-
1136 for (int i=0; i<limit
i<limitDescription
TRUEevaluated 2263 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++i) {
3-2263
1137 if (str1.at(i) != str2.at(i)
str1.at(i) != str2.at(i)Description
TRUEevaluated 1596 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 667 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
667-1596
1138 equal = false;-
1139 if (i > bestCount
i > bestCountDescription
TRUEevaluated 177 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 1419 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
177-1419
1140 bestCount = i;-
1141 bestMatch = month;-
1142 }
executed 177 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
177
1143 break;
executed 1596 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
1596
1144 }-
1145 }
executed 667 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
667
1146 if (equal
equalDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 1596 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
3-1596
1147 if (used
usedDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
)
0-3
1148 *
executed 3 times by 1 test: *used = limit;
Executed by:
  • tst_QDateTimeEdit
used = limit;
executed 3 times by 1 test: *used = limit;
Executed by:
  • tst_QDateTimeEdit
3
1149 if (usedMonth
usedMonthDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
)
0-3
1150 *
executed 3 times by 1 test: *usedMonth = monthName;
Executed by:
  • tst_QDateTimeEdit
usedMonth = monthName;
executed 3 times by 1 test: *usedMonth = monthName;
Executed by:
  • tst_QDateTimeEdit
3
1151 return
executed 3 times by 1 test: return month;
Executed by:
  • tst_QDateTimeEdit
month;
executed 3 times by 1 test: return month;
Executed by:
  • tst_QDateTimeEdit
3
1152 }-
1153 }
executed 1596 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
1596
1154 if (usedMonth
usedMonthDescription
TRUEevaluated 109 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& bestMatch != -1
bestMatch != -1Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
5-109
1155 *
executed 104 times by 1 test: *usedMonth = l.monthName(bestMatch, type);
Executed by:
  • tst_QDateTimeEdit
usedMonth = l.monthName(bestMatch, type);
executed 104 times by 1 test: *usedMonth = l.monthName(bestMatch, type);
Executed by:
  • tst_QDateTimeEdit
104
1156 }
executed 118 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
118
1157 if (used
usedDescription
TRUEevaluated 109 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
9-109
1158 if (false) QMessageLogger(__FILE__, 1304, __PRETTY_FUNCTION__).debug() << "used is set to" << bestCount;
dead code: QMessageLogger(__FILE__, 1304, __PRETTY_FUNCTION__).debug() << "used is set to" << bestCount;
-
1159 *used = bestCount;-
1160 }
executed 109 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
109
1161 return
executed 118 times by 1 test: return bestMatch;
Executed by:
  • tst_QDateTimeEdit
bestMatch;
executed 118 times by 1 test: return bestMatch;
Executed by:
  • tst_QDateTimeEdit
118
1162}-
1163-
1164int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex, QString *usedDay, int *used) const-
1165{-
1166 int bestMatch = -1;-
1167 int bestCount = 0;-
1168 if (!str1.isEmpty()
!str1.isEmpty()Description
TRUEevaluated 464 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-464
1169 const SectionNode &sn = sectionNode(sectionIndex);-
1170 if (!(sn.type & DaySectionMask)
!(sn.type & DaySectionMask)Description
TRUEnever evaluated
FALSEevaluated 464 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
0-464
1171 QMessageLogger(__FILE__, 1317, __PRETTY_FUNCTION__).warning("QDateTimeParser::findDay Internal error");-
1172 return
never executed: return -1;
-1;
never executed: return -1;
0
1173 }-
1174 const QLocale l = locale();-
1175 for (int day=startDay; day<=7
day<=7Description
TRUEevaluated 1838 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
; ++day) {
0-1838
1176 const QString str2 = l.dayName(day, sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat);-
1177-
1178 if (str1.startsWith(str2.toLower())
str1.startsWit...tr2.toLower())Description
TRUEevaluated 464 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 1374 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
464-1374
1179 if (used
usedDescription
TRUEevaluated 464 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
)
0-464
1180 *
executed 464 times by 3 tests: *used = str2.size();
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
used = str2.size();
executed 464 times by 3 tests: *used = str2.size();
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
464
1181 if (usedDay
usedDayDescription
TRUEevaluated 464 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-464
1182 *usedDay = str2;-
1183 }
executed 464 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
464
1184 return
executed 464 times by 3 tests: return day;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
day;
executed 464 times by 3 tests: return day;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
464
1185 }-
1186 if (context == FromString
context == FromStringDescription
TRUEevaluated 53 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
FALSEevaluated 1321 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
53-1321
1187 continue;
executed 53 times by 2 tests: continue;
Executed by:
  • tst_QDate
  • tst_QDateTime
53
1188-
1189 const int limit = qMin(str1.size(), str2.size());-
1190 bool found = true;-
1191 for (int i=0; i<limit
i<limitDescription
TRUEevaluated 1321 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
; ++i) {
0-1321
1192 if (str1.at(i) != str2.at(i)
str1.at(i) != str2.at(i)Description
TRUEevaluated 1321 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
&& !str1.at(i).isSpace()
!str1.at(i).isSpace()Description
TRUEevaluated 1321 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-1321
1193 if (i > bestCount
i > bestCountDescription
TRUEnever evaluated
FALSEevaluated 1321 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-1321
1194 bestCount = i;-
1195 bestMatch = day;-
1196 }
never executed: end of block
0
1197 found = false;-
1198 break;
executed 1321 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
1321
1199 }-
1200-
1201 }
never executed: end of block
0
1202 if (found
foundDescription
TRUEnever evaluated
FALSEevaluated 1321 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-1321
1203 if (used
usedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1204 *
never executed: *used = limit;
used = limit;
never executed: *used = limit;
0
1205 if (usedDay
usedDayDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1206 *
never executed: *usedDay = str2;
usedDay = str2;
never executed: *usedDay = str2;
0
1207-
1208 return
never executed: return day;
day;
never executed: return day;
0
1209 }-
1210 }
executed 1321 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
1321
1211 if (usedDay
usedDayDescription
TRUEnever evaluated
FALSEnever evaluated
&& bestMatch != -1
bestMatch != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1212 *usedDay = l.dayName(bestMatch, sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat);-
1213 }
never executed: end of block
0
1214 }
never executed: end of block
0
1215 if (used
usedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1216 *
never executed: *used = bestCount;
used = bestCount;
never executed: *used = bestCount;
0
1217-
1218 return
never executed: return bestMatch;
bestMatch;
never executed: return bestMatch;
0
1219}-
1220QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const-
1221{-
1222 const SectionNode &s = sectionNode(sectionIndex);-
1223 if (s.type != AmPmSection
s.type != AmPmSectionDescription
TRUEnever evaluated
FALSEevaluated 863 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
) {
0-863
1224 QMessageLogger(__FILE__, 1383, __PRETTY_FUNCTION__).warning("QDateTimeParser::findAmPm Internal error");-
1225 return
never executed: return Neither;
Neither;
never executed: return Neither;
0
1226 }-
1227 if (used
usedDescription
TRUEevaluated 863 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEnever evaluated
)
0-863
1228 *
executed 863 times by 5 tests: *used = str.size();
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
used = str.size();
executed 863 times by 5 tests: *used = str.size();
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
863
1229 if (QStringRef(&str).trimmed().isEmpty()
QStringRef(&st...ed().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 863 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
) {
0-863
1230 return
never executed: return PossibleBoth;
PossibleBoth;
never executed: return PossibleBoth;
0
1231 }-
1232 const QLatin1Char space(' ');-
1233 int size = sectionMaxSize(sectionIndex);-
1234-
1235 enum {-
1236 amindex = 0,-
1237 pmindex = 1-
1238 };-
1239 QString ampm[2];-
1240 ampm[amindex] = getAmPmText(AmText, s.count == 1 ? UpperCase : LowerCase);-
1241 ampm[pmindex] = getAmPmText(PmText, s.count == 1 ? UpperCase : LowerCase);-
1242 for (int i=0; i<2
i<2Description
TRUEevaluated 1726 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 863 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
; ++i)
863-1726
1243 ampm[i].truncate(size);
executed 1726 times by 5 tests: ampm[i].truncate(size);
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
1726
1244-
1245 if (false) QMessageLogger(__FILE__, 1404, __PRETTY_FUNCTION__).debug() << "findAmPm" << str << ampm[0] << ampm[1];
dead code: QMessageLogger(__FILE__, 1404, __PRETTY_FUNCTION__).debug() << "findAmPm" << str << ampm[0] << ampm[1];
-
1246-
1247 if (str.indexOf(ampm[amindex], 0, Qt::CaseInsensitive) == 0
str.indexOf(am...ensitive) == 0Description
TRUEevaluated 758 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 105 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
105-758
1248 str = ampm[amindex];-
1249 return
executed 758 times by 5 tests: return AM;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
AM;
executed 758 times by 5 tests: return AM;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
758
1250 } else if (str.indexOf(ampm[pmindex], 0, Qt::CaseInsensitive) == 0
str.indexOf(am...ensitive) == 0Description
TRUEevaluated 103 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
2-103
1251 str = ampm[pmindex];-
1252 return
executed 103 times by 3 tests: return PM;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
PM;
executed 103 times by 3 tests: return PM;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
103
1253 } else if (context == FromString
context == FromStringDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTime
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
|| (str.count(space) == 0
str.count(space) == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
&& str.size() >= size
str.size() >= sizeDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)) {
0-1
1254 return
executed 1 time by 1 test: return Neither;
Executed by:
  • tst_QDateTime
Neither;
executed 1 time by 1 test: return Neither;
Executed by:
  • tst_QDateTime
1
1255 }-
1256 size = qMin(size, str.size());-
1257-
1258 bool broken[2] = {false, false};-
1259 for (int i=0; i<size
i<sizeDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
; ++i) {
0-1
1260 if (str.at(i) != space
str.at(i) != spaceDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-1
1261 for (int j=0; j<2
j<2Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
; ++j) {
0-2
1262 if (!broken[j]
!broken[j]Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-2
1263 int index = ampm[j].indexOf(str.at(i));-
1264 if (false) QMessageLogger(__FILE__, 1423, __PRETTY_FUNCTION__).debug() << "looking for" << str.at(i)
dead code: QMessageLogger(__FILE__, 1423, __PRETTY_FUNCTION__).debug() << "looking for" << str.at(i) << "in" << ampm[j] << "and got" << index;
-
1265 << "in" << ampm[j] << "and got" << index;
dead code: QMessageLogger(__FILE__, 1423, __PRETTY_FUNCTION__).debug() << "looking for" << str.at(i) << "in" << ampm[j] << "and got" << index;
-
1266 if (index == -1
index == -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-2
1267 if (str.at(i).category() == QChar::Letter_Uppercase
str.at(i).cate...tter_UppercaseDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-2
1268 index = ampm[j].indexOf(str.at(i).toLower());-
1269 if (false) QMessageLogger(__FILE__, 1428, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toLower()
dead code: QMessageLogger(__FILE__, 1428, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toLower() << "in" << ampm[j] << "and got" << index;
-
1270 << "in" << ampm[j] << "and got" << index;
dead code: QMessageLogger(__FILE__, 1428, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toLower() << "in" << ampm[j] << "and got" << index;
-
1271 }
never executed: end of block
else if (str.at(i).category() == QChar::Letter_Lowercase
str.at(i).cate...tter_LowercaseDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-2
1272 index = ampm[j].indexOf(str.at(i).toUpper());-
1273 if (false) QMessageLogger(__FILE__, 1432, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toUpper()
dead code: QMessageLogger(__FILE__, 1432, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toUpper() << "in" << ampm[j] << "and got" << index;
-
1274 << "in" << ampm[j] << "and got" << index;
dead code: QMessageLogger(__FILE__, 1432, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toUpper() << "in" << ampm[j] << "and got" << index;
-
1275 }
never executed: end of block
0
1276 if (index == -1
index == -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-2
1277 broken[j] = true;-
1278 if (broken[amindex]
broken[amindex]Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
&& broken[pmindex]
broken[pmindex]Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-2
1279 if (false) QMessageLogger(__FILE__, 1438, __PRETTY_FUNCTION__).debug() << str << "didn't make it";
dead code: QMessageLogger(__FILE__, 1438, __PRETTY_FUNCTION__).debug() << str << "didn't make it";
-
1280 return
executed 1 time by 1 test: return Neither;
Executed by:
  • tst_QDateTimeEdit
Neither;
executed 1 time by 1 test: return Neither;
Executed by:
  • tst_QDateTimeEdit
1
1281 }-
1282 continue;
executed 1 time by 1 test: continue;
Executed by:
  • tst_QDateTimeEdit
1
1283 } else {-
1284 str[i] = ampm[j].at(index);-
1285 }
never executed: end of block
0
1286 }-
1287 ampm[j].remove(index, 1);-
1288 }
never executed: end of block
0
1289 }
never executed: end of block
0
1290 }
never executed: end of block
0
1291 }
never executed: end of block
0
1292 if (!broken[pmindex]
!broken[pmindex]Description
TRUEnever evaluated
FALSEnever evaluated
&& !broken[amindex]
!broken[amindex]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1293 return
never executed: return PossibleBoth;
PossibleBoth;
never executed: return PossibleBoth;
0
1294 return
never executed: return (!broken[amindex] ? PossibleAM : PossiblePM);
(!broken[amindex] ? PossibleAM : PossiblePM);
never executed: return (!broken[amindex] ? PossibleAM : PossiblePM);
0
1295}-
1296-
1297-
1298-
1299-
1300-
1301-
1302int QDateTimeParser::SectionNode::maxChange() const-
1303{-
1304 switch (type) {-
1305-
1306 case
never executed: case MSecSection:
MSecSection:
never executed: case MSecSection:
return
never executed: return 999;
999;
never executed: return 999;
0
1307 case
never executed: case SecondSection:
SecondSection:
never executed: case SecondSection:
return
never executed: return 59 * 1000;
59 * 1000;
never executed: return 59 * 1000;
0
1308 case
executed 11 times by 1 test: case MinuteSection:
Executed by:
  • tst_QDateTimeEdit
MinuteSection:
executed 11 times by 1 test: case MinuteSection:
Executed by:
  • tst_QDateTimeEdit
return
executed 11 times by 1 test: return 59 * 60 * 1000;
Executed by:
  • tst_QDateTimeEdit
59 * 60 * 1000;
executed 11 times by 1 test: return 59 * 60 * 1000;
Executed by:
  • tst_QDateTimeEdit
11
1309 case
executed 9 times by 1 test: case Hour24Section:
Executed by:
  • tst_QDateTimeEdit
Hour24Section:
executed 9 times by 1 test: case Hour24Section:
Executed by:
  • tst_QDateTimeEdit
case
never executed: case Hour12Section:
Hour12Section:
never executed: case Hour12Section:
return
executed 9 times by 1 test: return 59 * 60 * 60 * 1000;
Executed by:
  • tst_QDateTimeEdit
59 * 60 * 60 * 1000;
executed 9 times by 1 test: return 59 * 60 * 60 * 1000;
Executed by:
  • tst_QDateTimeEdit
0-9
1310-
1311-
1312 case
never executed: case DayOfWeekSectionShort:
DayOfWeekSectionShort:
never executed: case DayOfWeekSectionShort:
0
1313 case
never executed: case DayOfWeekSectionLong:
DayOfWeekSectionLong:
never executed: case DayOfWeekSectionLong:
return
never executed: return 7;
7;
never executed: return 7;
0
1314 case
never executed: case DaySection:
DaySection:
never executed: case DaySection:
return
never executed: return 30;
30;
never executed: return 30;
0
1315 case
never executed: case MonthSection:
MonthSection:
never executed: case MonthSection:
return
never executed: return 365 - 31;
365 - 31;
never executed: return 365 - 31;
0
1316 case
executed 29 times by 1 test: case YearSection:
Executed by:
  • tst_QDateTimeEdit
YearSection:
executed 29 times by 1 test: case YearSection:
Executed by:
  • tst_QDateTimeEdit
return
executed 29 times by 1 test: return 9999 * 365;
Executed by:
  • tst_QDateTimeEdit
9999 * 365;
executed 29 times by 1 test: return 9999 * 365;
Executed by:
  • tst_QDateTimeEdit
29
1317 case
executed 3 times by 1 test: case YearSection2Digits:
Executed by:
  • tst_QDateTimeEdit
YearSection2Digits:
executed 3 times by 1 test: case YearSection2Digits:
Executed by:
  • tst_QDateTimeEdit
return
executed 3 times by 1 test: return 100 * 365;
Executed by:
  • tst_QDateTimeEdit
100 * 365;
executed 3 times by 1 test: return 100 * 365;
Executed by:
  • tst_QDateTimeEdit
3
1318 default
never executed: default:
:
never executed: default:
0
1319 QMessageLogger(__FILE__, 1478, __PRETTY_FUNCTION__).warning("QDateTimeParser::maxChange() Internal error (%s)",-
1320 QString(name()).toLocal8Bit().constData());-
1321 }
never executed: end of block
0
1322-
1323 return
never executed: return -1;
-1;
never executed: return -1;
0
1324}-
1325-
1326QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const-
1327{-
1328 FieldInfo ret = 0;-
1329 const SectionNode &sn = sectionNode(index);-
1330 switch (sn.type) {-
1331 case
executed 221 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
MSecSection:
executed 221 times by 2 tests: case MSecSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
221
1332 ret |= Fraction;-
1333-
1334 case
executed 1712 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 1712 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
code before this statement executed 221 times by 2 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
221-1712
1335 case
executed 1922 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
MinuteSection:
executed 1922 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1922
1336 case
executed 1269 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1269 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1269
1337 case
executed 831 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
Hour12Section:
executed 831 times by 5 tests: case Hour12Section:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
831
1338 case
executed 1951 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 1951 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
1951
1339 case
executed 883 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
YearSection2Digits:
executed 883 times by 7 tests: case YearSection2Digits:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
883
1340 ret |= Numeric;-
1341 if (sn.type != YearSection
sn.type != YearSectionDescription
TRUEevaluated 6838 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 1951 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
) {
1951-6838
1342 ret |= AllowPartial;-
1343 }
executed 6838 times by 10 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
6838
1344 if (sn.count != 1
sn.count != 1Description
TRUEevaluated 8471 times by 11 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 318 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
) {
318-8471
1345 ret |= FixedWidth;-
1346 }
executed 8471 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
8471
1347 break;
executed 8789 times by 11 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
8789
1348 case
executed 1780 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
MonthSection:
executed 1780 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
1780
1349 case
executed 2734 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
DaySection:
executed 2734 times by 10 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
2734
1350 switch (sn.count) {-
1351 case
executed 3502 times by 7 tests: case 2:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
2:
executed 3502 times by 7 tests: case 2:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
3502
1352 ret |= FixedWidth;-
1353-
1354 case
executed 992 times by 7 tests: case 1:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
1:
executed 992 times by 7 tests: case 1:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
code before this statement executed 3502 times by 7 tests: case 1:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
992-3502
1355 ret |= (Numeric|AllowPartial);-
1356 break;
executed 4494 times by 10 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
4494
1357 }-
1358 break;
executed 4514 times by 10 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
4514
1359 case
never executed: case DayOfWeekSectionShort:
DayOfWeekSectionShort:
never executed: case DayOfWeekSectionShort:
0
1360 case
never executed: case DayOfWeekSectionLong:
DayOfWeekSectionLong:
never executed: case DayOfWeekSectionLong:
0
1361 if (sn.count == 3
sn.count == 3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1362 ret |= FixedWidth;
never executed: ret |= FixedWidth;
0
1363 break;
never executed: break;
0
1364 case
never executed: case AmPmSection:
AmPmSection:
never executed: case AmPmSection:
0
1365 ret |= FixedWidth;-
1366 break;
never executed: break;
0
1367 default
never executed: default:
:
never executed: default:
0
1368 QMessageLogger(__FILE__, 1527, __PRETTY_FUNCTION__).warning("QDateTimeParser::fieldInfo Internal error 2 (%d %s %d)",-
1369 index, QString(sn.name()).toLocal8Bit().constData(), sn.count);-
1370 break;
never executed: break;
0
1371 }-
1372 return
executed 13303 times by 11 tests: return ret;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
ret;
executed 13303 times by 11 tests: return ret;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QStyleSheetStyle
  • tst_QTime
13303
1373}-
1374-
1375QString QDateTimeParser::SectionNode::format() const-
1376{-
1377 QChar fillChar;-
1378 switch (type) {-
1379 case
never executed: case AmPmSection:
AmPmSection:
never executed: case AmPmSection:
return
never executed: return count == 1 ? QLatin1String("AP") : QLatin1String("ap");
count == 1 ? QLatin1String("AP") : QLatin1String("ap");
never executed: return count == 1 ? QLatin1String("AP") : QLatin1String("ap");
0
1380 case
never executed: case MSecSection:
MSecSection:
never executed: case MSecSection:
fillChar = QLatin1Char('z'); break;
never executed: break;
0
1381 case
never executed: case SecondSection:
SecondSection:
never executed: case SecondSection:
fillChar = QLatin1Char('s'); break;
never executed: break;
0
1382 case
never executed: case MinuteSection:
MinuteSection:
never executed: case MinuteSection:
fillChar = QLatin1Char('m'); break;
never executed: break;
0
1383 case
never executed: case Hour24Section:
Hour24Section:
never executed: case Hour24Section:
fillChar = QLatin1Char('H'); break;
never executed: break;
0
1384 case
never executed: case Hour12Section:
Hour12Section:
never executed: case Hour12Section:
fillChar = QLatin1Char('h'); break;
never executed: break;
0
1385 case
never executed: case DayOfWeekSectionShort:
DayOfWeekSectionShort:
never executed: case DayOfWeekSectionShort:
0
1386 case
never executed: case DayOfWeekSectionLong:
DayOfWeekSectionLong:
never executed: case DayOfWeekSectionLong:
0
1387 case
executed 2 times by 1 test: case DaySection:
Executed by:
  • tst_QDateTimeEdit
DaySection:
executed 2 times by 1 test: case DaySection:
Executed by:
  • tst_QDateTimeEdit
fillChar = QLatin1Char('d'); break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
2
1388 case
executed 2 times by 1 test: case MonthSection:
Executed by:
  • tst_QDateTimeEdit
MonthSection:
executed 2 times by 1 test: case MonthSection:
Executed by:
  • tst_QDateTimeEdit
fillChar = QLatin1Char('M'); break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
2
1389 case
never executed: case YearSection2Digits:
YearSection2Digits:
never executed: case YearSection2Digits:
0
1390 case
executed 2 times by 1 test: case YearSection:
Executed by:
  • tst_QDateTimeEdit
YearSection:
executed 2 times by 1 test: case YearSection:
Executed by:
  • tst_QDateTimeEdit
fillChar = QLatin1Char('y'); break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
2
1391 default
never executed: default:
:
never executed: default:
0
1392 QMessageLogger(__FILE__, 1551, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionFormat Internal error (%s)",-
1393 QString(name(type)).toLocal8Bit().constData());-
1394 return
never executed: return QString();
QString();
never executed: return QString();
0
1395 }-
1396 if (fillChar.isNull()
fillChar.isNull()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-6
1397 QMessageLogger(__FILE__, 1556, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionFormat Internal error 2");-
1398 return
never executed: return QString();
QString();
never executed: return QString();
0
1399 }-
1400 return
executed 6 times by 1 test: return QString(count, fillChar);
Executed by:
  • tst_QDateTimeEdit
QString(count, fillChar);
executed 6 times by 1 test: return QString(count, fillChar);
Executed by:
  • tst_QDateTimeEdit
6
1401}-
1402bool QDateTimeParser::potentialValue(const QStringRef &str, int min, int max, int index,-
1403 const QDateTime &currentValue, int insert) const-
1404{-
1405 if (str.isEmpty()
str.isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 1610 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
3-1610
1406 return
executed 3 times by 1 test: return true;
Executed by:
  • tst_QDateTimeEdit
true;
executed 3 times by 1 test: return true;
Executed by:
  • tst_QDateTimeEdit
3
1407 }-
1408 const int size = sectionMaxSize(index);-
1409 int val = (int)locale().toUInt(str);-
1410 const SectionNode &sn = sectionNode(index);-
1411 if (sn.type == YearSection2Digits
sn.type == YearSection2DigitsDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
FALSEevaluated 1590 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
20-1590
1412 const int year = currentValue.date().year();-
1413 val += year - (year % 100);-
1414 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
20
1415 if (val >= min
val >= minDescription
TRUEevaluated 1409 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 201 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& val <= max
val <= maxDescription
TRUEevaluated 999 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 410 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
&& str.size() == size
str.size() == sizeDescription
TRUEevaluated 495 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 504 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
201-1409
1416 return
executed 495 times by 4 tests: return true;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
true;
executed 495 times by 4 tests: return true;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
495
1417 } else if (val > max
val > maxDescription
TRUEevaluated 410 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 705 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
410-705
1418 return
executed 410 times by 1 test: return false;
Executed by:
  • tst_QDateTimeEdit
false;
executed 410 times by 1 test: return false;
Executed by:
  • tst_QDateTimeEdit
410
1419 } else if (str.size() == size
str.size() == sizeDescription
TRUEevaluated 115 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 590 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
&& val < min
val < minDescription
TRUEevaluated 115 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-590
1420 return
executed 115 times by 1 test: return false;
Executed by:
  • tst_QDateTimeEdit
false;
executed 115 times by 1 test: return false;
Executed by:
  • tst_QDateTimeEdit
115
1421 }-
1422-
1423 const int len = size - str.size();-
1424 for (int i=0; i<len
i<lenDescription
TRUEevaluated 590 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 45 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++i) {
45-590
1425 for (int j=0; j<10
j<10Description
TRUEevaluated 1061 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 45 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++j) {
45-1061
1426 if (potentialValue(str + QLatin1Char('0' + j), min, max, index, currentValue, insert)
potentialValue...Value, insert)Description
TRUEevaluated 542 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 519 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
519-542
1427 return
executed 542 times by 4 tests: return true;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
true;
executed 542 times by 4 tests: return true;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
542
1428 } else if (insert >= 0
insert >= 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 510 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
9-510
1429 const QString tmp = str.left(insert) + QLatin1Char('0' + j) + str.mid(insert);-
1430 if (potentialValue(tmp, min, max, index, currentValue, insert)
potentialValue...Value, insert)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
3-6
1431 return
executed 3 times by 1 test: return true;
Executed by:
  • tst_QDateTimeEdit
true;
executed 3 times by 1 test: return true;
Executed by:
  • tst_QDateTimeEdit
3
1432 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
6
1433 }
executed 516 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
516
1434 }
executed 45 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
45
1435-
1436 return
executed 45 times by 1 test: return false;
Executed by:
  • tst_QDateTimeEdit
false;
executed 45 times by 1 test: return false;
Executed by:
  • tst_QDateTimeEdit
45
1437}-
1438-
1439bool QDateTimeParser::skipToNextSection(int index, const QDateTime &current, const QStringRef &text) const-
1440{-
1441 ((!(current >= getMinimum() && current <= getMaximum())) ? qt_assert("current >= getMinimum() && current <= getMaximum()",__FILE__,1609) : qt_noop());-
1442-
1443 const SectionNode &node = sectionNode(index);-
1444 ((!(text.size() < sectionMaxSize(index))) ? qt_assert("text.size() < sectionMaxSize(index)",__FILE__,1612) : qt_noop());-
1445-
1446 const QDateTime maximum = getMaximum();-
1447 const QDateTime minimum = getMinimum();-
1448 QDateTime tmp = current;-
1449 int min = absoluteMin(index);-
1450 setDigit(tmp, index, min);-
1451 if (tmp < minimum
tmp < minimumDescription
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 474 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
17-474
1452 min = getDigit(minimum, index);-
1453 }
executed 17 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
17
1454-
1455 int max = absoluteMax(index, current);-
1456 setDigit(tmp, index, max);-
1457 if (tmp > maximum
tmp > maximumDescription
TRUEevaluated 33 times by 2 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
FALSEevaluated 458 times by 3 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
) {
33-458
1458 max = getDigit(maximum, index);-
1459 }
executed 33 times by 2 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
33
1460 int pos = cursorPosition() - node.pos;-
1461 if (pos < 0
pos < 0Description
TRUEevaluated 12 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 479 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
|| pos >= text.size()
pos >= text.size()Description
TRUEevaluated 472 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
7-479
1462 pos = -1;
executed 484 times by 4 tests: pos = -1;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
484
1463-
1464 const bool potential = potentialValue(text, min, max, index, current, pos);-
1465 return
executed 491 times by 4 tests: return !potential;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
!potential;
executed 491 times by 4 tests: return !potential;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
491
1466-
1467-
1468-
1469-
1470-
1471-
1472}-
1473-
1474-
1475-
1476-
1477-
1478-
1479QString QDateTimeParser::SectionNode::name(QDateTimeParser::Section s)-
1480{-
1481 switch (s) {-
1482 case
never executed: case QDateTimeParser::AmPmSection:
QDateTimeParser::AmPmSection:
never executed: case QDateTimeParser::AmPmSection:
return
never executed: return QLatin1String("AmPmSection");
QLatin1String("AmPmSection");
never executed: return QLatin1String("AmPmSection");
0
1483 case
never executed: case QDateTimeParser::DaySection:
QDateTimeParser::DaySection:
never executed: case QDateTimeParser::DaySection:
return
never executed: return QLatin1String("DaySection");
QLatin1String("DaySection");
never executed: return QLatin1String("DaySection");
0
1484 case
never executed: case QDateTimeParser::DayOfWeekSectionShort:
QDateTimeParser::DayOfWeekSectionShort:
never executed: case QDateTimeParser::DayOfWeekSectionShort:
return
never executed: return QLatin1String("DayOfWeekSectionShort");
QLatin1String("DayOfWeekSectionShort");
never executed: return QLatin1String("DayOfWeekSectionShort");
0
1485 case
never executed: case QDateTimeParser::DayOfWeekSectionLong:
QDateTimeParser::DayOfWeekSectionLong:
never executed: case QDateTimeParser::DayOfWeekSectionLong:
return
never executed: return QLatin1String("DayOfWeekSectionLong");
QLatin1String("DayOfWeekSectionLong");
never executed: return QLatin1String("DayOfWeekSectionLong");
0
1486 case
never executed: case QDateTimeParser::Hour24Section:
QDateTimeParser::Hour24Section:
never executed: case QDateTimeParser::Hour24Section:
return
never executed: return QLatin1String("Hour24Section");
QLatin1String("Hour24Section");
never executed: return QLatin1String("Hour24Section");
0
1487 case
never executed: case QDateTimeParser::Hour12Section:
QDateTimeParser::Hour12Section:
never executed: case QDateTimeParser::Hour12Section:
return
never executed: return QLatin1String("Hour12Section");
QLatin1String("Hour12Section");
never executed: return QLatin1String("Hour12Section");
0
1488 case
never executed: case QDateTimeParser::MSecSection:
QDateTimeParser::MSecSection:
never executed: case QDateTimeParser::MSecSection:
return
never executed: return QLatin1String("MSecSection");
QLatin1String("MSecSection");
never executed: return QLatin1String("MSecSection");
0
1489 case
never executed: case QDateTimeParser::MinuteSection:
QDateTimeParser::MinuteSection:
never executed: case QDateTimeParser::MinuteSection:
return
never executed: return QLatin1String("MinuteSection");
QLatin1String("MinuteSection");
never executed: return QLatin1String("MinuteSection");
0
1490 case
never executed: case QDateTimeParser::MonthSection:
QDateTimeParser::MonthSection:
never executed: case QDateTimeParser::MonthSection:
return
never executed: return QLatin1String("MonthSection");
QLatin1String("MonthSection");
never executed: return QLatin1String("MonthSection");
0
1491 case
never executed: case QDateTimeParser::SecondSection:
QDateTimeParser::SecondSection:
never executed: case QDateTimeParser::SecondSection:
return
never executed: return QLatin1String("SecondSection");
QLatin1String("SecondSection");
never executed: return QLatin1String("SecondSection");
0
1492 case
never executed: case QDateTimeParser::YearSection:
QDateTimeParser::YearSection:
never executed: case QDateTimeParser::YearSection:
return
never executed: return QLatin1String("YearSection");
QLatin1String("YearSection");
never executed: return QLatin1String("YearSection");
0
1493 case
never executed: case QDateTimeParser::YearSection2Digits:
QDateTimeParser::YearSection2Digits:
never executed: case QDateTimeParser::YearSection2Digits:
return
never executed: return QLatin1String("YearSection2Digits");
QLatin1String("YearSection2Digits");
never executed: return QLatin1String("YearSection2Digits");
0
1494 case
never executed: case QDateTimeParser::NoSection:
QDateTimeParser::NoSection:
never executed: case QDateTimeParser::NoSection:
return
never executed: return QLatin1String("NoSection");
QLatin1String("NoSection");
never executed: return QLatin1String("NoSection");
0
1495 case
never executed: case QDateTimeParser::FirstSection:
QDateTimeParser::FirstSection:
never executed: case QDateTimeParser::FirstSection:
return
never executed: return QLatin1String("FirstSection");
QLatin1String("FirstSection");
never executed: return QLatin1String("FirstSection");
0
1496 case
never executed: case QDateTimeParser::LastSection:
QDateTimeParser::LastSection:
never executed: case QDateTimeParser::LastSection:
return
never executed: return QLatin1String("LastSection");
QLatin1String("LastSection");
never executed: return QLatin1String("LastSection");
0
1497 default
never executed: default:
:
never executed: default:
return
never executed: return QLatin1String("Unknown section ") + QString::number(int(s));
QLatin1String("Unknown section ") + QString::number(int(s));
never executed: return QLatin1String("Unknown section ") + QString::number(int(s));
0
1498 }-
1499}-
1500-
1501-
1502-
1503-
1504-
1505-
1506QString QDateTimeParser::stateName(State s) const-
1507{-
1508 switch (s) {-
1509 case
never executed: case Invalid:
Invalid:
never executed: case Invalid:
return
never executed: return QLatin1String("Invalid");
QLatin1String("Invalid");
never executed: return QLatin1String("Invalid");
0
1510 case
never executed: case Intermediate:
Intermediate:
never executed: case Intermediate:
return
never executed: return QLatin1String("Intermediate");
QLatin1String("Intermediate");
never executed: return QLatin1String("Intermediate");
0
1511 case
never executed: case Acceptable:
Acceptable:
never executed: case Acceptable:
return
never executed: return QLatin1String("Acceptable");
QLatin1String("Acceptable");
never executed: return QLatin1String("Acceptable");
0
1512 default
never executed: default:
:
never executed: default:
return
never executed: return QLatin1String("Unknown state ") + QString::number(s);
QLatin1String("Unknown state ") + QString::number(s);
never executed: return QLatin1String("Unknown state ") + QString::number(s);
0
1513 }-
1514}-
1515-
1516-
1517bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) const-
1518{-
1519 QDateTime val(QDate(1900, 1, 1), QTime(0, 0, 0, 0));-
1520 QString text = t;-
1521 int copy = -1;-
1522 const StateNode tmp = parse(text, copy, val, false);-
1523 if (tmp.state != Acceptable
tmp.state != AcceptableDescription
TRUEevaluated 143 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QTime
FALSEevaluated 465 times by 8 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
|| tmp.conflicts
tmp.conflictsDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QTime
FALSEevaluated 460 times by 8 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
) {
5-465
1524 return
executed 148 times by 4 tests: return false;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QTime
false;
executed 148 times by 4 tests: return false;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QTime
148
1525 }-
1526 if (time
timeDescription
TRUEevaluated 424 times by 7 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_QDate
) {
36-424
1527 const QTime t = tmp.value.time();-
1528 if (!t.isValid()
!t.isValid()Description
TRUEnever evaluated
FALSEevaluated 424 times by 7 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
) {
0-424
1529 return
never executed: return false;
false;
never executed: return false;
0
1530 }-
1531 *time = t;-
1532 }
executed 424 times by 7 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
424
1533-
1534 if (date
dateDescription
TRUEevaluated 454 times by 7 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QTime
) {
6-454
1535 const QDate d = tmp.value.date();-
1536 if (!d.isValid()
!d.isValid()Description
TRUEnever evaluated
FALSEevaluated 454 times by 7 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
) {
0-454
1537 return
never executed: return false;
false;
never executed: return false;
0
1538 }-
1539 *date = d;-
1540 }
executed 454 times by 7 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
454
1541 return
executed 460 times by 8 tests: return true;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
true;
executed 460 times by 8 tests: return true;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
460
1542}-
1543-
1544-
1545QDateTime QDateTimeParser::getMinimum() const-
1546{-
1547 return
executed 1121 times by 8 tests: return QDateTime(QDate(100, 1, 1), QTime(0, 0, 0, 0), spec);
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
QDateTime(QDate(100, 1, 1), QTime(0, 0, 0, 0), spec);
executed 1121 times by 8 tests: return QDateTime(QDate(100, 1, 1), QTime(0, 0, 0, 0), spec);
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1121
1548}-
1549-
1550QDateTime QDateTimeParser::getMaximum() const-
1551{-
1552 return
executed 1079 times by 8 tests: return QDateTime(QDate(7999, 12, 31), QTime(23, 59, 59, 999), spec);
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
QDateTime(QDate(7999, 12, 31), QTime(23, 59, 59, 999), spec);
executed 1079 times by 8 tests: return QDateTime(QDate(7999, 12, 31), QTime(23, 59, 59, 999), spec);
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1079
1553}-
1554-
1555QString QDateTimeParser::getAmPmText(AmPm ap, Case cs) const-
1556{-
1557 const QLocale loc = locale();-
1558 QString raw = ap == AmText
ap == AmTextDescription
TRUEevaluated 60 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QTime
FALSEevaluated 60 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QTime
? loc.amText() : loc.pmText();
60
1559 return
executed 120 times by 2 tests: return cs == UpperCase ? raw.toUpper() : raw.toLower();
Executed by:
  • tst_QDateTime
  • tst_QTime
cs == UpperCase ? raw.toUpper() : raw.toLower();
executed 120 times by 2 tests: return cs == UpperCase ? raw.toUpper() : raw.toLower();
Executed by:
  • tst_QDateTime
  • tst_QTime
120
1560}-
1561-
1562-
1563-
1564-
1565-
1566-
1567-
1568bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::SectionNode &s2)-
1569{-
1570 return
never executed: return (s1.type == s2.type) && (s1.pos == s2.pos) && (s1.count == s2.count);
(s1.type == s2.type) && (s1.pos == s2.pos) && (s1.count == s2.count);
never executed: return (s1.type == s2.type) && (s1.pos == s2.pos) && (s1.count == s2.count);
0
1571}-
1572-
1573-
1574-
1575-
Switch to Source codePreprocessed file

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