equal
deleted
inserted
replaced
78 |
78 |
79 |
79 |
80 void tst_lupdate::doCompare(const QStringList &actual, const QString &expectedFn, bool err) |
80 void tst_lupdate::doCompare(const QStringList &actual, const QString &expectedFn, bool err) |
81 { |
81 { |
82 QFile file(expectedFn); |
82 QFile file(expectedFn); |
83 QVERIFY(file.open(QIODevice::ReadOnly)); |
83 QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); |
84 QStringList expected = QString(file.readAll()).trimmed().remove('\r').split('\n'); |
84 QStringList expected = QString(file.readAll()).trimmed().split('\n'); |
85 |
85 |
86 int i = 0, ei = expected.size(), gi = actual.size(); |
86 int i = 0, ei = expected.size(), gi = actual.size(); |
87 for (; ; i++) { |
87 for (; ; i++) { |
88 if (i == gi) { |
88 if (i == gi) { |
89 if (i == ei) |
89 if (i == ei) |
139 } |
139 } |
140 |
140 |
141 void tst_lupdate::doCompare(const QString &actualFn, const QString &expectedFn, bool err) |
141 void tst_lupdate::doCompare(const QString &actualFn, const QString &expectedFn, bool err) |
142 { |
142 { |
143 QFile afile(actualFn); |
143 QFile afile(actualFn); |
144 QVERIFY(afile.open(QIODevice::ReadOnly)); |
144 QVERIFY(afile.open(QIODevice::ReadOnly | QIODevice::Text)); |
145 QStringList actual = QString(afile.readAll()).trimmed().remove('\r').split('\n'); |
145 QStringList actual = QString(afile.readAll()).trimmed().split('\n'); |
146 |
146 |
147 doCompare(actual, expectedFn, err); |
147 doCompare(actual, expectedFn, err); |
148 } |
148 } |
149 |
149 |
150 void tst_lupdate::good_data() |
150 void tst_lupdate::good_data() |
178 m_lupdate.qmake(); |
178 m_lupdate.qmake(); |
179 // look for a command |
179 // look for a command |
180 QString lupdatecmd; |
180 QString lupdatecmd; |
181 QFile file(dir + "/lupdatecmd"); |
181 QFile file(dir + "/lupdatecmd"); |
182 if (file.exists()) { |
182 if (file.exists()) { |
183 QVERIFY(file.open(QIODevice::ReadOnly)); |
183 QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); |
184 while (!file.atEnd()) { |
184 while (!file.atEnd()) { |
185 QByteArray cmdstring = file.readLine().simplified(); |
185 QByteArray cmdstring = file.readLine().simplified(); |
186 if (cmdstring.startsWith('#')) |
186 if (cmdstring.startsWith('#')) |
187 continue; |
187 continue; |
188 if (cmdstring.startsWith("lupdate")) { |
188 if (cmdstring.startsWith("lupdate")) { |
224 |
224 |
225 // look for a command |
225 // look for a command |
226 QString lupdatecmd; |
226 QString lupdatecmd; |
227 QFile file(dir + "/lupdatecmd"); |
227 QFile file(dir + "/lupdatecmd"); |
228 if (file.exists()) { |
228 if (file.exists()) { |
229 QVERIFY(file.open(QIODevice::ReadOnly)); |
229 QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); |
230 while (!file.atEnd()) { |
230 while (!file.atEnd()) { |
231 QByteArray cmdstring = file.readLine().simplified(); |
231 QByteArray cmdstring = file.readLine().simplified(); |
232 if (cmdstring.startsWith('#')) |
232 if (cmdstring.startsWith('#')) |
233 continue; |
233 continue; |
234 if (cmdstring.startsWith("lupdate")) { |
234 if (cmdstring.startsWith("lupdate")) { |