Browse Source

Add tests verifying that calling getSampleText does not change the apps locale.

master
Reece H. Dunn 12 years ago
parent
commit
6edd17eb0c

+ 3
- 0
android/eSpeakTests/src/com/reecedunn/espeak/test/SpeechSynthesisTest.java View File

@@ -340,6 +340,7 @@ public class SpeechSynthesisTest extends AndroidTestCase

public void testGetSampleText()
{
final String[] currentLocales = getContext().getResources().getAssets().getLocales();
for (VoiceData.Voice data : VoiceData.voices)
{
if (mRemoved.contains(data.name))
@@ -352,11 +353,13 @@ public class SpeechSynthesisTest extends AndroidTestCase
{
final Locale ianaLocale = new Locale(data.ianaLanguage, data.ianaCountry, data.variant);
assertThat(SpeechSynthesis.getSampleText(getContext(), ianaLocale), is(data.sampleText));
assertThat(getContext().getResources().getAssets().getLocales(), is(currentLocales));

if (!data.javaLanguage.equals(""))
{
final Locale javaLocale = new Locale(data.javaLanguage, data.javaCountry, data.variant);
assertThat(SpeechSynthesis.getSampleText(getContext(), javaLocale), is(data.sampleText));
assertThat(getContext().getResources().getAssets().getLocales(), is(currentLocales));
}
}
catch (AssertionError e)

Loading…
Cancel
Save