Test the C locale options. Better be sure that the C locale have not thousand
separator. --HG-- branch : feature
This commit is contained in:
parent
8d628404df
commit
8ec60b22b1
|
@ -130,3 +130,26 @@ void TST_Misc::TestAbsoluteFilePath()
|
|||
const QString result = AbsoluteMPath(patternPath, relativeMPath);
|
||||
QCOMPARE(output, result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TST_Misc::TestCLocale_data()
|
||||
{
|
||||
QTest::addColumn<qreal>("number");
|
||||
QTest::addColumn<QString>("expected");
|
||||
|
||||
QTest::newRow("10000") << 10000.0 << "10000";
|
||||
QTest::newRow("10000.5") << 10000.5 << "10000.5";
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// Need for testing thousand separator in the C locale.
|
||||
// Better be sure that the C locale have not thousand separator
|
||||
void TST_Misc::TestCLocale()
|
||||
{
|
||||
QFETCH(qreal, number);
|
||||
QFETCH(QString, expected);
|
||||
|
||||
const QString localized = QString().number(number);
|
||||
|
||||
QCOMPARE(localized, expected);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,9 @@ private slots:
|
|||
void TestAbsoluteFilePath_data();
|
||||
void TestAbsoluteFilePath();
|
||||
|
||||
void TestCLocale_data();
|
||||
void TestCLocale();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(TST_Misc)
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user