Browse Source

VoiceSettingsTest.java: Add missing test case to cover default_pitch and espeak_pitch preferences set.

master
Reece H. Dunn 12 years ago
parent
commit
3259a08ca5

+ 18
- 0
android/eSpeakTests/src/com/reecedunn/espeak/test/VoiceSettingsTest.java View File

@@ -308,4 +308,22 @@ public class VoiceSettingsTest extends TextToSpeechTestCase
assertThat(settings.getPitchRange(), is(synth.PitchRange.getDefaultValue()));
assertThat(settings.getVolume(), is(synth.Volume.getDefaultValue()));
}

public void testEspeakPitchWithDefaultPitch()
{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = prefs.edit();
editor.clear();
editor.putString("default_pitch", Integer.toString(50));
editor.putString("espeak_pitch", Integer.toString(75));
editor.commit();

SpeechSynthesis synth = new SpeechSynthesis(getContext(), mCallback);
VoiceSettings settings = new VoiceSettings(prefs, synth);
assertThat(settings.getVoiceVariant().toString(), is("male"));
assertThat(settings.getRate(), is(synth.Rate.getDefaultValue()));
assertThat(settings.getPitch(), is(75));
assertThat(settings.getPitchRange(), is(synth.PitchRange.getDefaultValue()));
assertThat(settings.getVolume(), is(synth.Volume.getDefaultValue()));
}
}

Loading…
Cancel
Save