diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2022-05-16 15:18:51 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-05-20 20:13:47 +0000 |
commit | 9b60e7bd06c26507141a8e1de156638bc7dd9252 (patch) | |
tree | 8ebaef3a7596ea870e257981f0a3d2a913c0b937 /tests/auto | |
parent | da13b39e41b3d937e688ab44bf1316fbbfa0f767 (diff) |
Improve error handling in QTextToSpeech
Add an enum class ErrorReason for error handling in QTextToSpeech.
Rename BackendError to Error in enum QTextToSpeech::State, as the error
might not be in the synthesizer, but the audio playback, or due to
invalid input.
Update all sources and tests referring to BackendError to use new name.
Update documentation of enum QTextToSpeech::State, add documentation
for new enum QTextToSpeech::ErrorReason.
Add getters, setters, signals, and slots for error handling.
Implement error handling for flite plugin, covering audio backend,
initialization and synthesizing errors. For the other plugins, handle
basic initialization errors.
Change-Id: I233cf3876511176dd1a327546233d527596e1e7e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qtexttospeech/tst_qtexttospeech.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qvoice/tst_qvoice.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qtexttospeech/tst_qtexttospeech.cpp b/tests/auto/qtexttospeech/tst_qtexttospeech.cpp index bc580c7..fd49cef 100644 --- a/tests/auto/qtexttospeech/tst_qtexttospeech.cpp +++ b/tests/auto/qtexttospeech/tst_qtexttospeech.cpp @@ -119,8 +119,8 @@ void tst_QTextToSpeech::init() if (engine == "speechd") { QTextToSpeech tts(engine); QTRY_COMPARE(tts.state(), QTextToSpeech::Ready); - if (tts.state() == QTextToSpeech::BackendError) { - QSKIP("speechd engine reported a backend error, " + if (tts.state() == QTextToSpeech::Error) { + QSKIP("speechd engine reported an error, " "make sure the speech-dispatcher service is running!"); } } else if (engine == "ios" diff --git a/tests/auto/qvoice/tst_qvoice.cpp b/tests/auto/qvoice/tst_qvoice.cpp index f0a61b6..f9e56e2 100644 --- a/tests/auto/qvoice/tst_qvoice.cpp +++ b/tests/auto/qvoice/tst_qvoice.cpp @@ -70,8 +70,8 @@ void tst_QVoice::init() QFETCH_GLOBAL(QString, engine); if (engine == "speechd") { QTextToSpeech tts(engine); - if (tts.state() == QTextToSpeech::BackendError) { - QSKIP("speechd engine reported a backend error, " + if (tts.state() == QTextToSpeech::Error) { + QSKIP("speechd engine reported an error, " "make sure the speech-dispatcher service is running!"); } } else if (engine == "ios" |