aboutsummaryrefslogtreecommitdiff
path: root/engines/testbed
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-08-02 14:24:59 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit84df34df108f2c2166dcaa967ee10d84e06f0002 (patch)
tree03b6b0cd71bb79dac3c41c21fe3cb9d7add5ea07 /engines/testbed
parentfb12e3b36b4db7118fccfdff79f450c69bcf9b2f (diff)
downloadscummvm-rg350-84df34df108f2c2166dcaa967ee10d84e06f0002.tar.gz
scummvm-rg350-84df34df108f2c2166dcaa967ee10d84e06f0002.tar.bz2
scummvm-rg350-84df34df108f2c2166dcaa967ee10d84e06f0002.zip
TESTBED: Add tests for TTS *_NO_REPEAT actions
Diffstat (limited to 'engines/testbed')
-rw-r--r--engines/testbed/speech.cpp73
-rw-r--r--engines/testbed/speech.h2
2 files changed, 75 insertions, 0 deletions
diff --git a/engines/testbed/speech.cpp b/engines/testbed/speech.cpp
index bca6ad76f3..6715ee3295 100644
--- a/engines/testbed/speech.cpp
+++ b/engines/testbed/speech.cpp
@@ -438,6 +438,77 @@ TestExitStatus Speechtests::testDroping() {
return kTestPassed;
}
+TestExitStatus Speechtests::testInterruptNoRepeat() {
+ Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+ ttsMan->setLanguage("en");
+ ttsMan->setVolume(100);
+ ttsMan->setRate(0);
+ ttsMan->setPitch(0);
+ ttsMan->setVoice(0);
+ Testsuite::clearScreen();
+ Common::String info = "Text to speech inturrept no repeat test. You should expect a voice to start saying:\"This is the first sentence, this should get interrupted\", but the speech gets interrupted and \"This is the second sentence, it should play only once\" is said instead.";
+
+ Common::Point pt(0, 100);
+ Testsuite::writeOnScreen("Testing TTS Interrupt No Repeat", pt);
+
+ if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
+ Testsuite::logPrintf("Info! Skipping test : testInterruptNoRepeat\n");
+ return kTestSkipped;
+ }
+
+ ttsMan->say("This is the first sentence, this should get interrupted");
+ g_system->delayMillis(1000);
+ ttsMan->say("This is the second sentence, it should play only once", Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
+ g_system->delayMillis(1000);
+ ttsMan->say("This is the second sentence, it should play only once", Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
+ g_system->delayMillis(1000);
+ ttsMan->say("This is the second sentence, it should play only once", Common::TextToSpeechManager::INTERRUPT_NO_REPEAT);
+ while (ttsMan->isSpeaking())
+ g_system->delayMillis(1000);
+ Common::String prompt = "Did you hear a voice say: \"This is the first sentence, this should get interrupted\", but it got interrupted and \"This is the second sentence, it should play only once.\" got said instead?";
+ if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {
+ Testsuite::logDetailedPrintf("TTS interruptNoRepeat failed\n");
+ return kTestFailed;
+ }
+ return kTestPassed;
+}
+
+TestExitStatus Speechtests::testQueueNoRepeat() {
+ Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+ ttsMan->setLanguage("en");
+ ttsMan->setVolume(100);
+ ttsMan->setRate(0);
+ ttsMan->setPitch(0);
+ ttsMan->setVoice(0);
+ Testsuite::clearScreen();
+ Common::String info = "Text to speech queue no repeat test. You should expect a voice to start say:\"This is the first sentence. This is the second sentence\" and nothing else";
+
+ Common::Point pt(0, 100);
+ Testsuite::writeOnScreen("Testing TTS Queue No Repeat", pt);
+
+ if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
+ Testsuite::logPrintf("Info! Skipping test : testQueueNoRepeat\n");
+ return kTestSkipped;
+ }
+
+ ttsMan->say("This is the first sentence.");
+ ttsMan->say("This is the first sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
+ g_system->delayMillis(1000);
+ ttsMan->say("This is the first sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
+ ttsMan->say("This is the second sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
+ ttsMan->say("This is the second sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
+ g_system->delayMillis(1000);
+ ttsMan->say("This is the second sentence.", Common::TextToSpeechManager::QUEUE_NO_REPEAT);
+ while (ttsMan->isSpeaking())
+ g_system->delayMillis(1000);
+ Common::String prompt = "Did you hear a voice say: \"This is the first sentence. This the second sentence\" and nothing else?";
+ if (!Testsuite::handleInteractiveInput(prompt, "Yes", "No", kOptionLeft)) {
+ Testsuite::logDetailedPrintf("TTS QueueNoRepeat failed\n");
+ return kTestFailed;
+ }
+ return kTestPassed;
+}
+
SpeechTestSuite::SpeechTestSuite() {
_isTsEnabled = true;
if (!g_system->getTextToSpeechManager())
@@ -453,6 +524,8 @@ SpeechTestSuite::SpeechTestSuite() {
addTest("testQueueing", &Speechtests::testQueueing, true);
addTest("testInterrupting", &Speechtests::testInterrupting, true);
addTest("testDroping", &Speechtests::testDroping, true);
+ addTest("testInterruptNoRepeat", &Speechtests::testInterruptNoRepeat, true);
+ addTest("testQueueNoRepeat", &Speechtests::testQueueNoRepeat, true);
}
} // End of namespace Testbed
diff --git a/engines/testbed/speech.h b/engines/testbed/speech.h
index a5f576d300..4600ff7506 100644
--- a/engines/testbed/speech.h
+++ b/engines/testbed/speech.h
@@ -46,6 +46,8 @@ TestExitStatus testStateStacking();
TestExitStatus testQueueing();
TestExitStatus testInterrupting();
TestExitStatus testDroping();
+TestExitStatus testInterruptNoRepeat();
+TestExitStatus testQueueNoRepeat();
} // End of namespace Speechtests