Try to check all files.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-10-01 21:41:16 +03:00
parent 30cfa143fe
commit 2d4086206c
2 changed files with 48 additions and 31 deletions

View File

@ -67,7 +67,7 @@ void TST_MeasurementRegExp::TestOriginalMeasurementNamesRegExp()
//---------------------------------------------------------------------------------------------------------------------
// cppcheck-suppress unusedFunction
void TST_MeasurementRegExp::TestMeasurementRegExp()
void TST_MeasurementRegExp::TestMeasurementRegExp_data()
{
const int systemCounts = 55;
const QStringList locales = SupportedLocales();
@ -81,11 +81,29 @@ void TST_MeasurementRegExp::TestMeasurementRegExp()
QVERIFY2(combinations == fileNames.size(), "Unexpected count of files.");
}
QTest::addColumn<QString>("system");
QTest::addColumn<QString>("locale");
for(int s = 0; s < systemCounts; ++s)
{
for(int l = 0, sz = locales.size(); l < sz; ++l)
{
const int res = LoadTranslation(QString("p%1").arg(s), locales.at(l));
const QString system = QString("p%1").arg(s);
const QString locale = locales.at(l);
const QString tag = QString("Check translation measurements_%1_%2.qm").arg(system).arg(locale);
QTest::newRow(qUtf8Printable(tag)) << system << locale;
}
}
}
//---------------------------------------------------------------------------------------------------------------------
// cppcheck-suppress unusedFunction
void TST_MeasurementRegExp::TestMeasurementRegExp()
{
QFETCH(QString, system);
QFETCH(QString, locale);
const int res = LoadTranslation(system, locale);
switch(res)
{
@ -93,10 +111,10 @@ void TST_MeasurementRegExp::TestMeasurementRegExp()
case ErrorSize:
case ErrorLoad:
{
const QString message = QString("Failed to check translation for system = p%1 and locale = %2")
.arg(s)
.arg(locales.at(l));
QFAIL(qUtf8Printable(message));
const QString message = QString("Failed to check translation for system = %1 and locale = %2")
.arg(system)
.arg(locale);
QSKIP(qUtf8Printable(message));
break;
}
case NoError:
@ -109,9 +127,9 @@ void TST_MeasurementRegExp::TestMeasurementRegExp()
if (result == false)
{
const QString message = QString("Can't remove translation for system = p%1 and locale = %2")
.arg(s)
.arg(locales.at(l));
const QString message = QString("Can't remove translation for system = %1 and locale = %2")
.arg(system)
.arg(locale);
QWARN(qUtf8Printable(message));
}
delete pmsTranslator;
@ -121,8 +139,6 @@ void TST_MeasurementRegExp::TestMeasurementRegExp()
QWARN("Unexpected state");
}
}
}
}
//---------------------------------------------------------------------------------------------------------------------
// cppcheck-suppress unusedFunction

View File

@ -43,6 +43,7 @@ public:
private slots:
void TestOriginalMeasurementNamesRegExp();
void TestMeasurementRegExp_data();
void TestMeasurementRegExp();
void TestCorrectOrderMeasurement_data();
void TestCorrectOrderMeasurement();