| public void testGetSampleText() | public void testGetSampleText() | ||||
| { | { | ||||
| final String[] currentLocales = getContext().getResources().getAssets().getLocales(); | |||||
| for (VoiceData.Voice data : VoiceData.voices) | for (VoiceData.Voice data : VoiceData.voices) | ||||
| { | { | ||||
| if (mRemoved.contains(data.name)) | if (mRemoved.contains(data.name)) | ||||
| { | { | ||||
| final Locale ianaLocale = new Locale(data.ianaLanguage, data.ianaCountry, data.variant); | final Locale ianaLocale = new Locale(data.ianaLanguage, data.ianaCountry, data.variant); | ||||
| assertThat(SpeechSynthesis.getSampleText(getContext(), ianaLocale), is(data.sampleText)); | assertThat(SpeechSynthesis.getSampleText(getContext(), ianaLocale), is(data.sampleText)); | ||||
| assertThat(getContext().getResources().getAssets().getLocales(), is(currentLocales)); | |||||
| if (!data.javaLanguage.equals("")) | if (!data.javaLanguage.equals("")) | ||||
| { | { | ||||
| final Locale javaLocale = new Locale(data.javaLanguage, data.javaCountry, data.variant); | final Locale javaLocale = new Locale(data.javaLanguage, data.javaCountry, data.variant); | ||||
| assertThat(SpeechSynthesis.getSampleText(getContext(), javaLocale), is(data.sampleText)); | assertThat(SpeechSynthesis.getSampleText(getContext(), javaLocale), is(data.sampleText)); | ||||
| assertThat(getContext().getResources().getAssets().getLocales(), is(currentLocales)); | |||||
| } | } | ||||
| } | } | ||||
| catch (AssertionError e) | catch (AssertionError e) |