diff options
author | Jaromir Wysoglad | 2019-08-02 01:28:09 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
commit | 98cea3e2cef3bf4c723967af60dfb961ab4bafaf (patch) | |
tree | 370915121f85557e7499c42c9b2d8ed2a03b2ab0 /engines/testbed/speech.cpp | |
parent | feaba6fff62d92c057579d9a95ed085d8bd3d159 (diff) | |
download | scummvm-rg350-98cea3e2cef3bf4c723967af60dfb961ab4bafaf.tar.gz scummvm-rg350-98cea3e2cef3bf4c723967af60dfb961ab4bafaf.tar.bz2 scummvm-rg350-98cea3e2cef3bf4c723967af60dfb961ab4bafaf.zip |
TESTBED: Add state queries to TTS tests.
Diffstat (limited to 'engines/testbed/speech.cpp')
-rw-r--r-- | engines/testbed/speech.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/testbed/speech.cpp b/engines/testbed/speech.cpp index 65fbbfd65e..266b8f7d8a 100644 --- a/engines/testbed/speech.cpp +++ b/engines/testbed/speech.cpp @@ -51,6 +51,10 @@ TestExitStatus Speechtests::testMale() { } ttsMan->setVoice(maleVoices[0]); ttsMan->say("Testing text to speech with male voice."); + if (!ttsMan->isSpeaking()) { + Testsuite::logDetailedPrintf("Male TTS failed\n"); + return kTestFailed; + } while (ttsMan->isSpeaking()) { g_system->delayMillis(1000); } @@ -85,6 +89,10 @@ TestExitStatus Speechtests::testFemale() { } ttsMan->setVoice(femaleVoices[0]); ttsMan->say("Testing text to speech with female voice."); + if (!ttsMan->isSpeaking()) { + Testsuite::logDetailedPrintf("Female TTS failed\n"); + return kTestFailed; + } while (ttsMan->isSpeaking()) { g_system->delayMillis(1000); } @@ -117,6 +125,13 @@ TestExitStatus Speechtests::testStop() { ttsMan->say("Testing text to speech, the speech should stop after approximately a second after it started, so it shouldn't have the time to read this."); g_system->delayMillis(1000); ttsMan->stop(); + // It is allright if the voice isn't available right away, but a second should be + // enough for the TTS to recover and get ready. + g_system->delayMillis(1000); + if (!ttsMan->isReady()) { + Testsuite::logDetailedPrintf("TTS stop failed\n"); + return kTestFailed; + } Common::String prompt = "Did you hear a voice saying: \"Testing text to speech, the speech should stop after approximately a second after it started, so it shouldn't have the time to read this.\" but stopping in the middle?"; if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) { Testsuite::logDetailedPrintf("TTS stop failed\n"); @@ -146,8 +161,20 @@ TestExitStatus Speechtests::testPauseResume() { ttsMan->say("Testing text to speech, the speech should pause after a second and then resume again."); g_system->delayMillis(1000); ttsMan->pause(); + if (!ttsMan->isPaused()) { + Testsuite::logDetailedPrintf("TTS pause failed\n"); + return kTestFailed; + } g_system->delayMillis(2000); + if (!ttsMan->isPaused()) { + Testsuite::logDetailedPrintf("TTS pause failed\n"); + return kTestFailed; + } ttsMan->resume(); + if (!ttsMan->isSpeaking()) { + Testsuite::logDetailedPrintf("TTS pause failed\n"); + return kTestFailed; + } while (ttsMan->isSpeaking()) g_system->delayMillis(1000); Common::String prompt = "Did you hear a voice saying: \"Testing text to speech, the speech should pause after a second and then resume again.\" but with a second long pause in the middle?"; |