equal
deleted
inserted
replaced
38 ** $QT_END_LICENSE$ |
38 ** $QT_END_LICENSE$ |
39 ** |
39 ** |
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #include "tst_qvcard30writer.h" |
42 #include "tst_qvcard30writer.h" |
|
43 #ifdef QT_BUILD_INTERNAL |
43 #include "qvcard30writer_p.h" |
44 #include "qvcard30writer_p.h" |
|
45 #endif |
44 #include "qversitdocument.h" |
46 #include "qversitdocument.h" |
45 #include "qversitproperty.h" |
47 #include "qversitproperty.h" |
46 #include <QtTest/QtTest> |
48 #include <QtTest/QtTest> |
47 #include <QByteArray> |
49 #include <QByteArray> |
48 #include <QVariant> |
50 #include <QVariant> |
51 const QString KATAKANA_NOKIA(QString::fromUtf8("\xe3\x83\x8e\xe3\x82\xad\xe3\x82\xa2")); |
53 const QString KATAKANA_NOKIA(QString::fromUtf8("\xe3\x83\x8e\xe3\x82\xad\xe3\x82\xa2")); |
52 |
54 |
53 QTM_USE_NAMESPACE |
55 QTM_USE_NAMESPACE |
54 |
56 |
55 Q_DECLARE_METATYPE(QVersitProperty) |
57 Q_DECLARE_METATYPE(QVersitProperty) |
56 |
58 #ifdef QT_BUILD_INTERNAL |
57 void tst_QVCard30Writer::init() |
59 void tst_QVCard30Writer::init() |
58 { |
60 { |
59 mWriter = new QVCard30Writer; |
61 mWriter = new QVCard30Writer; |
60 mWriter->setCodec(QTextCodec::codecForName("UTF-8")); |
62 mWriter->setCodec(QTextCodec::codecForName("UTF-8")); |
61 } |
63 } |
300 // Line break, semicolon, backslash and comma in the middle of the string |
302 // Line break, semicolon, backslash and comma in the middle of the string |
301 input = QString::fromAscii("Escape these \r\n ; , \\ "); |
303 input = QString::fromAscii("Escape these \r\n ; , \\ "); |
302 QVCard30Writer::backSlashEscape(input); |
304 QVCard30Writer::backSlashEscape(input); |
303 QCOMPARE(input, QString::fromAscii("Escape these \\n \\; \\, \\\\ ")); |
305 QCOMPARE(input, QString::fromAscii("Escape these \\n \\; \\, \\\\ ")); |
304 } |
306 } |
305 |
307 #endif |
306 QTEST_MAIN(tst_QVCard30Writer) |
308 QTEST_MAIN(tst_QVCard30Writer) |
307 |
309 |