From a4fb6d35e4c288cbc144c646caa6187ed0e29f75 Mon Sep 17 00:00:00 2001 From: Martin Kampas Date: Tue, 9 Apr 2013 07:42:37 +0200 Subject: [PATCH] Fix runtime errors in debug mode --- libssu/sandbox.cpp | 1 - libssu/ssuvariables.cpp | 2 +- tests/testutils/process.cpp | 4 +++- tests/ut_rndssucli/rndssuclitest.h | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libssu/sandbox.cpp b/libssu/sandbox.cpp index 3210e4c..d84fd60 100644 --- a/libssu/sandbox.cpp +++ b/libssu/sandbox.cpp @@ -147,7 +147,6 @@ bool Sandbox::addWorldFiles(const QString &directory, QDir::Filters filters, Q_ASSERT(!directory.contains("/./") && !directory.endsWith("/.") && !directory.contains("/../") && !directory.endsWith("/..") && !directory.contains("//")); - Q_ASSERT_X(!(m_scopes & ChildProcesses), Q_FUNC_INFO, "Unimplemented case!"); if (!prepare()){ return false; diff --git a/libssu/ssuvariables.cpp b/libssu/ssuvariables.cpp index 4132e4f..9ad0d21 100644 --- a/libssu/ssuvariables.cpp +++ b/libssu/ssuvariables.cpp @@ -89,7 +89,7 @@ QString SsuVariables::resolveVariable(QString variable, QHash // find the operator who's after your colon QChar op; - if (variable.length() >= magic +1) + if (variable.length() > magic +1) op = variable.at(magic + 1); switch(op.toAscii()){ diff --git a/tests/testutils/process.cpp b/tests/testutils/process.cpp index c5c57f2..5141bdb 100644 --- a/tests/testutils/process.cpp +++ b/tests/testutils/process.cpp @@ -42,7 +42,9 @@ bool Process::hasError(){ } QString Process::fmtErrorMessage(){ - Q_ASSERT(hasError()); + if (!hasError()){ + return QString(); + } QStringList reasons; if (m_timedOut){ diff --git a/tests/ut_rndssucli/rndssuclitest.h b/tests/ut_rndssucli/rndssuclitest.h index 1fc5617..aee55f4 100644 --- a/tests/ut_rndssucli/rndssuclitest.h +++ b/tests/ut_rndssucli/rndssuclitest.h @@ -15,6 +15,9 @@ class Sandbox; class RndSsuCliTest: public QObject { Q_OBJECT + public: + RndSsuCliTest(): m_sandbox(0) {} + private slots: void init(); void cleanup();