diff options
author | Shane Kearns <shane.kearns@sosco.com> | 2009-10-29 10:20:31 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@sosco.com> | 2009-10-29 10:20:31 (GMT) |
commit | f736d889bca3ce5d33b1e5499ad8714952c67906 (patch) | |
tree | 712a1a2d35a97ffb648a44211f23bc08f2768945 /tests/auto/qdatetime | |
parent | eed04255446df8a749390e14cef7672c26329f6e (diff) | |
download | Qt-f736d889bca3ce5d33b1e5499ad8714952c67906.zip Qt-f736d889bca3ce5d33b1e5499ad8714952c67906.tar.gz Qt-f736d889bca3ce5d33b1e5499ad8714952c67906.tar.bz2 |
Fix QDateTime on S60 3.1
S60 3.1 plugin returned empty strings for the unsupported APIs
Since these APIs are needed for the most common use case of converting
a QDateTime to a QString using the local format, I have implemented an
emulation of the missing APIs using older APIs that are supported.
Updated the autotest so it does some sanity checking on the result of
local date/time conversion - it would pass instead of fail if the string
was garbage before.
Reviewed-by: Aleksandar Sasha Babic
Diffstat (limited to 'tests/auto/qdatetime')
-rw-r--r-- | tests/auto/qdatetime/tst_qdatetime.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp index 8fb0c91..c53780e 100644 --- a/tests/auto/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/qdatetime/tst_qdatetime.cpp @@ -447,7 +447,14 @@ void tst_QDateTime::toString_enumformat() QCOMPARE(str2, QString("1995-05-20T12:34:56")); QString str3 = dt1.toString(Qt::LocalDate); + qDebug() << str3; QVERIFY(!str3.isEmpty()); + //check for date/time components in any order + QVERIFY(str3.contains("1995")); + //day and month may be in numeric or word form + QVERIFY(str3.contains("12")); + QVERIFY(str3.contains("34")); + QVERIFY(str3.contains("56")); } void tst_QDateTime::addDays() |