summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-04-29 11:22:02 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-04-29 11:36:07 +0200
commite96430e239d58a7d2402d72ef594be8d12aa88d0 (patch)
treece4e96fa6b5eadb8ab945aaa0b202c6d6291412c /tests
parent1baceb8774a66aedd1b868707dbf1d05dca74b5b (diff)
Check audio device availability only if the engine is not mock
Qt Multimedia qFatal's when there is no backend, crashing the test. Change-Id: Ib7d4db521a32e57dc00be6339501dd7b37b4a2e3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtexttospeech/tst_qtexttospeech.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qtexttospeech/tst_qtexttospeech.cpp b/tests/auto/qtexttospeech/tst_qtexttospeech.cpp
index b0a6952..af3d0e8 100644
--- a/tests/auto/qtexttospeech/tst_qtexttospeech.cpp
+++ b/tests/auto/qtexttospeech/tst_qtexttospeech.cpp
@@ -334,7 +334,7 @@ void tst_QTextToSpeech::volume()
void tst_QTextToSpeech::sayHello()
{
QFETCH_GLOBAL(QString, engine);
- if (!hasDefaultAudioOutput() && engine != "mock")
+ if (engine != "mock" && !hasDefaultAudioOutput())
QSKIP("No audio device present");
const QString text = QStringLiteral("saying hello with %1");
@@ -354,7 +354,7 @@ void tst_QTextToSpeech::sayHello()
void tst_QTextToSpeech::pauseResume()
{
QFETCH_GLOBAL(QString, engine);
- if (!hasDefaultAudioOutput() && engine != "mock")
+ if (engine != "mock" && !hasDefaultAudioOutput())
QSKIP("No audio device present");
const QString text = QStringLiteral("Hello. World.");
@@ -375,7 +375,7 @@ void tst_QTextToSpeech::pauseResume()
void tst_QTextToSpeech::sayWithVoices()
{
QFETCH_GLOBAL(QString, engine);
- if (!hasDefaultAudioOutput() && engine != "mock")
+ if (engine != "mock" && !hasDefaultAudioOutput())
QSKIP("No audio device present");
const QString text = QStringLiteral("engine %1 with voice of %2");
@@ -405,7 +405,7 @@ void tst_QTextToSpeech::sayWithVoices()
void tst_QTextToSpeech::sayWithRates()
{
QFETCH_GLOBAL(QString, engine);
- if (!hasDefaultAudioOutput() && engine != "mock")
+ if (engine != "mock" && !hasDefaultAudioOutput())
QSKIP("No audio device present");
const QString text = QStringLiteral("test at different rates");