summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstring/tst_qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qstring/tst_qstring.cpp')
-rw-r--r--tests/auto/qstring/tst_qstring.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp
index 7f207d4..0877b7d 100644
--- a/tests/auto/qstring/tst_qstring.cpp
+++ b/tests/auto/qstring/tst_qstring.cpp
@@ -152,6 +152,7 @@ private slots:
// void indexOf3();
void sprintf();
void copy();
+ void latin1();
void fill();
void truncate();
void constructor();
@@ -917,6 +918,24 @@ void tst_QString::copy()
#endif
}
+void tst_QString::latin1()
+{
+#ifdef QT3_SUPPORT
+ QString e = "String E";
+ const char* lat = e.latin1();
+ QCOMPARE(lat, "String E");
+ e += "F";
+ QCOMPARE(e.latin1(), "String EF");
+
+ QString null;
+ QString empty = "";
+ QCOMPARE(null.latin1(), ""); // was a null pointer in Qt3!
+ QCOMPARE(empty.latin1(), "");
+#else
+ QSKIP("This test requires QT3_SUPPORT", SkipSingle);
+#endif
+}
+
void tst_QString::sprintf()
{
QString a;