installEventFilter(ef=new EFilter);
//check parameters
- qDebug()<<"arguments"<<arguments();
+// qDebug()<<"arguments"<<arguments();
for(const QString& param:arguments()){
if(param.startsWith("-confdir=")){
setConfigDir(param.mid(9));
void MApplication::setConfigDir(QString d)
{
QSettings::setDefaultFormat(QSettings::IniFormat);
- QSettings::setPath(QSettings::IniFormat,QSettings::UserScope,resolveDir(d));
- qDebug()<<"Setting the config directory to"<<::dataDir<<"from"<<d;
+ const QString cdir=resolveDir(d);
+ QSettings::setPath(QSettings::IniFormat,QSettings::UserScope,cdir);
+ qDebug()<<"Setting the config directory to"<<cdir<<"from"<<d;
}
void MApplication::setDataDir(QString d)
MSTEST_MAIN(TLocale)
+
void TLocale::printFormatting()
{
QCOMPARE(mf.formatNumber(10000),(QString)"10000");
QVERIFY(!r.exactMatch("123.45x"));
QVERIFY(r.exactMatch("123;456Credits"));
QVERIFY(r.exactMatch("[123;456]Credits"));
- QVERIFY(!r.exactMatch("-123;456Credits"));
+ QVERIFY(r.exactMatch("-123;456Credits"));
}
QCOMPARE(mf.scanMoney(" -12,34.56 "),-12000ll);
QCOMPARE(mf.scanMoney(" [12,34.56] "),-12000ll);
QCOMPARE(mf.scanMoney(" [12_34;56]Cu "),-1234560ll);
- QCOMPARE(mf.scanMoney(" -12_34;56Cu "),0ll);
- QCOMPARE(mf.scanMoney(" -[12_34;56]Cu "),0ll);
+ QCOMPARE(mf.scanMoney(" -12_34;56Cu "),-1234560ll);
+ QCOMPARE(mf.scanMoney(" -[12_34;56]Cu "),-1234560ll);
}
mf.setShortMonths(QStringList()<<"j1"<<"f2"<<"m3"<<"a4"<<"m5"<<"j6"<<"j7"<<"a8"<<"s9"<<"o10"<<"n11"<<"d12");
qDebug()<<"decimal dot=; thousand divider=_ 2 digits per block";
mf.setNumberFormat(';','_',2);
- qDebug()<<"currency=Credits, 3 currency decimals, negative is [123.45]";
- mf.setMoneyFormat("Credits",3,"[]");
+ qDebug()<<"currency=Credits, 3 currency decimals, negative is [123;45]";
+ mf.setMoneyFormat("Credits",3,true);
+ mf.setMoneySign("[]");
mf.setAP("AA","PP");
}
int main(int argc, char *argv[]) \
{ \
MApplication app(argc, argv); \
+ app.setConfigDir("$APP/appconf");\
+ app.setDataDir("$APP/appdata");\
app.setAttribute(Qt::AA_Use96Dpi, true); \
QTEST_DISABLE_KEYPAD_NAVIGATION \
TestObject tc; \
--- /dev/null
+#!/bin/bash
+###########################################################
+# Test Runner Script for MagicSmoke
+###########################################################
+
+
+cd `dirname $0`
+
+TASKS="
+test_locale
+"
+
+rm -f test_*.xml
+
+for tcase in $TASKS ; do
+ ./$tcase -xunitxml >$tcase.xml
+done