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__, 70, __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
t.time().hour() > 11Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
? 1 : 0;
executed 6 times by 1 test: return t.time().hour() > 11 ? 1 : 0;
Executed by:
  • tst_QDateTimeEdit
2-6
27-
28 default
never executed: default:
:
never executed: default:
break;
never executed: break;
0
29 }-
30-
31-
32 QMessageLogger(__FILE__, 95, __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__, 119, __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 int year = v.date().year();-
53 int month = v.date().month();-
54 int day = v.date().day();-
55 int hour = v.time().hour();-
56 int minute = v.time().minute();-
57 int second = v.time().second();-
58 int msec = v.time().msec();-
59-
60 switch (node.type) {-
61 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
62 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
63 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
64 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
65 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
66 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
67 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
68 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
69 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
70 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
71 if (newVal > 31
newVal > 31Description
TRUEnever evaluated
FALSEevaluated 1548 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
0-1548
72-
73-
74-
75 return
never executed: return false;
false;
never executed: return false;
0
76 }-
77 day = newVal;-
78 break;
executed 1548 times by 2 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
1548
79 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
80 default
never executed: default:
:
never executed: default:
0
81 QMessageLogger(__FILE__, 157, __PRETTY_FUNCTION__).warning("QDateTimeParser::setDigit() Internal error (%s)",-
82 QString(node.name()).toLocal8Bit().constData());-
83 break;
never executed: break;
0
84 }-
85-
86 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
87 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
88 day = cachedDay;
executed 21 times by 1 test: day = cachedDay;
Executed by:
  • tst_QDateTimeEdit
21
89 const int max = QDate(year, month, 1).daysInMonth();-
90 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
91 day = max;-
92 }
executed 76 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
76
93 }
executed 2762 times by 6 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
2762
94 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
95 v = QDateTime(QDate(year, month, day), QTime(hour, minute, second, msec), spec);-
96 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
97 }-
98 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
99}-
100int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const-
101{-
102 const SectionNode &sn = sectionNode(s);-
103 switch (sn.type) {-
104 case
executed 1695 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1695 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1695
105 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 2852 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 2852 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-2852
106-
107-
108 case
executed 2298 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 2298 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
2298
109 case
executed 2086 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 2086 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
return
executed 4384 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 4384 times by 8 tests: return 59;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
2086-4384
110 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
111 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
112 case
executed 2015 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 2015 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
return
executed 3454 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 3454 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
2015-3454
113-
114-
115-
116 case
executed 1934 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
MonthSection:
executed 1934 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
return
executed 1934 times by 7 tests: return 12;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
12;
executed 1934 times by 7 tests: return 12;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
1934
117 case
executed 2960 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 2960 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
2960
118 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
119 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 4063 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.isValid()Description
TRUEevaluated 1391 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 2672 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
? cur.date().daysInMonth() : 31;
executed 4063 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-4063
120 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
121 default
never executed: default:
:
never executed: default:
break;
never executed: break;
0
122 }-
123 QMessageLogger(__FILE__, 208, __PRETTY_FUNCTION__).warning("QDateTimeParser::absoluteMax() Internal error (%s)",-
124 QString(sn.name()).toLocal8Bit().constData());-
125 return
never executed: return -1;
-1;
never executed: return -1;
0
126}-
127-
128-
129-
130-
131-
132-
133-
134int QDateTimeParser::absoluteMin(int s) const-
135{-
136 const SectionNode &sn = sectionNode(s);-
137 switch (sn.type) {-
138 case
executed 1695 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1695 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1695
139 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
140 case
executed 2287 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 2287 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
2287
141 case
executed 2074 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 2074 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
2074
142 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
143 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
144 case
executed 2015 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 2015 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
return
executed 10901 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 10901 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
2015-10901
145 case
executed 1922 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
MonthSection:
executed 1922 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
1922
146 case
executed 2936 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 2936 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
2936
147 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
148 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 5961 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 5961 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-5961
149 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
150 default
never executed: default:
:
never executed: default:
break;
never executed: break;
0
151 }-
152 QMessageLogger(__FILE__, 237, __PRETTY_FUNCTION__).warning("QDateTimeParser::absoluteMin() Internal error (%s, %0x)",-
153 QString(sn.name()).toLocal8Bit().constData(), sn.type);-
154 return
never executed: return -1;
-1;
never executed: return -1;
0
155}-
156-
157-
158-
159-
160-
161-
162-
163const QDateTimeParser::SectionNode &QDateTimeParser::sectionNode(int sectionIndex) const-
164{-
165 if (sectionIndex < 0
sectionIndex < 0Description
TRUEevaluated 739 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 148325 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
) {
739-148325
166 switch (sectionIndex) {-
167 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
168 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
169 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
170 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
171 case
executed 503 times by 7 tests: case NoSectionIndex:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
NoSectionIndex:
executed 503 times by 7 tests: case NoSectionIndex:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
503
172 return
executed 503 times by 7 tests: return none;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
none;
executed 503 times by 7 tests: return none;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
503
173 }-
174 }
never executed: end of block
else if (sectionIndex < sectionNodes.size()
sectionIndex <...onNodes.size()Description
TRUEevaluated 148325 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-148325
175 return
executed 148325 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 148325 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
148325
176 }-
177-
178 QMessageLogger(__FILE__, 263, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionNode() Internal error (%d)",-
179 sectionIndex);-
180 return
never executed: return none;
none;
never executed: return none;
0
181}-
182-
183QDateTimeParser::Section QDateTimeParser::sectionType(int sectionIndex) const-
184{-
185 return
executed 6721 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 6721 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
6721
186}-
187int QDateTimeParser::sectionPos(int sectionIndex) const-
188{-
189 return
executed 49308 times by 4 tests: return sectionPos(sectionNode(sectionIndex));
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
sectionPos(sectionNode(sectionIndex));
executed 49308 times by 4 tests: return sectionPos(sectionNode(sectionIndex));
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
49308
190}-
191-
192int QDateTimeParser::sectionPos(const SectionNode &sn) const-
193{-
194 switch (sn.type) {-
195 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
196 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
197 default
executed 51851 times by 4 tests: default:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
:
executed 51851 times by 4 tests: default:
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
break;
executed 51851 times by 4 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
51851
198 }-
199 if (sn.pos == -1
sn.pos == -1Description
TRUEnever evaluated
FALSEevaluated 51851 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
0-51851
200 QMessageLogger(__FILE__, 293, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionPos Internal error (%s)", QString(sn.name()).toLocal8Bit().constData());-
201 return
never executed: return -1;
-1;
never executed: return -1;
0
202 }-
203 return
executed 51851 times by 4 tests: return sn.pos;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
sn.pos;
executed 51851 times by 4 tests: return sn.pos;
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
51851
204}-
205static QString unquote(const QString &str)-
206{-
207 const QChar quote(QLatin1Char('\''));-
208 const QChar slash(QLatin1Char('\\'));-
209 const QChar zero(QLatin1Char('0'));-
210 QString ret;-
211 QChar status(zero);-
212 const int max = str.size();-
213 for (int i=0; i<max
i<maxDescription
TRUEevaluated 506 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 1021 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) {
506-1021
214 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 485 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
) {
21-485
215 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
216 status = quote;-
217 }
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
218 ret[ret.size() - 1] = quote;-
219 }
never executed: end of block
else {
0
220 status = zero;-
221 }
executed 10 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
10
222 } else {-
223 ret += str.at(i);-
224 }
executed 485 times by 5 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
485
225 }-
226 return
executed 1021 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 1021 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
1021
227}-
228static inline int countRepeat(const QString &str, int index, int maxCount)-
229{-
230 int count = 1;-
231 const QChar ch(str.at(index));-
232 const int max = qMin(index + maxCount, str.size());-
233 while (index + count < max
index + count < maxDescription
TRUEevaluated 8271 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 2100 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 6281 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 1990 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
) {
1990-8271
234 ++count;-
235 }
executed 6281 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
6281
236 return
executed 4090 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 4090 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
4090
237}-
238-
239static inline void appendSeparator(QStringList *list, const QString &string, int from, int size, int lastQuote)-
240{-
241 QString str(string.mid(from, size));-
242 if (lastQuote >= from
lastQuote >= fromDescription
TRUEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
FALSEevaluated 3177 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
)
10-3177
243 str = unquote(str);
executed 10 times by 4 tests: str = unquote(str);
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
10
244 list->append(str);-
245}
executed 3187 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
3187
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 1179 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-1179
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__, 368, __PRETTY_FUNCTION__).debug("parseFormat: %s", newFormat.toLatin1().constData());
dead code: QMessageLogger(__FILE__, 368, __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 7522 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 1181 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) {
1181-7522
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 7501 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-7501
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 7462 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-7462
277 const char sect = newFormat.at(i).toLatin1();-
278 switch (sect) {-
279 case
executed 111 times by 4 tests: case 'H':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QTime
'H':
executed 111 times by 4 tests: case 'H':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QTime
111
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 427 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-427
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 111 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 111 times by 4 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QTime
? Hour12Section : Hour24Section;
111-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 427 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
427
290 break;
executed 430 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
430
291 case
executed 409 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 409 times by 8 tests: case 'm':
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
409
292 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 409 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-409
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 409 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
409
300 break;
executed 409 times by 8 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
409
301 case
executed 260 times by 4 tests: case 's':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
's':
executed 260 times by 4 tests: case 's':
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
260
302 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 260 times by 4 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
FALSEnever evaluated
) {
0-260
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 260 times by 4 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
260
310 break;
executed 260 times by 4 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
260
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 893 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 893 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
893
338 if (parserType != QVariant::Time
parserType != QVariant::TimeDescription
TRUEevaluated 889 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-889
339 const int repeat = countRepeat(newFormat, i, 4);-
340 if (repeat >= 2
repeat >= 2Description
TRUEevaluated 888 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-888
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 888 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
888
349 }
executed 889 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
889
350 break;
executed 893 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
893
351 case
executed 1011 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 1011 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
1011
352 if (parserType != QVariant::Time
parserType != QVariant::TimeDescription
TRUEevaluated 1011 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-1011
353 const SectionNode sn = { MonthSection, i - add, countRepeat(newFormat, i, 4), 0 };-
354 newSectionNodes.append(sn);-
355 newSeparators.append(unquote(newFormat.mid(index, i - index)));-
356 i += sn.count - 1;-
357 index = i + 1;-
358 newDisplay |= MonthSection;-
359 }
executed 1011 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
1011
360 break;
executed 1011 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
1011
361 case
executed 1047 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 1047 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
1047
362 if (parserType != QVariant::Time
parserType != QVariant::TimeDescription
TRUEevaluated 1047 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-1047
363 const int repeat = countRepeat(newFormat, i, 4);-
364 const Section sectionType = (repeat == 4
repeat == 4Description
TRUEevaluated 49 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 998 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
49-998
365 : (repeat == 3
repeat == 3Description
TRUEevaluated 6 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 992 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-992
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 1047 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
1047
373 break;
executed 1047 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
1047
374-
375 default
executed 3270 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 3270 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
3270
376 break;
executed 3270 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
3270
377 }-
378 }-
379 }
executed 7522 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
7522
380 if (newSectionNodes.isEmpty()
newSectionNodes.isEmpty()Description
TRUEevaluated 11 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 1170 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-1170
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 961 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 961 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-961
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 1163 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-1163
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 1163 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
1163
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__, 520, __PRETTY_FUNCTION__).debug() << newFormat << displayFormat;
dead code: QMessageLogger(__FILE__, 520, __PRETTY_FUNCTION__).debug() << newFormat << displayFormat;
-
410 if (false) QMessageLogger(__FILE__, 521, __PRETTY_FUNCTION__).debug("separators:\n'%s'", separators.join(QLatin1String("\n")).toLatin1().constData());
dead code: QMessageLogger(__FILE__, 521, __PRETTY_FUNCTION__).debug("separators:\n'%s'", separators.join(QLatin1String("\n")).toLatin1().constData());
-
411-
412 return
executed 1179 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 1179 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
1179
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__, 538, __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 if (displayText().size() != text.size()
displayText()....!= 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
438-
439 int preceedingZeroesAdded = 0;-
440 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
441 for (QVector<SectionNode>::ConstIterator sectionIt = sectionNodes.constBegin();-
442 sectionIt != sectionNodes.constBegin() + sectionIndex
sectionIt != s...+ sectionIndexDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
; ++sectionIt) {
23-40
443 preceedingZeroesAdded += sectionIt->zeroesAdded;-
444 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
40
445 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
23
446 sizeAdjustment = preceedingZeroesAdded;-
447 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
23
448-
449 return
executed 4554 times by 1 test: return displayText().size() + sizeAdjustment - sectionPos(sectionIndex) - separators.last().size();
Executed by:
  • tst_QDateTimeEdit
displayText().size() + sizeAdjustment - sectionPos(sectionIndex) - separators.last().size();
executed 4554 times by 1 test: return displayText().size() + sizeAdjustment - sectionPos(sectionIndex) - separators.last().size();
Executed by:
  • tst_QDateTimeEdit
4554
450 } else {-
451 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
452 - 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
453 }-
454}-
455-
456-
457int QDateTimeParser::sectionMaxSize(Section s, int count) const-
458{-
459-
460 int mcount = 12;-
461-
462-
463 switch (s) {-
464 case
never executed: case FirstSection:
FirstSection:
never executed: case FirstSection:
0
465 case
never executed: case NoSection:
NoSection:
never executed: case NoSection:
0
466 case
never executed: case LastSection:
LastSection:
never executed: case LastSection:
return
never executed: return 0;
0;
never executed: return 0;
0
467-
468 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
469 const int lowerMax = qMin(getAmPmText(AmText, LowerCase).size(),-
470 getAmPmText(PmText, LowerCase).size());-
471 const int upperMax = qMin(getAmPmText(AmText, UpperCase).size(),-
472 getAmPmText(PmText, UpperCase).size());-
473 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
474 }-
475-
476 case
executed 1513 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1513 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1513
477 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
478 case
executed 2262 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 2262 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
2262
479 case
executed 1955 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 1955 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
1955
480 case
executed 3203 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 3203 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 9876 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 9876 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
3203-9876
481 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
482 case
executed 442 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 442 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
442
483-
484-
485-
486 mcount = 7;-
487-
488-
489 case
executed 3657 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 3657 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 482 times by 3 tests: case MonthSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
482-3657
490-
491-
492-
493 if (count <= 2
count <= 2Description
TRUEevaluated 2217 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
FALSEevaluated 1922 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
)
1922-2217
494 return
executed 2217 times by 7 tests: return 2;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
2;
executed 2217 times by 7 tests: return 2;
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
2217
495-
496 {-
497 int ret = 0;-
498 const QLocale l = locale();-
499 const QLocale::FormatType format = count == 4
count == 4Description
TRUEevaluated 655 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 1267 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
? QLocale::LongFormat : QLocale::ShortFormat;
655-1267
500 for (int i=1; i<=mcount
i<=mcountDescription
TRUEevaluated 20654 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 1922 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
; ++i) {
1922-20654
501 const QString str = (s == MonthSection
s == MonthSectionDescription
TRUEevaluated 17280 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 3374 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
3374-17280
502 ? l.monthName(i, format)-
503 : l.dayName(i, format));-
504 ret = qMax(str.size(), ret);-
505 }
executed 20654 times by 6 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
20654
506 return
executed 1922 times by 6 tests: return ret;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
ret;
executed 1922 times by 6 tests: return ret;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1922
507 }-
508-
509 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
510 case
executed 2142 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 2142 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
return
executed 2142 times by 6 tests: return 4;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
4;
executed 2142 times by 6 tests: return 4;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
2142
511 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
512-
513 case
never executed: case CalendarPopupSection:
CalendarPopupSection:
never executed: case CalendarPopupSection:
0
514 case
never executed: case Internal:
Internal:
never executed: case Internal:
0
515 case
never executed: case TimeSectionMask:
TimeSectionMask:
never executed: case TimeSectionMask:
0
516 case
never executed: case DateSectionMask:
DateSectionMask:
never executed: case DateSectionMask:
0
517 case
never executed: case HourSectionMask:
HourSectionMask:
never executed: case HourSectionMask:
0
518 case
never executed: case YearSectionMask:
YearSectionMask:
never executed: case YearSectionMask:
0
519 case
never executed: case DayOfWeekSectionMask:
DayOfWeekSectionMask:
never executed: case DayOfWeekSectionMask:
0
520 case
never executed: case DaySectionMask:
DaySectionMask:
never executed: case DaySectionMask:
0
521 QMessageLogger(__FILE__, 632, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionMaxSize: Invalid section %s",-
522 SectionNode::name(s).toLatin1().constData());-
523-
524 case
never executed: case NoSectionIndex:
NoSectionIndex:
never executed: case NoSectionIndex:
code before this statement never executed: case NoSectionIndex:
0
525 case
never executed: case FirstSectionIndex:
FirstSectionIndex:
never executed: case FirstSectionIndex:
0
526 case
never executed: case LastSectionIndex:
LastSectionIndex:
never executed: case LastSectionIndex:
0
527 case
never executed: case CalendarPopupIndex:
CalendarPopupIndex:
never executed: case CalendarPopupIndex:
0
528-
529 break;
never executed: break;
0
530 }-
531 return
never executed: return -1;
-1;
never executed: return -1;
0
532}-
533-
534-
535int QDateTimeParser::sectionMaxSize(int index) const-
536{-
537 const SectionNode &sn = sectionNode(index);-
538 return
executed 19073 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 19073 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
19073
539}-
540QString QDateTimeParser::sectionText(const QString &text, int sectionIndex, int index) const-
541{-
542 const SectionNode &sn = sectionNode(sectionIndex);-
543 switch (sn.type) {-
544 case
never executed: case NoSectionIndex:
NoSectionIndex:
never executed: case NoSectionIndex:
0
545 case
never executed: case FirstSectionIndex:
FirstSectionIndex:
never executed: case FirstSectionIndex:
0
546 case
never executed: case LastSectionIndex:
LastSectionIndex:
never executed: case LastSectionIndex:
0
547 return
never executed: return QString();
QString();
never executed: return QString();
0
548 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
549 }-
550-
551 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
552}-
553-
554QString QDateTimeParser::sectionText(int sectionIndex) const-
555{-
556 const SectionNode &sn = sectionNode(sectionIndex);-
557 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
558}-
559int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,-
560 QString &text, int &cursorPosition, int index,-
561 State &state, int *usedptr) const-
562{-
563 state = Invalid;-
564 int num = 0;-
565 const SectionNode &sn = sectionNode(sectionIndex);-
566 if ((
(sn.type & Int...l) == InternalDescription
TRUEnever evaluated
FALSEevaluated 15944 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 15944 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-15944
567 QMessageLogger(__FILE__, 698, __PRETTY_FUNCTION__).warning("QDateTimeParser::parseSection Internal error (%s %d)",-
568 QString(sn.name()).toLocal8Bit().constData(), sectionIndex);-
569 return
never executed: return -1;
-1;
never executed: return -1;
0
570 }-
571-
572 const int sectionmaxsize = sectionMaxSize(sectionIndex);-
573 QString sectiontext = text.mid(index, sectionmaxsize);-
574 int sectiontextSize = sectiontext.size();-
575-
576 if (false) QMessageLogger(__FILE__, 707, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name()
dead code: QMessageLogger(__FILE__, 707, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectiontext << text.mid(index, sectionmaxsize) << index;
-
577 << "with text" << text << "and st" << sectiontext
dead code: QMessageLogger(__FILE__, 707, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectiontext << text.mid(index, sectionmaxsize) << index;
-
578 << text.mid(index, sectionmaxsize)
dead code: QMessageLogger(__FILE__, 707, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectiontext << text.mid(index, sectionmaxsize) << index;
-
579 << index;
dead code: QMessageLogger(__FILE__, 707, __PRETTY_FUNCTION__).debug() << "sectionValue for" << sn.name() << "with text" << text << "and st" << sectiontext << text.mid(index, sectionmaxsize) << index;
-
580-
581 int used = 0;-
582 switch (sn.type) {-
583 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
584 const int ampm = findAmPm(sectiontext, sectionIndex, &used);-
585 switch (ampm) {-
586 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
587 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
588 num = ampm;-
589 state = Acceptable;-
590 break;
executed 861 times by 5 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
861
591 case
never executed: case PossibleAM:
PossibleAM:
never executed: case PossibleAM:
0
592 case
never executed: case PossiblePM:
PossiblePM:
never executed: case PossiblePM:
0
593 num = ampm - 2;-
594 state = Intermediate;-
595 break;
never executed: break;
0
596 case
never executed: case PossibleBoth:
PossibleBoth:
never executed: case PossibleBoth:
0
597 num = 0;-
598 state = Intermediate;-
599 break;
never executed: break;
0
600 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
601 state = Invalid;-
602 if (false) QMessageLogger(__FILE__, 733, __PRETTY_FUNCTION__).debug() << "invalid because findAmPm(" << sectiontext << ") returned -1";
dead code: QMessageLogger(__FILE__, 733, __PRETTY_FUNCTION__).debug() << "invalid because findAmPm(" << sectiontext << ") returned -1";
-
603 break;
executed 2 times by 2 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
2
604 default
never executed: default:
:
never executed: default:
0
605 if (false) QMessageLogger(__FILE__, 736, __PRETTY_FUNCTION__).debug("This should never happen (findAmPm returned %d)", ampm);
dead code: QMessageLogger(__FILE__, 736, __PRETTY_FUNCTION__).debug("This should never happen (findAmPm returned %d)", ampm);
-
606 break;
never executed: break;
0
607 }-
608 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
609 text.replace(index, used, sectiontext.left(used));-
610 }
executed 861 times by 5 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
861
611 break;
executed 863 times by 5 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
}
863
612 case
executed 3176 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 3176 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
3176
613 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
614 case
executed 442 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 442 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
442
615 if (sn.count >= 3
sn.count >= 3Description
TRUEevaluated 1919 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 1739 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
) {
1739-1919
616 if (sn.type == MonthSection
sn.type == MonthSectionDescription
TRUEevaluated 1437 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 482 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
482-1437
617 int min = 1;-
618 const QDate minDate = getMinimum().date();-
619 if (currentValue.date().year() == minDate.year()
currentValue.d...minDate.year()Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 1420 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
) {
17-1420
620 min = minDate.month();-
621 }
executed 17 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
17
622 num = findMonth(sectiontext.toLower(), min, sectionIndex, &sectiontext, &used);-
623 }
executed 1437 times by 6 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
else {
1437
624 num = findDay(sectiontext.toLower(), 1, sectionIndex, &sectiontext, &used);-
625 }
executed 482 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
482
626-
627 if (num != -1
num != -1Description
TRUEevaluated 1914 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-1914
628 state = (used == sectiontext.size()
used == sectiontext.size()Description
TRUEevaluated 1807 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-1807
629 text.replace(index, used, sectiontext.left(used));-
630 }
executed 1914 times by 6 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
else {
1914
631 state = Intermediate;-
632 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
5
633 break;
executed 1919 times by 6 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1919
634 }-
635 case
executed 2672 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 2672 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 1739 times by 7 tests: case DaySection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
1739-2672
636 case
executed 1913 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 1913 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
1913
637 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
638 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
639 case
executed 1276 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1276 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1276
640 case
executed 1916 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 1916 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1916
641 case
executed 1727 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 1727 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
1727
642 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
643 if (sectiontextSize == 0
sectiontextSize == 0Description
TRUEevaluated 17 times by 2 tests
Evaluated by:
  • tst_QDateTimeEdit
  • tst_QTime
FALSEevaluated 13145 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-13145
644 num = 0;-
645 used = 0;-
646 state = Intermediate;-
647 }
executed 17 times by 2 tests: end of block
Executed by:
  • tst_QDateTimeEdit
  • tst_QTime
else {
17
648 const int absMax = absoluteMax(sectionIndex);-
649 QLocale loc;-
650 bool ok = true;-
651 int last = -1;-
652 used = -1;-
653-
654 QString digitsStr(sectiontext);-
655 for (int i = 0; i < sectiontextSize
i < sectiontextSizeDescription
TRUEevaluated 29874 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 12948 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) {
12948-29874
656 if (digitsStr.at(i).isSpace()
digitsStr.at(i).isSpace()Description
TRUEevaluated 197 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
FALSEevaluated 29677 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
) {
197-29677
657 sectiontextSize = i;-
658 break;
executed 197 times by 4 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
197
659 }-
660 }
executed 29677 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
29677
661-
662 const int max = qMin(sectionmaxsize, sectiontextSize);-
663 for (int digits = max; digits >= 1
digits >= 1Description
TRUEevaluated 14117 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-14117
664 digitsStr.truncate(digits);-
665 int tmp = (int)loc.toUInt(digitsStr, &ok);-
666 if (ok
okDescription
TRUEevaluated 13105 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 12283 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-13105
667 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
668 tmp = -1;-
669 ok = false;-
670 }
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
671 tmp = 0;-
672 }
executed 100 times by 3 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
100
673 }
executed 822 times by 5 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
822
674 if (ok
okDescription
TRUEevaluated 13103 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 13097 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-13103
675 if (false) QMessageLogger(__FILE__, 806, __PRETTY_FUNCTION__).debug() << sectiontext.left(digits) << tmp << digits;
dead code: QMessageLogger(__FILE__, 806, __PRETTY_FUNCTION__).debug() << sectiontext.left(digits) << tmp << digits;
-
676 last = tmp;-
677 used = digits;-
678 break;
executed 13097 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
13097
679 }-
680 }
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
681-
682 if (last == -1
last == -1Description
TRUEevaluated 48 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QFtp
FALSEevaluated 13097 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-13097
683 QChar first(sectiontext.at(0));-
684 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
685 used = 0;-
686 state = Intermediate;-
687 }
executed 46 times by 2 tests: end of block
Executed by:
  • tst_QDateTimeEdit
  • tst_QFtp
else {
46
688 state = Invalid;-
689 if (false) QMessageLogger(__FILE__, 820, __PRETTY_FUNCTION__).debug() << "invalid because" << sectiontext << "can't become a uint" << last << ok;
dead code: QMessageLogger(__FILE__, 820, __PRETTY_FUNCTION__).debug() << "invalid because" << sectiontext << "can't become a uint" << last << ok;
-
690 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QDate
2
691 } else {-
692 num += last;-
693 const FieldInfo fi = fieldInfo(sectionIndex);-
694 const bool done = (used == sectionmaxsize);-
695 if (!done
!doneDescription
TRUEevaluated 1466 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 11631 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) {
1466-11631
696 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
697 num *= 10;-
698 }
executed 148 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
148
699 }
executed 78 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
78
700 const int absMin = absoluteMin(sectionIndex);-
701 if (num < absMin
num < absMinDescription
TRUEevaluated 25 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 13072 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-13072
702 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
703 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
704 if (false) QMessageLogger(__FILE__, 835, __PRETTY_FUNCTION__).debug() << "invalid because" << num << "is less than absoluteMin" << absMin;
dead code: QMessageLogger(__FILE__, 835, __PRETTY_FUNCTION__).debug() << "invalid because" << num << "is less than absoluteMin" << absMin;
-
705 }
executed 25 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else if (num > absMax
num > absMaxDescription
TRUEnever evaluated
FALSEevaluated 13072 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-13072
706 state = Intermediate;-
707 }
never executed: end of block
else if (!done
!doneDescription
TRUEevaluated 1444 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
FALSEevaluated 11628 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 979 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 979 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
  • tst_QTime
) {
0-11628
708 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
709 state = Acceptable;-
710 const int missingZeroes = sectionmaxsize - digitsStr.size();-
711 text.insert(index, QString().fill(QLatin1Char('0'), missingZeroes));-
712 used = sectionmaxsize;-
713 cursorPosition += missingZeroes;-
714 ++(const_cast<QDateTimeParser*>(this)->sectionNodes[sectionIndex].zeroesAdded);-
715 }
executed 27 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else {
27
716 state = Intermediate;;-
717 }
executed 438 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
438
718 } else {-
719 state = Acceptable;-
720 }
executed 12607 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
12607
721 }-
722 }-
723 break;
executed 13162 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
}
13162
724 default
never executed: default:
:
never executed: default:
0
725 QMessageLogger(__FILE__, 856, __PRETTY_FUNCTION__).warning("QDateTimeParser::parseSection Internal error (%s %d)",-
726 QString(sn.name()).toLocal8Bit().constData(), sectionIndex);-
727 return
never executed: return -1;
-1;
never executed: return -1;
0
728 }-
729-
730 if (usedptr
usedptrDescription
TRUEevaluated 15944 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-15944
731 *
executed 15944 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 15944 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
15944
732-
733 return
executed 15944 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
state != InvalidDescription
TRUEevaluated 15937 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
? num : -1);
executed 15944 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
7-15944
734}-
735-
736-
737-
738-
739-
740-
741-
742QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPosition,-
743 const QDateTime &currentValue, bool fixup) const-
744{-
745 const QDateTime minimum = getMinimum();-
746 const QDateTime maximum = getMaximum();-
747-
748 State state = Acceptable;-
749-
750 QDateTime newCurrentValue;-
751 bool conflicts = false;-
752 const int sectionNodesCount = sectionNodes.size();-
753-
754 if (false) QMessageLogger(__FILE__, 885, __PRETTY_FUNCTION__).debug() << "parse" << input;
dead code: QMessageLogger(__FILE__, 885, __PRETTY_FUNCTION__).debug() << "parse" << input;
-
755 {-
756 int pos = 0;-
757 int year, month, day;-
758 currentValue.date().getDate(&year, &month, &day);-
759 int year2digits = year % 100;-
760 int hour = currentValue.time().hour();-
761 int hour12 = -1;-
762 int minute = currentValue.time().minute();-
763 int second = currentValue.time().second();-
764 int msec = currentValue.time().msec();-
765 int dayofweek = currentValue.date().dayOfWeek();-
766-
767 int ampm = -1;-
768 Sections isSet = NoSection;-
769 int num;-
770 State tmpstate;-
771-
772 for (int index=0; state != Invalid
state != InvalidDescription
TRUEevaluated 20663 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 16066 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 4597 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-20663
773 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 15944 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-15944
774 if (false) QMessageLogger(__FILE__, 905, __PRETTY_FUNCTION__).debug() << "invalid because" << input.mid(pos, separators.at(index).size())
dead code: QMessageLogger(__FILE__, 905, __PRETTY_FUNCTION__).debug() << "invalid because" << input.mid(pos, separators.at(index).size()) << "!=" << separators.at(index) << index << pos << currentSectionIndex;
-
775 << "!=" << separators.at(index)
dead code: QMessageLogger(__FILE__, 905, __PRETTY_FUNCTION__).debug() << "invalid because" << input.mid(pos, separators.at(index).size()) << "!=" << separators.at(index) << index << pos << currentSectionIndex;
-
776 << index << pos << currentSectionIndex;
dead code: QMessageLogger(__FILE__, 905, __PRETTY_FUNCTION__).debug() << "invalid because" << input.mid(pos, separators.at(index).size()) << "!=" << separators.at(index) << index << pos << currentSectionIndex;
-
777 state = Invalid;-
778 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
779 }-
780 pos += separators.at(index).size();-
781 sectionNodes[index].pos = pos;-
782 int *current = 0;-
783 const SectionNode sn = sectionNodes.at(index);-
784 int used;-
785-
786 num = parseSection(currentValue, index, input, cursorPosition, pos, tmpstate, &used);-
787 if (false) QMessageLogger(__FILE__, 918, __PRETTY_FUNCTION__).debug() << "sectionValue" << sn.name() << input
dead code: QMessageLogger(__FILE__, 918, __PRETTY_FUNCTION__).debug() << "sectionValue" << sn.name() << input << "pos" << pos << "used" << used << stateName(tmpstate);
-
788 << "pos" << pos << "used" << used << stateName(tmpstate);
dead code: QMessageLogger(__FILE__, 918, __PRETTY_FUNCTION__).debug() << "sectionValue" << sn.name() << input << "pos" << pos << "used" << used << stateName(tmpstate);
-
789 if (fixup
fixupDescription
TRUEevaluated 73 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 15871 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-15871
790 const FieldInfo fi = fieldInfo(index);-
791 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
792 const QString newText = QString::fromLatin1("%1").arg(num, sn.count, 10, QLatin1Char('0'));-
793 input.replace(pos, used, newText);-
794 used = sn.count;-
795 }
executed 17 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
17
796 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
20
797 pos += qMax(0, used);-
798-
799 state = qMin<State>(state, tmpstate);-
800 if (state == Intermediate
state == IntermediateDescription
TRUEevaluated 1353 times by 5 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QTime
FALSEevaluated 14591 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-14591
801 state = Invalid;-
802 break;
executed 12 times by 4 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QTime
12
803 }-
804-
805 if (false) QMessageLogger(__FILE__, 936, __PRETTY_FUNCTION__).debug() << index << sn.name() << "is set to"
dead code: QMessageLogger(__FILE__, 936, __PRETTY_FUNCTION__).debug() << index << sn.name() << "is set to" << pos << "state is" << stateName(state);
-
806 << pos << "state is" << stateName(state);
dead code: QMessageLogger(__FILE__, 936, __PRETTY_FUNCTION__).debug() << index << sn.name() << "is set to" << pos << "state is" << stateName(state);
-
807-
808-
809 if (state != Invalid
state != InvalidDescription
TRUEevaluated 15925 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-15925
810 switch (sn.type) {-
811 case
executed 1275 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1275 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
current = &hour; break;
executed 1275 times by 6 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1275
812 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
813 case
executed 1915 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 1915 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 1915 times by 8 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1915
814 case
executed 1727 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 1727 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
current = &second; break;
executed 1727 times by 4 tests: break;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
1727
815 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
816 case
executed 1913 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
YearSection:
executed 1913 times by 6 tests: case YearSection:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
current = &year; break;
executed 1913 times by 6 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
1913
817 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
818 case
executed 3173 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 3173 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 3173 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
3173
819 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
820 case
executed 442 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
DayOfWeekSectionLong:
executed 442 times by 3 tests: case DayOfWeekSectionLong:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
current = &dayofweek; break;
executed 482 times by 3 tests: break;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
442-482
821 case
executed 2661 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 2661 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 2661 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
2661
822 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
823 default
never executed: default:
:
never executed: default:
0
824 QMessageLogger(__FILE__, 955, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error (%s)",-
825 QString(sn.name()).toLocal8Bit().constData());-
826 break;
never executed: break;
0
827 }-
828 if (!current
!currentDescription
TRUEnever evaluated
FALSEevaluated 15925 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-15925
829 QMessageLogger(__FILE__, 960, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 2");-
830 return
never executed: return StateNode();
StateNode();
never executed: return StateNode();
0
831 }-
832 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
833 if (false) QMessageLogger(__FILE__, 964, __PRETTY_FUNCTION__).debug() << "CONFLICT " << sn.name() << *current << num;
dead code: QMessageLogger(__FILE__, 964, __PRETTY_FUNCTION__).debug() << "CONFLICT " << sn.name() << *current << num;
-
834 conflicts = true;-
835 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
836 continue;
executed 96 times by 3 tests: continue;
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
96
837 }-
838 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
5
839 if (num != -1
num != -1Description
TRUEevaluated 15824 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-15824
840 *
executed 15824 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 15824 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
15824
841 isSet |= sn.type;-
842 }
executed 15829 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
15829
843 }
executed 15836 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
15836
844-
845 if (state != Invalid
state != InvalidDescription
TRUEevaluated 4597 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 4582 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-4597
846 if (false) QMessageLogger(__FILE__, 977, __PRETTY_FUNCTION__).debug() << "invalid because" << input.mid(pos)
dead code: QMessageLogger(__FILE__, 977, __PRETTY_FUNCTION__).debug() << "invalid because" << input.mid(pos) << "!=" << separators.last() << pos;
-
847 << "!=" << separators.last() << pos;
dead code: QMessageLogger(__FILE__, 977, __PRETTY_FUNCTION__).debug() << "invalid because" << input.mid(pos) << "!=" << separators.last() << pos;
-
848 state = Invalid;-
849 }
executed 15 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
15
850-
851 if (state != Invalid
state != InvalidDescription
TRUEevaluated 4582 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-4582
852 if (parserType != QVariant::Time
parserType != QVariant::TimeDescription
TRUEevaluated 4559 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-4559
853 if (year % 100 != year2digits
year % 100 != year2digitsDescription
TRUEevaluated 389 times by 7 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
FALSEevaluated 4170 times by 7 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
&& (isSet & YearSection2Digits)) {
389-4170
854 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
855 year = (year / 100) * 100;-
856 year += year2digits;-
857 }
executed 16 times by 4 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkRequest
else {
16
858 conflicts = true;-
859 const SectionNode &sn = sectionNode(currentSectionIndex);-
860 if (sn.type == YearSection2Digits
sn.type == YearSection2DigitsDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTime
) {
0-1
861 year = (year / 100) * 100;-
862 year += year2digits;-
863 }
never executed: end of block
0
864 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QDateTime
1
865 }-
866-
867 const QDate date(year, month, day);-
868 const int diff = dayofweek - date.dayOfWeek();-
869 if (diff != 0
diff != 0Description
TRUEevaluated 536 times by 7 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
FALSEevaluated 4023 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 327 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-4023
870 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
871 conflicts = true;
executed 2 times by 1 test: conflicts = true;
Executed by:
  • tst_QDateTimeEdit
2
872 const SectionNode &sn = sectionNode(currentSectionIndex);-
873 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
874-
875 day += diff;-
876 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
877 day += 7;-
878 }
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
879 day -= 7;-
880 }
never executed: end of block
0
881 if (false) QMessageLogger(__FILE__, 1012, __PRETTY_FUNCTION__).debug() << year << month << day << dayofweek
dead code: QMessageLogger(__FILE__, 1012, __PRETTY_FUNCTION__).debug() << year << month << day << dayofweek << diff << QDate(year, month, day).dayOfWeek();
-
882 << diff << QDate(year, month, day).dayOfWeek();
dead code: QMessageLogger(__FILE__, 1012, __PRETTY_FUNCTION__).debug() << year << month << day << dayofweek << diff << QDate(year, month, day).dayOfWeek();
-
883 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
14
884 }
executed 28 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
28
885-
886 bool needfixday = false;-
887 if (sectionType(currentSectionIndex) & DaySectionMask
sectionType(cu...DaySectionMaskDescription
TRUEevaluated 1208 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3351 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
) {
1208-3351
888 cachedDay = day;-
889 }
executed 1208 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 3339 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-3339
890 day = cachedDay;-
891 needfixday = true;-
892 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
12
893-
894 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 4471 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-4471
895 if (day < 32
day < 32Description
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-88
896 cachedDay = day;-
897 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
88
898 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
899 needfixday = true;-
900 }
executed 51 times by 2 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
51
901 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
88
902 if (needfixday
needfixdayDescription
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 4508 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-4508
903 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
904 state = Invalid;-
905 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
906 }-
907 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
908 day = qMin<int>(day, QDate(year, month, 1).daysInMonth());-
909-
910 const QLocale loc = locale();-
911 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
912 const SectionNode sn = sectionNode(i);-
913 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
914 input.replace(sectionPos(sn), sectionSize(i), loc.toString(day));-
915 }
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
916 const int dayOfWeek = QDate(year, month, day).dayOfWeek();-
917 const QLocale::FormatType dayFormat =-
918 (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
919 ? QLocale::ShortFormat : QLocale::LongFormat);-
920 const QString dayName(loc.dayName(dayOfWeek, dayFormat));-
921 input.replace(sectionPos(sn), sectionSize(i), dayName);-
922 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
14
923 }
executed 149 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
149
924 }
executed 50 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else {
50
925 state = qMin(Intermediate, state);-
926 }
never executed: end of block
0
927 }-
928 }
executed 4558 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
4558
929-
930 if (parserType != QVariant::Date
parserType != QVariant::DateDescription
TRUEevaluated 3711 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 870 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
870-3711
931 if (isSet & Hour12Section
isSet & Hour12SectionDescription
TRUEevaluated 808 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
FALSEevaluated 2903 times by 7 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
) {
808-2903
932 const bool hasHour = isSet & Hour24Section;-
933 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
934 if (hasHour
hasHourDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
935 ampm = (hour < 12
hour < 12Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : 1);
0
936 }
never executed: end of block
else {
0
937 ampm = 0;-
938 }
never executed: end of block
0
939 }-
940 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
941 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
942 hour = hour12;-
943 }
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
944 conflicts = true;-
945 }
never executed: end of block
0
946 }
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 2852 times by 7 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
) {
51-2852
947 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
948 hour = (12 * ampm);-
949 }
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
950 conflicts = true;-
951 }
never executed: end of block
0
952 }
executed 51 times by 3 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
51
953-
954 }
executed 3711 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
3711
955-
956 newCurrentValue = QDateTime(QDate(year, month, day), QTime(hour, minute, second, msec), spec);-
957 if (false) QMessageLogger(__FILE__, 1088, __PRETTY_FUNCTION__).debug() << year << month << day << hour << minute << second << msec;
dead code: QMessageLogger(__FILE__, 1088, __PRETTY_FUNCTION__).debug() << year << month << day << hour << minute << second << msec;
-
958 }
executed 4581 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
4581
959 if (false) QMessageLogger(__FILE__, 1090, __PRETTY_FUNCTION__).debug("'%s' => '%s'(%s)", input.toLatin1().constData(),
dead code: QMessageLogger(__FILE__, 1090, __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());
-
960 newCurrentValue.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")).toLatin1().constData(),
dead code: QMessageLogger(__FILE__, 1090, __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());
-
961 stateName(state).toLatin1().constData());
dead code: QMessageLogger(__FILE__, 1090, __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());
-
962 }-
963end:
code before this statement executed 4615 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
4615
964 if (newCurrentValue.isValid()
newCurrentValue.isValid()Description
TRUEevaluated 4544 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-4544
965 if (context != FromString
context != FromStringDescription
TRUEevaluated 4049 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
FALSEevaluated 495 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 4049 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 3996 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
0-4049
966 const QLatin1Char space(' ');-
967 if (newCurrentValue >= minimum
newCurrentValue >= minimumDescription
TRUEnever evaluated
FALSEevaluated 53 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
)
0-53
968 QMessageLogger(__FILE__, 1099, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 3 (%s %s)",
never executed: QMessageLogger(__FILE__, 1099, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 3 (%s %s)", QString(newCurrentValue.toString()).toLocal8Bit().constData(), QString(minimum.toString()).toLocal8Bit().constData());
0
969 QString(newCurrentValue.toString()).toLocal8Bit().constData(), QString(minimum.toString()).toLocal8Bit().constData());
never executed: QMessageLogger(__FILE__, 1099, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 3 (%s %s)", QString(newCurrentValue.toString()).toLocal8Bit().constData(), QString(minimum.toString()).toLocal8Bit().constData());
0
970-
971 bool done = false;-
972 state = Invalid;-
973 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
974 const SectionNode &sn = sectionNodes.at(i);-
975 QString t = sectionText(input, i, sn.pos).toLower();-
976 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
977 || t.contains(space)
t.contains(space)Description
TRUEnever evaluated
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-74
978 switch (sn.type) {-
979 case
never executed: case AmPmSection:
AmPmSection:
never executed: case AmPmSection:
0
980 switch (findAmPm(t, i)) {-
981 case
never executed: case AM:
AM:
never executed: case AM:
0
982 case
never executed: case PM:
PM:
never executed: case PM:
0
983 state = Acceptable;-
984 done = true;-
985 break;
never executed: break;
0
986 case
never executed: case Neither:
Neither:
never executed: case Neither:
0
987 state = Invalid;-
988 done = true;-
989 break;
never executed: break;
0
990 case
never executed: case PossibleAM:
PossibleAM:
never executed: case PossibleAM:
0
991 case
never executed: case PossiblePM:
PossiblePM:
never executed: case PossiblePM:
0
992 case
never executed: case PossibleBoth:
PossibleBoth:
never executed: case PossibleBoth:
{
0
993 const QDateTime copy(newCurrentValue.addSecs(12 * 60 * 60));-
994 if (copy >= minimum
copy >= minimumDescription
TRUEnever evaluated
FALSEnever evaluated
&& copy <= maximum
copy <= maximumDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
995 state = Intermediate;-
996 done = true;-
997 }
never executed: end of block
0
998 break;
never executed: break;
}
0
999 }-
1000 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
1001 if (sn.count >= 3
sn.count >= 3Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-3
1002 int tmp = newCurrentValue.date().month();-
1003-
1004 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
1005 const QDateTime copy(newCurrentValue.addMonths(tmp - newCurrentValue.date().month()));-
1006 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
1007 break;
never executed: break;
0
1008 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
6
1009 if (tmp == -1
tmp == -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-3
1010 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
3
1011 }-
1012 state = Intermediate;-
1013 done = true;-
1014 break;
never executed: break;
0
1015 }-
1016-
1017 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
1018 int toMin;-
1019 int toMax;-
1020-
1021 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
1022 if (newCurrentValue.daysTo(minimum) != 0
newCurrentValu...(minimum) != 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-20
1023 break;
never executed: break;
0
1024 }-
1025 toMin = newCurrentValue.time().msecsTo(minimum.time());-
1026 if (newCurrentValue.daysTo(maximum) > 0
newCurrentValu...o(maximum) > 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-20
1027 toMax = -1;-
1028 }
never executed: end of block
else {
0
1029 toMax = newCurrentValue.time().msecsTo(maximum.time());-
1030 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
20
1031 } else {-
1032 toMin = newCurrentValue.daysTo(minimum);-
1033 toMax = newCurrentValue.daysTo(maximum);-
1034 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
32
1035 const int maxChange = sn.maxChange();-
1036 if (toMin > maxChange
toMin > maxChangeDescription
TRUEnever evaluated
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-52
1037 if (false) QMessageLogger(__FILE__, 1168, __PRETTY_FUNCTION__).debug() << "invalid because toMin > maxChange" << toMin
dead code: QMessageLogger(__FILE__, 1168, __PRETTY_FUNCTION__).debug() << "invalid because toMin > maxChange" << toMin << maxChange << t << newCurrentValue << minimum;
-
1038 << maxChange << t << newCurrentValue << minimum;
dead code: QMessageLogger(__FILE__, 1168, __PRETTY_FUNCTION__).debug() << "invalid because toMin > maxChange" << toMin << maxChange << t << newCurrentValue << minimum;
-
1039 state = Invalid;-
1040 done = true;-
1041 break;
never executed: break;
0
1042 } 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
1043 toMax = -1;-
1044 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
14
1045-
1046 const int min = getDigit(minimum, i);-
1047 if (min == -1
min == -1Description
TRUEnever evaluated
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-52
1048 QMessageLogger(__FILE__, 1179, __PRETTY_FUNCTION__).warning("QDateTimeParser::parse Internal error 4 (%s)",-
1049 QString(sn.name()).toLocal8Bit().constData());-
1050 state = Invalid;-
1051 done = true;-
1052 break;
never executed: break;
0
1053 }-
1054-
1055 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
1056 int pos = cursorPosition - sn.pos;-
1057 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
1058 pos = -1;
executed 45 times by 1 test: pos = -1;
Executed by:
  • tst_QDateTimeEdit
45
1059 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
1060 if (false) QMessageLogger(__FILE__, 1191, __PRETTY_FUNCTION__).debug() << "invalid because potentialValue(" << t.simplified() << min << max
dead code: QMessageLogger(__FILE__, 1191, __PRETTY_FUNCTION__).debug() << "invalid because potentialValue(" << t.simplified() << min << max << sn.name() << "returned" << toMax << toMin << pos;
-
1061 << sn.name() << "returned" << toMax << toMin << pos;
dead code: QMessageLogger(__FILE__, 1191, __PRETTY_FUNCTION__).debug() << "invalid because potentialValue(" << t.simplified() << min << max << sn.name() << "returned" << toMax << toMin << pos;
-
1062 state = Invalid;-
1063 done = true;-
1064 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
2
1065 }-
1066 state = Intermediate;-
1067 done = true;-
1068 break;
executed 50 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
}
50
1069 }-
1070 }-
1071 }
executed 129 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
129
1072 }
executed 53 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
else {
53
1073 if (context == FromString
context == FromStringDescription
TRUEevaluated 495 times by 8 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
FALSEevaluated 3996 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
) {
495-3996
1074-
1075 ((!(getMaximum().date().toJulianDay() == 4642999)) ? qt_assert("getMaximum().date().toJulianDay() == 4642999",__FILE__,1206) : qt_noop());-
1076 if (newCurrentValue.date().toJulianDay() > 4642999
newCurrentValu...ay() > 4642999Description
TRUEnever evaluated
FALSEevaluated 495 times by 8 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
)
0-495
1077 state = Invalid;
never executed: state = Invalid;
0
1078 }
executed 495 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 {
495
1079 if (newCurrentValue > getMaximum()
newCurrentValue > getMaximum()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEevaluated 3995 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
)
1-3995
1080 state = Invalid;
executed 1 time by 1 test: state = Invalid;
Executed by:
  • tst_QDateTimeEdit
1
1081 }
executed 3996 times by 4 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
3996
1082-
1083 if (false) QMessageLogger(__FILE__, 1214, __PRETTY_FUNCTION__).debug() << "not checking intermediate because newCurrentValue is" << newCurrentValue << getMinimum() << getMaximum();
dead code: QMessageLogger(__FILE__, 1214, __PRETTY_FUNCTION__).debug() << "not checking intermediate because newCurrentValue is" << newCurrentValue << getMinimum() << getMaximum();
-
1084 }
executed 4491 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
4491
1085 }-
1086 StateNode node;-
1087 node.input = input;-
1088 node.state = state;-
1089 node.conflicts = conflicts;-
1090 node.value = newCurrentValue.toTimeSpec(spec);-
1091 text = input;-
1092 return
executed 4738 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 4738 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
4738
1093}-
1094int QDateTimeParser::findMonth(const QString &str1, int startMonth, int sectionIndex,-
1095 QString *usedMonth, int *used) const-
1096{-
1097 int bestMatch = -1;-
1098 int bestCount = 0;-
1099 if (!str1.isEmpty()
!str1.isEmpty()Description
TRUEevaluated 1446 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEnever evaluated
) {
0-1446
1100 const SectionNode &sn = sectionNode(sectionIndex);-
1101 if (sn.type != MonthSection
sn.type != MonthSectionDescription
TRUEnever evaluated
FALSEevaluated 1446 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
) {
0-1446
1102 QMessageLogger(__FILE__, 1242, __PRETTY_FUNCTION__).warning("QDateTimeParser::findMonth Internal error");-
1103 return
never executed: return -1;
-1;
never executed: return -1;
0
1104 }-
1105-
1106 QLocale::FormatType type = sn.count == 3
sn.count == 3Description
TRUEevaluated 1227 times by 5 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 219 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
? QLocale::ShortFormat : QLocale::LongFormat;
219-1227
1107 QLocale l = locale();-
1108-
1109 for (int month=startMonth; month<=12
month<=12Description
TRUEevaluated 6730 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-6730
1110 QString str2 = l.monthName(month, type).toLower();-
1111-
1112 if (str1.startsWith(str2)
str1.startsWith(str2)Description
TRUEevaluated 1325 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEevaluated 5405 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
) {
1325-5405
1113 if (used
usedDescription
TRUEevaluated 1325 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEnever evaluated
) {
0-1325
1114 if (false) QMessageLogger(__FILE__, 1254, __PRETTY_FUNCTION__).debug() << "used is set to" << str2.size();
dead code: QMessageLogger(__FILE__, 1254, __PRETTY_FUNCTION__).debug() << "used is set to" << str2.size();
-
1115 *used = str2.size();-
1116 }
executed 1325 times by 6 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1325
1117 if (usedMonth
usedMonthDescription
TRUEevaluated 1325 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
FALSEnever evaluated
)
0-1325
1118 *
executed 1325 times by 6 tests: *usedMonth = l.monthName(month, type);
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
usedMonth = l.monthName(month, type);
executed 1325 times by 6 tests: *usedMonth = l.monthName(month, type);
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1325
1119-
1120 return
executed 1325 times by 6 tests: return month;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
month;
executed 1325 times by 6 tests: return month;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
1325
1121 }-
1122 if (context == FromString
context == FromStringDescription
TRUEevaluated 3806 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-3806
1123 continue;
executed 3806 times by 5 tests: continue;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkRequest
3806
1124-
1125 const int limit = qMin(str1.size(), str2.size());-
1126-
1127 if (false) QMessageLogger(__FILE__, 1267, __PRETTY_FUNCTION__).debug() << "limit is" << limit << str1 << str2;
dead code: QMessageLogger(__FILE__, 1267, __PRETTY_FUNCTION__).debug() << "limit is" << limit << str1 << str2;
-
1128 bool equal = true;-
1129 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
1130 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
1131 equal = false;-
1132 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
1133 bestCount = i;-
1134 bestMatch = month;-
1135 }
executed 177 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
177
1136 break;
executed 1596 times by 1 test: break;
Executed by:
  • tst_QDateTimeEdit
1596
1137 }-
1138 }
executed 667 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
667
1139 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
1140 if (used
usedDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
)
0-3
1141 *
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
1142 if (usedMonth
usedMonthDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
)
0-3
1143 *
executed 3 times by 1 test: *usedMonth = l.monthName(month, type);
Executed by:
  • tst_QDateTimeEdit
usedMonth = l.monthName(month, type);
executed 3 times by 1 test: *usedMonth = l.monthName(month, type);
Executed by:
  • tst_QDateTimeEdit
3
1144 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
1145 }-
1146 }
executed 1596 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
1596
1147 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
1148 *
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
1149 }
executed 118 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
118
1150 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
1151 if (false) QMessageLogger(__FILE__, 1291, __PRETTY_FUNCTION__).debug() << "used is set to" << bestCount;
dead code: QMessageLogger(__FILE__, 1291, __PRETTY_FUNCTION__).debug() << "used is set to" << bestCount;
-
1152 *used = bestCount;-
1153 }
executed 109 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
109
1154 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
1155}-
1156-
1157int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex, QString *usedDay, int *used) const-
1158{-
1159 int bestMatch = -1;-
1160 int bestCount = 0;-
1161 if (!str1.isEmpty()
!str1.isEmpty()Description
TRUEevaluated 482 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-482
1162 const SectionNode &sn = sectionNode(sectionIndex);-
1163 if (!(sn.type & DaySectionMask)
!(sn.type & DaySectionMask)Description
TRUEnever evaluated
FALSEevaluated 482 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
0-482
1164 QMessageLogger(__FILE__, 1304, __PRETTY_FUNCTION__).warning("QDateTimeParser::findDay Internal error");-
1165 return
never executed: return -1;
-1;
never executed: return -1;
0
1166 }-
1167 const QLocale l = locale();-
1168 for (int day=startDay; day<=7
day<=7Description
TRUEevaluated 3374 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 482 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
; ++day) {
482-3374
1169 const QString dayName = l.dayName(day, sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat);-
1170 const QString str2 = dayName.toLower();-
1171-
1172 const int limit = qMin(str1.size(), str2.size());-
1173 int i = 0;-
1174 while (i < limit
i < limitDescription
TRUEevaluated 6442 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 488 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
&& str1.at(i) == str2.at(i)
str1.at(i) == str2.at(i)Description
TRUEevaluated 3556 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 2886 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
)
488-6442
1175 ++
executed 3556 times by 3 tests: ++i;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
i;
executed 3556 times by 3 tests: ++i;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
3556
1176 if (i > bestCount
i > bestCountDescription
TRUEevaluated 602 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEevaluated 2772 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
) {
602-2772
1177 bestCount = i;-
1178 bestMatch = day;-
1179 }
executed 602 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
602
1180 }
executed 3374 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
3374
1181 if (usedDay
usedDayDescription
TRUEevaluated 482 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
&& bestMatch != -1
bestMatch != -1Description
TRUEevaluated 482 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-482
1182 *usedDay = l.dayName(bestMatch, sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat);-
1183 }
executed 482 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
482
1184 }
executed 482 times by 3 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
482
1185 if (used
usedDescription
TRUEevaluated 482 times by 3 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
FALSEnever evaluated
)
0-482
1186 *
executed 482 times by 3 tests: *used = bestCount;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
used = bestCount;
executed 482 times by 3 tests: *used = bestCount;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
482
1187-
1188 return
executed 482 times by 3 tests: return bestMatch;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
bestMatch;
executed 482 times by 3 tests: return bestMatch;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
482
1189}-
1190QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const-
1191{-
1192 const SectionNode &s = sectionNode(sectionIndex);-
1193 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
1194 QMessageLogger(__FILE__, 1347, __PRETTY_FUNCTION__).warning("QDateTimeParser::findAmPm Internal error");-
1195 return
never executed: return Neither;
Neither;
never executed: return Neither;
0
1196 }-
1197 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
1198 *
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
1199 if (str.trimmed().isEmpty()
str.trimmed().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 863 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QTime
) {
0-863
1200 return
never executed: return PossibleBoth;
PossibleBoth;
never executed: return PossibleBoth;
0
1201 }-
1202 const QLatin1Char space(' ');-
1203 int size = sectionMaxSize(sectionIndex);-
1204-
1205 enum {-
1206 amindex = 0,-
1207 pmindex = 1-
1208 };-
1209 QString ampm[2];-
1210 ampm[amindex] = getAmPmText(AmText, s.count == 1 ? UpperCase : LowerCase);-
1211 ampm[pmindex] = getAmPmText(PmText, s.count == 1 ? UpperCase : LowerCase);-
1212 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
1213 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
1214-
1215 if (false) QMessageLogger(__FILE__, 1368, __PRETTY_FUNCTION__).debug() << "findAmPm" << str << ampm[0] << ampm[1];
dead code: QMessageLogger(__FILE__, 1368, __PRETTY_FUNCTION__).debug() << "findAmPm" << str << ampm[0] << ampm[1];
-
1216-
1217 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
1218 str = ampm[amindex];-
1219 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
1220 } 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
1221 str = ampm[pmindex];-
1222 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
1223 } 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
1224 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
1225 }-
1226 size = qMin(size, str.size());-
1227-
1228 bool broken[2] = {false, false};-
1229 for (int i=0; i<size
i<sizeDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
; ++i) {
0-1
1230 if (str.at(i) != space
str.at(i) != spaceDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-1
1231 for (int j=0; j<2
j<2Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
; ++j) {
0-2
1232 if (!broken[j]
!broken[j]Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-2
1233 int index = ampm[j].indexOf(str.at(i));-
1234 if (false) QMessageLogger(__FILE__, 1387, __PRETTY_FUNCTION__).debug() << "looking for" << str.at(i)
dead code: QMessageLogger(__FILE__, 1387, __PRETTY_FUNCTION__).debug() << "looking for" << str.at(i) << "in" << ampm[j] << "and got" << index;
-
1235 << "in" << ampm[j] << "and got" << index;
dead code: QMessageLogger(__FILE__, 1387, __PRETTY_FUNCTION__).debug() << "looking for" << str.at(i) << "in" << ampm[j] << "and got" << index;
-
1236 if (index == -1
index == -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-2
1237 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
1238 index = ampm[j].indexOf(str.at(i).toLower());-
1239 if (false) QMessageLogger(__FILE__, 1392, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toLower()
dead code: QMessageLogger(__FILE__, 1392, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toLower() << "in" << ampm[j] << "and got" << index;
-
1240 << "in" << ampm[j] << "and got" << index;
dead code: QMessageLogger(__FILE__, 1392, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toLower() << "in" << ampm[j] << "and got" << index;
-
1241 }
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
1242 index = ampm[j].indexOf(str.at(i).toUpper());-
1243 if (false) QMessageLogger(__FILE__, 1396, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toUpper()
dead code: QMessageLogger(__FILE__, 1396, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toUpper() << "in" << ampm[j] << "and got" << index;
-
1244 << "in" << ampm[j] << "and got" << index;
dead code: QMessageLogger(__FILE__, 1396, __PRETTY_FUNCTION__).debug() << "trying with" << str.at(i).toUpper() << "in" << ampm[j] << "and got" << index;
-
1245 }
never executed: end of block
0
1246 if (index == -1
index == -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
FALSEnever evaluated
) {
0-2
1247 broken[j] = true;-
1248 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
1249 if (false) QMessageLogger(__FILE__, 1402, __PRETTY_FUNCTION__).debug() << str << "didn't make it";
dead code: QMessageLogger(__FILE__, 1402, __PRETTY_FUNCTION__).debug() << str << "didn't make it";
-
1250 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
1251 }-
1252 continue;
executed 1 time by 1 test: continue;
Executed by:
  • tst_QDateTimeEdit
1
1253 } else {-
1254 str[i] = ampm[j].at(index);-
1255 }
never executed: end of block
0
1256 }-
1257 ampm[j].remove(index, 1);-
1258 }
never executed: end of block
0
1259 }
never executed: end of block
0
1260 }
never executed: end of block
0
1261 }
never executed: end of block
0
1262 if (!broken[pmindex]
!broken[pmindex]Description
TRUEnever evaluated
FALSEnever evaluated
&& !broken[amindex]
!broken[amindex]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1263 return
never executed: return PossibleBoth;
PossibleBoth;
never executed: return PossibleBoth;
0
1264 return
never executed: return (!broken[amindex] ? PossibleAM : PossiblePM);
(!broken[amindex]
!broken[amindex]Description
TRUEnever evaluated
FALSEnever evaluated
? PossibleAM : PossiblePM);
never executed: return (!broken[amindex] ? PossibleAM : PossiblePM);
0
1265}-
1266-
1267-
1268-
1269-
1270-
1271-
1272int QDateTimeParser::SectionNode::maxChange() const-
1273{-
1274 switch (type) {-
1275-
1276 case
never executed: case MSecSection:
MSecSection:
never executed: case MSecSection:
return
never executed: return 999;
999;
never executed: return 999;
0
1277 case
never executed: case SecondSection:
SecondSection:
never executed: case SecondSection:
return
never executed: return 59 * 1000;
59 * 1000;
never executed: return 59 * 1000;
0
1278 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
1279 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
1280-
1281-
1282 case
never executed: case DayOfWeekSectionShort:
DayOfWeekSectionShort:
never executed: case DayOfWeekSectionShort:
0
1283 case
never executed: case DayOfWeekSectionLong:
DayOfWeekSectionLong:
never executed: case DayOfWeekSectionLong:
return
never executed: return 7;
7;
never executed: return 7;
0
1284 case
never executed: case DaySection:
DaySection:
never executed: case DaySection:
return
never executed: return 30;
30;
never executed: return 30;
0
1285 case
never executed: case MonthSection:
MonthSection:
never executed: case MonthSection:
return
never executed: return 365 - 31;
365 - 31;
never executed: return 365 - 31;
0
1286 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
1287 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
1288 default
never executed: default:
:
never executed: default:
0
1289 QMessageLogger(__FILE__, 1442, __PRETTY_FUNCTION__).warning("QDateTimeParser::maxChange() Internal error (%s)",-
1290 QString(name()).toLocal8Bit().constData());-
1291 }
never executed: end of block
0
1292-
1293 return
never executed: return -1;
-1;
never executed: return -1;
0
1294}-
1295-
1296QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const-
1297{-
1298 FieldInfo ret = 0;-
1299 const SectionNode &sn = sectionNode(index);-
1300 switch (sn.type) {-
1301 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
1302 ret |= Fraction;-
1303-
1304 case
executed 1736 times by 4 tests: case SecondSection:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QNetworkReply
  • tst_QNetworkRequest
SecondSection:
executed 1736 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-1736
1305 case
executed 1952 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 1952 times by 8 tests: case MinuteSection:
Executed by:
  • tst_QAccessibility
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1952
1306 case
executed 1299 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
Hour24Section:
executed 1299 times by 6 tests: case Hour24Section:
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
1299
1307 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
1308 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
1309 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
1310 ret |= Numeric;-
1311 if (sn.type != YearSection
sn.type != YearSectionDescription
TRUEevaluated 6922 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 1932 times by 6 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
) {
1932-6922
1312 ret |= AllowPartial;-
1313 }
executed 6922 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
6922
1314 if (sn.count != 1
sn.count != 1Description
TRUEevaluated 8536 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-8536
1315 ret |= FixedWidth;-
1316 }
executed 8536 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
8536
1317 break;
executed 8854 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
8854
1318 case
executed 1786 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
MonthSection:
executed 1786 times by 7 tests: case MonthSection:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QItemDelegate
  • tst_QNetworkReply
  • tst_QStyleSheetStyle
1786
1319 case
executed 2715 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 2715 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
2715
1320 switch (sn.count) {-
1321 case
executed 3511 times by 7 tests: case 2:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
2:
executed 3511 times by 7 tests: case 2:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
3511
1322 ret |= FixedWidth;-
1323-
1324 case
executed 970 times by 7 tests: case 1:
Executed by:
  • tst_QAccessibility
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QItemDelegate
  • tst_QStyleSheetStyle
1:
executed 970 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 3511 times by 7 tests: case 1:
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
970-3511
1325 ret |= (Numeric|AllowPartial);-
1326 break;
executed 4481 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
4481
1327 }-
1328 break;
executed 4501 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
4501
1329 case
never executed: case DayOfWeekSectionShort:
DayOfWeekSectionShort:
never executed: case DayOfWeekSectionShort:
0
1330 case
never executed: case DayOfWeekSectionLong:
DayOfWeekSectionLong:
never executed: case DayOfWeekSectionLong:
0
1331 if (sn.count == 3
sn.count == 3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1332 ret |= FixedWidth;
never executed: ret |= FixedWidth;
0
1333 break;
never executed: break;
0
1334 case
never executed: case AmPmSection:
AmPmSection:
never executed: case AmPmSection:
0
1335 ret |= FixedWidth;-
1336 break;
never executed: break;
0
1337 default
never executed: default:
:
never executed: default:
0
1338 QMessageLogger(__FILE__, 1491, __PRETTY_FUNCTION__).warning("QDateTimeParser::fieldInfo Internal error 2 (%d %s %d)",-
1339 index, QString(sn.name()).toLocal8Bit().constData(), sn.count);-
1340 break;
never executed: break;
0
1341 }-
1342 return
executed 13355 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 13355 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
13355
1343}-
1344-
1345QString QDateTimeParser::SectionNode::format() const-
1346{-
1347 QChar fillChar;-
1348 switch (type) {-
1349 case
never executed: case AmPmSection:
AmPmSection:
never executed: case AmPmSection:
return
never executed: return count == 1 ? QLatin1String("AP") : QLatin1String("ap");
count == 1
count == 1Description
TRUEnever evaluated
FALSEnever evaluated
? QLatin1String("AP") : QLatin1String("ap");
never executed: return count == 1 ? QLatin1String("AP") : QLatin1String("ap");
0
1350 case
never executed: case MSecSection:
MSecSection:
never executed: case MSecSection:
fillChar = QLatin1Char('z'); break;
never executed: break;
0
1351 case
never executed: case SecondSection:
SecondSection:
never executed: case SecondSection:
fillChar = QLatin1Char('s'); break;
never executed: break;
0
1352 case
never executed: case MinuteSection:
MinuteSection:
never executed: case MinuteSection:
fillChar = QLatin1Char('m'); break;
never executed: break;
0
1353 case
never executed: case Hour24Section:
Hour24Section:
never executed: case Hour24Section:
fillChar = QLatin1Char('H'); break;
never executed: break;
0
1354 case
never executed: case Hour12Section:
Hour12Section:
never executed: case Hour12Section:
fillChar = QLatin1Char('h'); break;
never executed: break;
0
1355 case
never executed: case DayOfWeekSectionShort:
DayOfWeekSectionShort:
never executed: case DayOfWeekSectionShort:
0
1356 case
never executed: case DayOfWeekSectionLong:
DayOfWeekSectionLong:
never executed: case DayOfWeekSectionLong:
0
1357 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
1358 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
1359 case
never executed: case YearSection2Digits:
YearSection2Digits:
never executed: case YearSection2Digits:
0
1360 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
1361 default
never executed: default:
:
never executed: default:
0
1362 QMessageLogger(__FILE__, 1515, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionFormat Internal error (%s)",-
1363 QString(name(type)).toLocal8Bit().constData());-
1364 return
never executed: return QString();
QString();
never executed: return QString();
0
1365 }-
1366 if (fillChar.isNull()
fillChar.isNull()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QDateTimeEdit
) {
0-6
1367 QMessageLogger(__FILE__, 1520, __PRETTY_FUNCTION__).warning("QDateTimeParser::sectionFormat Internal error 2");-
1368 return
never executed: return QString();
QString();
never executed: return QString();
0
1369 }-
1370-
1371 QString str;-
1372 str.fill(fillChar, count);-
1373 return
executed 6 times by 1 test: return str;
Executed by:
  • tst_QDateTimeEdit
str;
executed 6 times by 1 test: return str;
Executed by:
  • tst_QDateTimeEdit
6
1374}-
1375bool QDateTimeParser::potentialValue(const QString &str, int min, int max, int index,-
1376 const QDateTime &currentValue, int insert) const-
1377{-
1378 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
1379 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
1380 }-
1381 const int size = sectionMaxSize(index);-
1382 int val = (int)locale().toUInt(str);-
1383 const SectionNode &sn = sectionNode(index);-
1384 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
1385 val += currentValue.date().year() - (currentValue.date().year() % 100);-
1386 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
20
1387 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
1388 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
1389 } 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
1390 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
1391 } 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
1392 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
1393 }-
1394-
1395 const int len = size - str.size();-
1396 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
1397 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
1398 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
1399 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
1400 } 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
1401 QString tmp = str;-
1402 tmp.insert(insert, QLatin1Char('0' + j));-
1403 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
1404 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
1405 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
6
1406 }
executed 516 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
516
1407 }
executed 45 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
45
1408-
1409 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
1410}-
1411-
1412bool QDateTimeParser::skipToNextSection(int index, const QDateTime &current, const QString &text) const-
1413{-
1414 ((!(current >= getMinimum() && current <= getMaximum())) ? qt_assert("current >= getMinimum() && current <= getMaximum()",__FILE__,1576) : qt_noop());-
1415-
1416 const SectionNode &node = sectionNode(index);-
1417 ((!(text.size() < sectionMaxSize(index))) ? qt_assert("text.size() < sectionMaxSize(index)",__FILE__,1579) : qt_noop());-
1418-
1419 const QDateTime maximum = getMaximum();-
1420 const QDateTime minimum = getMinimum();-
1421 QDateTime tmp = current;-
1422 int min = absoluteMin(index);-
1423 setDigit(tmp, index, min);-
1424 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
1425 min = getDigit(minimum, index);-
1426 }
executed 17 times by 1 test: end of block
Executed by:
  • tst_QDateTimeEdit
17
1427-
1428 int max = absoluteMax(index, current);-
1429 setDigit(tmp, index, max);-
1430 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
1431 max = getDigit(maximum, index);-
1432 }
executed 33 times by 2 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTimeEdit
33
1433 int pos = cursorPosition() - node.pos;-
1434 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
1435 pos = -1;
executed 484 times by 4 tests: pos = -1;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QTime
484
1436-
1437 const bool potential = potentialValue(text, min, max, index, current, pos);-
1438 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
1439-
1440-
1441-
1442-
1443-
1444-
1445}-
1446-
1447-
1448-
1449-
1450-
1451-
1452QString QDateTimeParser::SectionNode::name(QDateTimeParser::Section s)-
1453{-
1454 switch (s) {-
1455 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
1456 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
1457 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
1458 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
1459 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
1460 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
1461 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
1462 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
1463 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
1464 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
1465 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
1466 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
1467 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
1468 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
1469 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
1470 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
1471 }-
1472}-
1473-
1474-
1475-
1476-
1477-
1478-
1479QString QDateTimeParser::stateName(State s) const-
1480{-
1481 switch (s) {-
1482 case
never executed: case Invalid:
Invalid:
never executed: case Invalid:
return
never executed: return QLatin1String("Invalid");
QLatin1String("Invalid");
never executed: return QLatin1String("Invalid");
0
1483 case
never executed: case Intermediate:
Intermediate:
never executed: case Intermediate:
return
never executed: return QLatin1String("Intermediate");
QLatin1String("Intermediate");
never executed: return QLatin1String("Intermediate");
0
1484 case
never executed: case Acceptable:
Acceptable:
never executed: case Acceptable:
return
never executed: return QLatin1String("Acceptable");
QLatin1String("Acceptable");
never executed: return QLatin1String("Acceptable");
0
1485 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
1486 }-
1487}-
1488-
1489-
1490bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) const-
1491{-
1492 QDateTime val(QDate(1900, 1, 1), QTime(0, 0, 0, 0));-
1493 QString text = t;-
1494 int copy = -1;-
1495 const StateNode tmp = parse(text, copy, val, false);-
1496 if (tmp.state != Acceptable
tmp.state != AcceptableDescription
TRUEevaluated 143 times by 4 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QFtp
  • tst_QTime
FALSEevaluated 495 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 490 times by 8 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
) {
5-495
1497 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
1498 }-
1499 if (time
timeDescription
TRUEevaluated 454 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-454
1500 const QTime t = tmp.value.time();-
1501 if (!t.isValid()
!t.isValid()Description
TRUEnever evaluated
FALSEevaluated 454 times by 7 tests
Evaluated by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
) {
0-454
1502 return
never executed: return false;
false;
never executed: return false;
0
1503 }-
1504 *time = t;-
1505 }
executed 454 times by 7 tests: end of block
Executed by:
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
454
1506-
1507 if (date
dateDescription
TRUEevaluated 484 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-484
1508 const QDate d = tmp.value.date();-
1509 if (!d.isValid()
!d.isValid()Description
TRUEnever evaluated
FALSEevaluated 484 times by 7 tests
Evaluated by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
) {
0-484
1510 return
never executed: return false;
false;
never executed: return false;
0
1511 }-
1512 *date = d;-
1513 }
executed 484 times by 7 tests: end of block
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
484
1514 return
executed 490 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 490 times by 8 tests: return true;
Executed by:
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QFtp
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QNetworkRequest
  • tst_QTime
490
1515}-
1516-
1517-
1518QDateTime QDateTimeParser::getMinimum() const-
1519{-
1520 return
executed 1175 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 1175 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
1175
1521}-
1522-
1523QDateTime QDateTimeParser::getMaximum() const-
1524{-
1525 return
executed 1139 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 1139 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
1139
1526}-
1527-
1528QString QDateTimeParser::getAmPmText(AmPm ap, Case cs) const-
1529{-
1530 const QLocale loc = locale();-
1531 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
1532 return
executed 120 times by 2 tests: return cs == UpperCase ? raw.toUpper() : raw.toLower();
Executed by:
  • tst_QDateTime
  • tst_QTime
cs == UpperCase
cs == UpperCaseDescription
TRUEevaluated 56 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QTime
FALSEevaluated 64 times by 2 tests
Evaluated by:
  • tst_QDateTime
  • tst_QTime
? raw.toUpper() : raw.toLower();
executed 120 times by 2 tests: return cs == UpperCase ? raw.toUpper() : raw.toLower();
Executed by:
  • tst_QDateTime
  • tst_QTime
56-120
1533}-
1534-
1535-
1536-
1537-
1538-
1539-
1540-
1541bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::SectionNode &s2)-
1542{-
1543 return
never executed: return (s1.type == s2.type) && (s1.pos == s2.pos) && (s1.count == s2.count);
(
(s1.type == s2.type)Description
TRUEnever evaluated
FALSEnever evaluated
s1.type == s2.type)
(s1.type == s2.type)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(s1.pos == s2.pos)Description
TRUEnever evaluated
FALSEnever evaluated
s1.pos == s2.pos)
(s1.pos == s2.pos)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(s1.count == s2.count)Description
TRUEnever evaluated
FALSEnever evaluated
s1.count == s2.count)
(s1.count == s2.count)Description
TRUEnever evaluated
FALSEnever evaluated
;
never executed: return (s1.type == s2.type) && (s1.pos == s2.pos) && (s1.count == s2.count);
0
1544}-
1545-
1546-
1547-
1548-
Switch to Source codePreprocessed file

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