summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPino Toscano <[email protected]>2017-05-26 10:53:43 +0200
committerPino Toscano <[email protected]>2017-05-26 10:53:43 +0200
commitee5c770ffdee5b24ba2061f71f18494ec52e5096 (patch)
tree591e4deab435716dcdafb2787f2536c5275d28b5
parent8e7da7b6e95a7c9d601828bc7dbcdf4eb8807301 (diff)
tests: fix signature from command w/ spaces in path
properly quote the filename as argument for 'cat', so the command for setting the signature works
-rw-r--r--autotests/CMakeLists.txt2
-rw-r--r--autotests/signaturetest.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index 7a68a8a..16c1b36 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -4,4 +4,4 @@ find_package(Qt5Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
ecm_add_tests( identitytest.cpp signaturetest.cpp NAME_PREFIX "kpimidentity-" LINK_LIBRARIES KF5IdentityManagement
- KF5::PimTextEdit Qt5::Test KF5::ConfigCore KF5::TextWidgets KF5::XmlGui KF5::IconThemes)
+ KF5::PimTextEdit Qt5::Test KF5::ConfigCore KF5::TextWidgets KF5::XmlGui KF5::IconThemes KF5::CoreAddons)
diff --git a/autotests/signaturetest.cpp b/autotests/signaturetest.cpp
index 550aeb0..c22e570 100644
--- a/autotests/signaturetest.cpp
+++ b/autotests/signaturetest.cpp
@@ -32,6 +32,7 @@
#include <KConfig>
#include <QDir>
#include <KActionCollection>
+#include <KShell>
#include <kpimtextedit/richtextcomposer.h>
#include <kpimtextedit/richtextcomposercontroler.h>
@@ -91,7 +92,7 @@ void SignatureTester::testSignatures()
QString fileContent = QString::fromUtf8(thisFile.readAll());
Signature sig3;
- sig3.setPath(QStringLiteral("cat ") + QStringLiteral(__FILE__), true);
+ sig3.setPath(QStringLiteral("cat ") + KShell::quoteArg(QStringLiteral(__FILE__)), true);
QCOMPARE(sig3.rawText(), fileContent);
QVERIFY(!sig3.isInlinedHtml());
QVERIFY(sig3.text().isEmpty());