diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-10 06:56:35 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-10 06:56:35 (GMT) |
commit | f61ec84fc296c6f70011e30788ee511d6b6a18c6 (patch) | |
tree | 54b3b81ac83570e65dc9b44b6756005f6ba1efde /tests/auto/linguist | |
parent | cc0a411e5e874aa224c26298a109973cb15ea291 (diff) | |
parent | d13418effc5f00474541ae513a30c9a42c2a1cb3 (diff) | |
download | Qt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.zip Qt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.tar.gz Qt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.tar.bz2 |
Merge commit 'qt/master-stable'
Conflicts:
src/corelib/kernel/qobject.cpp
src/corelib/tools/qsharedpointer_impl.h
src/gui/widgets/qdatetimeedit.cpp
src/gui/widgets/qlinecontrol.cpp
src/gui/widgets/qlineedit.cpp
tests/auto/qcssparser/qcssparser.pro
tests/auto/qicoimageformat/tst_qicoimageformat.cpp
tests/auto/qmultiscreen/qmultiscreen.pro
tests/auto/qresourceengine/qresourceengine.pro
tests/auto/qresourceengine/tst_qresourceengine.cpp
tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
Diffstat (limited to 'tests/auto/linguist')
-rw-r--r-- | tests/auto/linguist/lconvert/.gitignore | 2 | ||||
-rw-r--r-- | tests/auto/linguist/lrelease/.gitignore | 2 | ||||
-rw-r--r-- | tests/auto/linguist/lrelease/testdata/idbased.ts | 21 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/.gitignore | 4 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result | 4 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/tst_lupdate.cpp | 25 |
6 files changed, 49 insertions, 9 deletions
diff --git a/tests/auto/linguist/lconvert/.gitignore b/tests/auto/linguist/lconvert/.gitignore new file mode 100644 index 0000000..042d7ac --- /dev/null +++ b/tests/auto/linguist/lconvert/.gitignore @@ -0,0 +1,2 @@ +tst_lconvert +data/plural-?.po diff --git a/tests/auto/linguist/lrelease/.gitignore b/tests/auto/linguist/lrelease/.gitignore new file mode 100644 index 0000000..cf7059c --- /dev/null +++ b/tests/auto/linguist/lrelease/.gitignore @@ -0,0 +1,2 @@ +tst_lrelease +testdata/*.qm diff --git a/tests/auto/linguist/lrelease/testdata/idbased.ts b/tests/auto/linguist/lrelease/testdata/idbased.ts new file mode 100644 index 0000000..61497de --- /dev/null +++ b/tests/auto/linguist/lrelease/testdata/idbased.ts @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name></name> + <message id="test_id"> + <source>Completely irrelevant source text</source> + <translation>This is a test string.</translation> + </message> + <message id="untranslated_id"> + <source>This has no translation.</source> + </message> + <message id="this_another_id"> + <source>Foo bar.</source> + <comment>Warn me!</comment> + </message> + <message> + <source>Drop me!</source> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/.gitignore b/tests/auto/linguist/lupdate/.gitignore new file mode 100644 index 0000000..4ba5b79 --- /dev/null +++ b/tests/auto/linguist/lupdate/.gitignore @@ -0,0 +1,4 @@ +tst_lupdate +testdata/good/*/project.ts +testdata/output_ts/toplevel/library/tools/translations/project.ts +testdata/recursivescan/*.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result index 151a18e..f2d109b 100644 --- a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> -<TS version="1.1"> +<TS version="2.0"> <context> <name>QApplication</name> <message> - <location filename="../src/main.cpp" line="13"/> + <location filename="../src/main.cpp" line="10"/> <source>QT_LAYOUT_DIRECTION</source> <comment>Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout.</comment> <translation type="unfinished"></translation> diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp index fcf8582..97400d9 100644 --- a/tests/auto/linguist/lupdate/tst_lupdate.cpp +++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp @@ -93,13 +93,24 @@ void tst_lupdate::doCompare(const QStringList &actual, const QString &expectedFn } else if (i == ei) { ei = 0; break; - } else if (err ? !QRegExp(expected.at(i)).exactMatch(actual.at(i)) : - (actual.at(i) != expected.at(i))) { - while ((ei - 1) >= i && (gi - 1) >= i && - (err ? QRegExp(expected.at(ei - 1)).exactMatch(actual.at(gi - 1)) : - (actual.at(gi - 1) == expected.at(ei - 1)))) - ei--, gi--; - break; + } else { + QString act = actual.at(i); + act.remove('\r'); + if (err ? !QRegExp(expected.at(i)).exactMatch(act) : + (act != expected.at(i))) { + bool cond = true; + while (cond) { + act = actual.at(gi - 1); + act.remove('\r'); + cond = (ei - 1) >= i && (gi - 1) >= i && + (err ? QRegExp(expected.at(ei - 1)).exactMatch(act) : + (act == expected.at(ei - 1))); + if (cond) { + ei--, gi--; + } + } + break; + } } } QByteArray diff; |