TextToSpeechTest: move out the unsupported language tests to a separate method and check that the language does not get updated.

This commit is contained in:
Reece H. Dunn
2012-12-16 11:27:33 +00:00
parent 7816a0a204
commit b30311a7d7
@@ -74,10 +74,20 @@ public class TextToSpeechTest extends AndroidTestCase
}
}
public void testUnsupportedLanguage()
{
assertThat(mEngine, is(notNullValue()));
Locale initialLocale = mEngine.getLanguage();
assertThat(mEngine.isLanguageAvailable(new Locale("cel")), is(TextToSpeech.LANG_NOT_SUPPORTED));
assertThat(mEngine.getLanguage().getLanguage(), is(initialLocale.getLanguage()));
assertThat(mEngine.getLanguage().getCountry(), is(initialLocale.getCountry()));
assertThat(mEngine.getLanguage().getVariant(), is(initialLocale.getVariant()));
}
public void testLanguages()
{
assertThat(mEngine, is(notNullValue()));
assertThat(mEngine.isLanguageAvailable(new Locale("cel")), is(TextToSpeech.LANG_NOT_SUPPORTED));
for (VoiceData.Voice data : VoiceData.voices)
{