mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-14 17:47:19 +00:00
Move the sample text logic into SpeechSynthesis.getSampleText and add test cases for it.
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.reecedunn.espeak.test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -307,4 +306,26 @@ public class SpeechSynthesisTest extends AndroidTestCase
|
||||
assertThat(voice.match(eng_GBR_scotland), is(TextToSpeech.LANG_COUNTRY_VAR_AVAILABLE));
|
||||
assertThat(voice.match(eng_GBR_north), is(TextToSpeech.LANG_COUNTRY_AVAILABLE));
|
||||
}
|
||||
|
||||
public void testGetSampleText()
|
||||
{
|
||||
for (VoiceData.Voice data : VoiceData.voices)
|
||||
{
|
||||
if (mRemoved.contains(data.name))
|
||||
{
|
||||
Log.i("SpeechSynthesisTest", "Skipping the missing voice '" + data.name + "'");
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
final Locale ianaLocale = new Locale(data.ianaLanguage, data.ianaCountry, data.variant);
|
||||
assertThat(SpeechSynthesis.getSampleText(getContext(), ianaLocale), is(data.sampleText));
|
||||
}
|
||||
catch (AssertionError e)
|
||||
{
|
||||
throw new VoiceData.Exception(data, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user