summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdatetime
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@sosco.com>2009-10-29 11:20:31 +0100
committerShane Kearns <shane.kearns@sosco.com>2009-10-29 11:20:31 +0100
commitf736d889bca3ce5d33b1e5499ad8714952c67906 (patch)
tree712a1a2d35a97ffb648a44211f23bc08f2768945 /tests/auto/qdatetime
parenteed04255446df8a749390e14cef7672c26329f6e (diff)
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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index 8fb0c912c0..c53780e45e 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()