Skip to content

Commit

Permalink
tests: initial language may be null
Browse files Browse the repository at this point in the history
  • Loading branch information
rhdunn committed Oct 28, 2014
1 parent 3d2308e commit 0dd8974
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -32,9 +32,14 @@ public void testUnsupportedLanguage()

Locale initialLocale = getLanguage(getEngine());
assertThat(getEngine().isLanguageAvailable(new Locale("cel")), isTtsLangCode(TextToSpeech.LANG_NOT_SUPPORTED));
assertThat(getLanguage(getEngine()).getLanguage(), is(initialLocale.getLanguage()));
assertThat(getLanguage(getEngine()).getCountry(), is(initialLocale.getCountry()));
assertThat(getLanguage(getEngine()).getVariant(), is(initialLocale.getVariant()));
Locale language = getLanguage(getEngine());
if (language != null) {
assertThat(getLanguage(getEngine()).getLanguage(), is(initialLocale.getLanguage()));
assertThat(getLanguage(getEngine()).getCountry(), is(initialLocale.getCountry()));
assertThat(getLanguage(getEngine()).getVariant(), is(initialLocale.getVariant()));
} else {
assertThat(initialLocale, is(nullValue()));
}
}

public void testLanguages()
Expand Down

0 comments on commit 0dd8974

Please sign in to comment.