summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qdatetimeparser_p.h
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2020-10-07 13:25:57 +0200
committerAndreas Buhr <andreas.buhr@qt.io>2020-10-30 10:15:29 +0100
commitb0d4d95a2986595fda4a2cc8a163e44c9b4162a6 (patch)
treeacf8fe711f3e34e5eb672a671f6ad90821d3cb9e /src/corelib/time/qdatetimeparser_p.h
parentcc0be95ac782c9cf0bf994d0af6e2966cf29f8fa (diff)
Add unit tests for QDateTimeParser internals
So far, the internals of QDateTimeParser and especially the handling of 'Intermediate' values were only tested implicitly by tst_qdatetimeedit. 'Intermediate' values are values which are not valid according to the specified format, but could become valid by adding more characters. This patch adds unit tests which tests parsing of these intermediate values directly. These tests will help implement handling of negative year numbers, where additional complications arise because of possible ambiguities between the minus sign '-' and the separator '-'. Task-number: QTBUG-84334 Change-Id: Ia6ba08df198288b8b11d3b2d2052c194f04fe8a1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/time/qdatetimeparser_p.h')
-rw-r--r--src/corelib/time/qdatetimeparser_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/time/qdatetimeparser_p.h b/src/corelib/time/qdatetimeparser_p.h
index a9f003753f..578da2df73 100644
--- a/src/corelib/time/qdatetimeparser_p.h
+++ b/src/corelib/time/qdatetimeparser_p.h
@@ -240,6 +240,8 @@ private:
return potentialValue(QStringView(str), min, max, index, currentValue, insert);
}
+ friend class QDTPUnitTestParser;
+
protected: // for the benefit of QDateTimeEditPrivate
int sectionSize(int index) const;
int sectionMaxSize(int index) const;