diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-01-15 05:35:55 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-01-15 05:35:55 (GMT) |
commit | d2fa5b80d4f40ac67a7a74552390332551563466 (patch) | |
tree | 1ef112b385dbbdd49abefd9b574573f7d21b69bf /tests/auto/linguist/lrelease/tst_lrelease.cpp | |
parent | f0d24ba1eaa1079abef3a1da641b43437dc7df66 (diff) | |
parent | 6c5c2312ca5477a1ec33f43c1673ab65a0dce8bb (diff) | |
download | Qt-d2fa5b80d4f40ac67a7a74552390332551563466.zip Qt-d2fa5b80d4f40ac67a7a74552390332551563466.tar.gz Qt-d2fa5b80d4f40ac67a7a74552390332551563466.tar.bz2 |
Merge branch 'master' of ../../qt/master
Conflicts:
examples/multimedia/audioinput/audioinput.cpp
src/multimedia/audio/qaudiodeviceinfo.cpp
src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
src/multimedia/audio/qaudioformat.cpp
src/multimedia/audio/qaudioinput_win32_p.cpp
src/multimedia/audio/qaudiooutput_win32_p.cpp
tests/auto/qaudioformat/tst_qaudioformat.cpp
Diffstat (limited to 'tests/auto/linguist/lrelease/tst_lrelease.cpp')
-rw-r--r-- | tests/auto/linguist/lrelease/tst_lrelease.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/auto/linguist/lrelease/tst_lrelease.cpp b/tests/auto/linguist/lrelease/tst_lrelease.cpp index 39de8a1..fdb384e 100644 --- a/tests/auto/linguist/lrelease/tst_lrelease.cpp +++ b/tests/auto/linguist/lrelease/tst_lrelease.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -60,6 +60,7 @@ private slots: void mixedcodecs(); void compressed(); void idbased(); + void markuntranslated(); void dupes(); private: @@ -71,8 +72,8 @@ private: void tst_lrelease::doCompare(const QStringList &actual, const QString &expectedFn) { QFile file(expectedFn); - QVERIFY(file.open(QIODevice::ReadOnly)); - QStringList expected = QString(file.readAll()).trimmed().remove('\r').split('\n'); + QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); + QStringList expected = QString(file.readAll()).trimmed().split('\n'); int i = 0, ei = expected.size(), gi = actual.size(); for (; ; i++) { @@ -210,13 +211,25 @@ void tst_lrelease::idbased() QCOMPARE(qtTrId("untranslated_id"), QString::fromAscii("This has no translation.")); } +void tst_lrelease::markuntranslated() +{ + QVERIFY(!QProcess::execute(binDir + "/lrelease -markuntranslated # -idbased testdata/idbased.ts")); + + QTranslator translator; + QVERIFY(translator.load("testdata/idbased.qm")); + qApp->installTranslator(&translator); + + QCOMPARE(qtTrId("test_id"), QString::fromAscii("This is a test string.")); + QCOMPARE(qtTrId("untranslated_id"), QString::fromAscii("#This has no translation.")); +} + void tst_lrelease::dupes() { QProcess proc; - proc.start(binDir + "/lrelease testdata/dupes.ts"); + proc.start(binDir + "/lrelease testdata/dupes.ts", QIODevice::ReadWrite | QIODevice::Text); QVERIFY(proc.waitForFinished()); QVERIFY(proc.exitStatus() == QProcess::NormalExit); - doCompare(QString(proc.readAllStandardError()).trimmed().remove('\r').split('\n'), "testdata/dupes.errors"); + doCompare(QString(proc.readAllStandardError()).trimmed().split('\n'), "testdata/dupes.errors"); } QTEST_MAIN(tst_lrelease) |