summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-09-01 10:40:49 +0200
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-09-01 10:59:25 +0000
commit90c80561eaffd6c867ed4a995537d3c463437684 (patch)
tree1dc26374a849ab9560b1e3121c119ede40fcbd94 /tests
parent2bbcc207f841f9fa104204312affb017b35ea997 (diff)
Fix tests with old speech dispatcher
Change-Id: Iad7966a894504fe3e7d4121b6bf9b116cfea7f36 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/texttospeech/tst_qtexttospeech.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/texttospeech/tst_qtexttospeech.cpp b/tests/auto/texttospeech/tst_qtexttospeech.cpp
index d0def13..9a6277c 100644
--- a/tests/auto/texttospeech/tst_qtexttospeech.cpp
+++ b/tests/auto/texttospeech/tst_qtexttospeech.cpp
@@ -39,6 +39,13 @@
#include <QTextToSpeech>
#include <QSignalSpy>
+#if defined(Q_OS_UNIX) && !(defined(Q_OS_MAC) || defined(Q_OS_ANDROID))
+ #include <speech-dispatcher/libspeechd.h>
+ #if LIBSPEECHD_MAJOR_VERSION > 0 || LIBSPEECHD_MINOR_VERSION >= 9
+ #define HAVE_SPD_090
+ #endif
+#endif
+
class tst_QTextToSpeech : public QObject
{
Q_OBJECT
@@ -73,7 +80,9 @@ void tst_QTextToSpeech::speech_rate()
QTextToSpeech tts;
tts.setRate(0.5);
QCOMPARE(tts.state(), QTextToSpeech::Ready);
+#ifdef HAVE_SPD_090
QCOMPARE(tts.rate(), 0.5);
+#endif
qint64 lastTime = 0;
// check that speaking at slower rate takes more time (for 0.5, 0.0, -0.5)
@@ -97,7 +106,9 @@ void tst_QTextToSpeech::pitch()
QTextToSpeech tts;
for (int i = -10; i <= 10; ++i) {
tts.setPitch(i / 10.0);
+#ifdef HAVE_SPD_090
QCOMPARE(tts.pitch(), i / 10.0);
+#endif
}
}