summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-11-04 00:55:21 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-11-04 02:50:15 (GMT)
commit182e09689623679c46feedc66b44e27c558d575b (patch)
tree50fb6c85328e0b005374c174d97f25687faa7125 /tests
parentf4258408f7d125105bb153ac7575b39b96e3a03e (diff)
downloadQt-182e09689623679c46feedc66b44e27c558d575b.zip
Qt-182e09689623679c46feedc66b44e27c558d575b.tar.gz
Qt-182e09689623679c46feedc66b44e27c558d575b.tar.bz2
DateTimeFormatter autotests.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp b/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp
index 1712b86..5899d8d 100644
--- a/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp
+++ b/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp
@@ -67,12 +67,16 @@ void tst_datetimeformatter::date()
QVERIFY(formatter != 0);
QDate date(2008,12,24);
+ QCOMPARE(formatter->date(), date);
+ QCOMPARE(formatter->dateTime().date(), date);
QCOMPARE(formatter->dateText(),date.toString(Qt::SystemLocaleShortDate));
formatter->setLongStyle(true);
+ QVERIFY(formatter->longStyle());
QCOMPARE(formatter->dateText(),date.toString(Qt::SystemLocaleLongDate));
formatter->setDateFormat("ddd MMMM d yy");
+ QCOMPARE(formatter->dateFormat(), QLatin1String("ddd MMMM d yy"));
QCOMPARE(formatter->dateText(),date.toString("ddd MMMM d yy"));
QVERIFY(formatter->timeText().isEmpty());
@@ -91,6 +95,7 @@ void tst_datetimeformatter::time()
QTime time(14,15,38,200);
QCOMPARE(formatter->time(),time);
+ QCOMPARE(formatter->dateTime().time(),time);
QCOMPARE(formatter->timeText(),time.toString(Qt::SystemLocaleShortDate));
@@ -98,6 +103,7 @@ void tst_datetimeformatter::time()
QCOMPARE(formatter->timeText(),time.toString(Qt::SystemLocaleLongDate));
formatter->setTimeFormat("H:m:s a");
+ QCOMPARE(formatter->timeFormat(), QLatin1String("H:m:s a"));
QCOMPARE(formatter->timeText(),time.toString("H:m:s a"));
formatter->setTimeFormat("hh:mm:ss.zzz");
@@ -117,12 +123,16 @@ void tst_datetimeformatter::dateTime()
QVERIFY(formatter != 0);
QDateTime dateTime(QDate(1978,03,04),QTime(9,13,54));
+ QCOMPARE(formatter->dateTime(),dateTime);
+ QCOMPARE(formatter->date(),dateTime.date());
+ QCOMPARE(formatter->time(),dateTime.time());
QCOMPARE(formatter->dateTimeText(),dateTime.toString(Qt::SystemLocaleShortDate));
formatter->setLongStyle(true);
QCOMPARE(formatter->dateTimeText(),dateTime.toString(Qt::SystemLocaleLongDate));
formatter->setDateTimeFormat("M/d/yy H:m:s a");
+ QCOMPARE(formatter->dateTimeFormat(), QLatin1String("M/d/yy H:m:s a"));
QCOMPARE(formatter->dateTimeText(),dateTime.toString("M/d/yy H:m:s a"));
}