Commit f7933269 authored by Martin Kampas's avatar Martin Kampas

Fix build errors in debug mode

parent 9dbf5230
......@@ -25,7 +25,7 @@ Process::Process() : m_expectFail(false), m_timedOut(false) {}
QString Process::execute(const QString &program, const QStringList &arguments,
bool expectedResult){
Q_ASSERT(processStatus() == NotRunning);
Q_ASSERT(m_process.state() == QProcess::NotRunning);
m_program = program;
m_arguments = arguments;
m_expectFail = expectedResult == ExpectFail;
......
......@@ -112,13 +112,13 @@ void SettingsTest::testUpgrade_data(){
const QString key = group.isEmpty() ? testCase.key() : group + '/' + testCase.key();
QTest::newRow(qPrintable(QString("%1%2:%3:%4")
.arg(group.isEmpty() ? "" : group + "/")
.arg(testCase.history)
.arg(testCase.current)
.arg(testCase.expected)))
.arg(testCase.history())
.arg(testCase.current())
.arg(testCase.expected())))
<< ssuSettings.contains(key)
<< testCase.keyShouldBeSet()
<< ssuSettings.value(key).toString()
<< testCase.expected;
<< testCase.expected();
}
}
}
......
......@@ -110,8 +110,8 @@ void UpgradeTestHelper::fillSettings(QSettings *settings, const QList<TestCase>
settings->beginGroup(group);
foreach (const TestCase &testCase, testCases){
if (!testCase.current.isEmpty()){
settings->setValue(testCase.key(), testCase.current);
if (!testCase.current().isEmpty()){
settings->setValue(testCase.key(), testCase.current());
}
}
......@@ -136,7 +136,7 @@ void UpgradeTestHelper::fillDefaultSettings(QSettings *defaultSettings, const QL
defaultSettings->beginGroup(group);
foreach (const TestCase &testCase, testCases){
switch (testCase.history.at(revision - 1).toAscii()){
switch (testCase.history().at(revision - 1).toAscii()){
case 'S': // (S)et value
lastSetValue[testCase.key()] = QString("v%1-default").arg(revision);
defaultSettings->setValue(testCase.key(), lastSetValue[testCase.key()]);
......@@ -144,7 +144,7 @@ void UpgradeTestHelper::fillDefaultSettings(QSettings *defaultSettings, const QL
case 'K': // (K)eep value
Q_ASSERT_X(!lastSetValue[testCase.key()].isEmpty(), Q_FUNC_INFO,
qPrintable(QString("Inalid TestCase::history: '%1'").arg(testCase.history)));
qPrintable(QString("Inalid TestCase::history: '%1'").arg(testCase.history())));
defaultSettings->setValue(testCase.key(), lastSetValue[testCase.key()]);
break;
......@@ -159,8 +159,8 @@ void UpgradeTestHelper::fillDefaultSettings(QSettings *defaultSettings, const QL
default:
Q_ASSERT_X(false, Q_FUNC_INFO, qPrintable(QString(
"Inalid TestCase::history: '%1': invalid command-code '%2'")
.arg(testCase.history)
.arg(testCase.history.at(revision - 1))));
.arg(testCase.history())
.arg(testCase.history().at(revision - 1))));
}
}
......@@ -242,8 +242,8 @@ bool UpgradeTestHelper::generateSnapshotRecipe(QTextStream *out){
? ssuSettings.value(testCase.key()).toString()
: "@NOTSET@";
*out << QString("%1:%2:%3\n")
.arg(testCase.history)
.arg(testCase.current)
.arg(testCase.history())
.arg(testCase.current())
.arg(expected);
}
......
......@@ -31,20 +31,24 @@ class UpgradeTestHelper {
struct UpgradeTestHelper::TestCase {
TestCase(const QString &history, const QString &current, const QString &expected) :
history(history), current(current), expected(expected){
m_history(history), m_current(current), m_expected(expected){
}
QString history() const { return m_history; }
QString current() const { return m_current; }
QString expected() const { return m_expected; }
QString key() const{
return QString("%1__%2").arg(history).arg(current);
return QString("%1__%2").arg(m_history).arg(m_current);
}
bool keyShouldBeSet() const{
return expected != "@NOTSET@";
return m_expected != "@NOTSET@";
}
const QString history; // Sequence of (S)et, (K)eep, (R)emove, (N)oop
const QString current;
const QString expected;
QString m_history; // Sequence of (S)et, (K)eep, (R)emove, (N)oop
QString m_current;
QString m_expected;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment