Default rate was a bit slow even for being slow. Fixed to a more sane starting point.
This commit is contained in:
1 parent
3b7a44c224
commit
6be06d26af
9 files changed
+17
-17
No files matched your search
@@ -46,7 +46,7 @@ func TestCLIWithoutOpeningDevices(t *testing.T) {
|
||||
text string
|
||||
}{
|
||||
{[]string{"--help"}, 0, "keypad 7/8/9"},
|
||||
{[]string{"--help"}, 0, "(default -20)"},
|
||||
{[]string{"--help"}, 0, "Speech Dispatcher rate (-100 to 100)"},
|
||||
{[]string{"-f", "--help"}, 0, "stay in the foreground"},
|
||||
{[]string{"-f", "--version"}, 0, "fenrir " + version.Label()},
|
||||
{[]string{"--version"}, 0, "fenrir " + version.Label()},
|
||||
|
||||
@@ -23,8 +23,8 @@ hardware_device = ""
|
||||
hardware_baud_rate = 0
|
||||
enabled = true
|
||||
# Shared -100 to 100 scale; hardware drivers map it to native ranges.
|
||||
# -20 corresponds to 0.4 on Python Fenrir's 0.0 to 1.0 scale.
|
||||
rate = -20
|
||||
# 0 is the synthesizer's normal rate.
|
||||
rate = 0
|
||||
# Empty choices use the server default. Voice names are module-specific.
|
||||
module = ""
|
||||
language = ""
|
||||
|
||||
@@ -271,7 +271,7 @@ func TestAttributeSessionToggleQuickSaveAndFreshStartup(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
saved, _, err := config.Load(path, nil)
|
||||
if err != nil || saved.Reading.Attributes != mode || saved.Reading.AttributeFormat != "fenrirBold" || saved.Presentation.Speech.Rate != -10 {
|
||||
if err != nil || saved.Reading.Attributes != mode || saved.Reading.AttributeFormat != "fenrirBold" || saved.Presentation.Speech.Rate != 10 {
|
||||
t.Fatal("temporary toggle persisted", saved, err)
|
||||
}
|
||||
settings = saved
|
||||
|
||||
@@ -90,14 +90,14 @@ func TestHardwareQuickSettingsOnlyOfferSupportedControls(t *testing.T) {
|
||||
menu.selectSpeech = func(config.Speech, func(error, bool)) {
|
||||
t.Fatal("hardware numeric adjustment tried reopening the device")
|
||||
}
|
||||
for _, want := range []string{"speech pitch 0", "speech volume 100", "speech rate -20"} {
|
||||
for _, want := range []string{"speech pitch 0", "speech volume 100", "speech rate 0"} {
|
||||
menu.command(command.NextQuickEntry, &settings, voice)
|
||||
if got := voice.messages[len(voice.messages)-1]; got != want {
|
||||
t.Fatal(driver, got, want)
|
||||
}
|
||||
}
|
||||
menu.command(command.NextQuickValue, &settings, voice)
|
||||
if settings.Presentation.Speech.Rate != -10 || voice.parameters[len(voice.parameters)-1].Rate != -10 {
|
||||
if settings.Presentation.Speech.Rate != 10 || voice.parameters[len(voice.parameters)-1].Rate != 10 {
|
||||
t.Fatal(settings, voice.parameters)
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ func TestQuickChangesSurviveMenuCancelAndExplicitSaveThenQuit(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
saved, _, err := config.Load(path, nil)
|
||||
if err != nil || saved.Presentation.Speech.Rate != -10 || saved.Presentation.Speech.Pitch != -10 || !saved.Reading.Automatic || saved.Reading.Mode != "table" || !reflect.DeepEqual(saved.General, base.General) {
|
||||
if err != nil || saved.Presentation.Speech.Rate != 10 || saved.Presentation.Speech.Pitch != -10 || !saved.Reading.Automatic || saved.Reading.Mode != "table" || !reflect.DeepEqual(saved.General, base.General) {
|
||||
t.Fatal(saved, err)
|
||||
}
|
||||
if !strings.Contains(strings.Join(voice.messages, "|"), "Settings saved.") {
|
||||
@@ -209,7 +209,7 @@ func TestSessionMuteDoesNotPersistAcrossRestart(t *testing.T) {
|
||||
if err != nil || settings.Presentation.Speech.Enabled != trial.enabled {
|
||||
t.Fatal("session mute changed saved speech enablement", settings.Presentation.Speech, err)
|
||||
}
|
||||
if trial.save && settings.Presentation.Speech.Rate != -10 {
|
||||
if trial.save && settings.Presentation.Speech.Rate != 10 {
|
||||
t.Fatal("quick speech adjustment was not saved", settings.Presentation.Speech)
|
||||
}
|
||||
}
|
||||
@@ -278,7 +278,7 @@ func TestSessionAutomaticReadingDoesNotPersistAcrossRestart(t *testing.T) {
|
||||
if err != nil || settings.Reading.Automatic != trial.automatic || !settings.Presentation.Speech.Enabled {
|
||||
t.Fatal("session reading toggle changed saved startup behavior", settings, err)
|
||||
}
|
||||
if trial.save && settings.Presentation.Speech.Rate != -10 {
|
||||
if trial.save && settings.Presentation.Speech.Rate != 10 {
|
||||
t.Fatal("quick adjustment was not saved", settings.Presentation.Speech)
|
||||
}
|
||||
}
|
||||
@@ -306,7 +306,7 @@ func TestSaveFailureKeepsRunningQuickSettings(t *testing.T) {
|
||||
case <-time.After(time.Second):
|
||||
t.Fatal("save hung")
|
||||
}
|
||||
if saver.busy || settings.Presentation.Speech.Rate != -10 || voice.messages[len(voice.messages)-1] != "Failed to save settings." {
|
||||
if saver.busy || settings.Presentation.Speech.Rate != 10 || voice.messages[len(voice.messages)-1] != "Failed to save settings." {
|
||||
t.Fatal(settings, voice.messages)
|
||||
}
|
||||
}
|
||||
@@ -342,7 +342,7 @@ func TestQuickCategoriesRememberSelectionAndWrap(t *testing.T) {
|
||||
t.Fatalf("%s: got %q, want %q", trial.id, got, trial.want)
|
||||
}
|
||||
}
|
||||
if menu := new_quick_settings("speech-dispatcher"); !menu.command(command.CurrentQuickEntry, &settings, voice) || voice.messages[len(voice.messages)-1] != "speech rate -20" {
|
||||
if menu := new_quick_settings("speech-dispatcher"); !menu.command(command.CurrentQuickEntry, &settings, voice) || voice.messages[len(voice.messages)-1] != "speech rate 0" {
|
||||
t.Fatal("new session did not reset selection", voice.messages)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ func TestMenuSelectionFailurePreservesDiskAndCommittedSaveSurvivesClose(t *testi
|
||||
t.Fatal("failure changed disk/live", outcome)
|
||||
}
|
||||
} else {
|
||||
if outcome != nil || a.settings.live.Presentation.Speech.Voice != "Base Voice" || a.settings.live.Presentation.Speech.Rate != -10 || a.settings.resetBase.Presentation.Speech.Rate != -20 || a.settings.resetBase.Presentation.Speech.Voice != "Base Voice" {
|
||||
if outcome != nil || a.settings.live.Presentation.Speech.Voice != "Base Voice" || a.settings.live.Presentation.Speech.Rate != 10 || a.settings.resetBase.Presentation.Speech.Rate != 0 || a.settings.resetBase.Presentation.Speech.Voice != "Base Voice" {
|
||||
t.Fatal("committed selection or newer numeric override lost", outcome, a.settings.live, a.settings.resetBase)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ type Reading struct {
|
||||
}
|
||||
|
||||
func Defaults() Settings {
|
||||
return Settings{Screen: Screen{IgnoredVTs: []int{}}, Review: Review{LineBreak: true, EndOfScreen: true, LeaveReviewOnCursorChange: true, LeaveReviewOnScreenChange: true}, Prompt: Prompt{ExactMatches: []string{}, CustomPatterns: []string{}}, Version: 3, Presentation: Presentation{DateTime: DateTime{TimeFormat: "locale", DateFormat: "locale"}, Progress: Progress{Enabled: true}, Sound: Sound{Enabled: true, Volume: 0.7, Driver: "pulse", Theme: "default", Device: "default"}, Speech: Speech{Enabled: true, Rate: -20, Volume: 100, Driver: "speech-dispatcher"}}, Keyboard: Keyboard{MultiPressTimeoutMS: int(input.DefaultMultiPressTimeout / time.Millisecond), Layout: "desktop", CharacterEcho: true}, Reading: Reading{Emoticons: true, RepeatedSymbolsMin: 4, Spellcheck: true, SpellcheckSound: true, Attributes: "none", AttributeFormat: presentation.Default_attribute_format, Indentation: "none", RaisePitchForCapitals: true, Automatic: true, CursorEcho: true, Mode: "cursor", PunctuationProfile: "default", PunctuationLevel: "some"}, Clipboard: Clipboard{NumberOfClipboards: 200, ExportPath: "/tmp/fenrirClipboard"}, General: General{ScriptPath: "/usr/share/fenrirscreenreader/scripts", ScriptKeys: []string{"KEY_COMPOSE"}}, Scripts: Scripts{Workers: 2, QueueLimit: 16, OutputBytes: 1 << 20}, Remote: Remote{Enabled: true, EnableCommandRemote: true, EnableSettingsRemote: true}}
|
||||
return Settings{Screen: Screen{IgnoredVTs: []int{}}, Review: Review{LineBreak: true, EndOfScreen: true, LeaveReviewOnCursorChange: true, LeaveReviewOnScreenChange: true}, Prompt: Prompt{ExactMatches: []string{}, CustomPatterns: []string{}}, Version: 3, Presentation: Presentation{DateTime: DateTime{TimeFormat: "locale", DateFormat: "locale"}, Progress: Progress{Enabled: true}, Sound: Sound{Enabled: true, Volume: 0.7, Driver: "pulse", Theme: "default", Device: "default"}, Speech: Speech{Enabled: true, Rate: 0, Volume: 100, Driver: "speech-dispatcher"}}, Keyboard: Keyboard{MultiPressTimeoutMS: int(input.DefaultMultiPressTimeout / time.Millisecond), Layout: "desktop", CharacterEcho: true}, Reading: Reading{Emoticons: true, RepeatedSymbolsMin: 4, Spellcheck: true, SpellcheckSound: true, Attributes: "none", AttributeFormat: presentation.Default_attribute_format, Indentation: "none", RaisePitchForCapitals: true, Automatic: true, CursorEcho: true, Mode: "cursor", PunctuationProfile: "default", PunctuationLevel: "some"}, Clipboard: Clipboard{NumberOfClipboards: 200, ExportPath: "/tmp/fenrirClipboard"}, General: General{ScriptPath: "/usr/share/fenrirscreenreader/scripts", ScriptKeys: []string{"KEY_COMPOSE"}}, Scripts: Scripts{Workers: 2, QueueLimit: 16, OutputBytes: 1 << 20}, Remote: Remote{Enabled: true, EnableCommandRemote: true, EnableSettingsRemote: true}}
|
||||
}
|
||||
|
||||
func (s Settings) Validate() error {
|
||||
|
||||
@@ -79,7 +79,7 @@ func TestSettingsSelectionDoesNotHideInvalidOrExplicitMissingFiles(t *testing.T)
|
||||
t.Fatal(err)
|
||||
}
|
||||
settings, selected, err = Load("", []string{userPath, systemPath})
|
||||
if err != nil || selected != userPath || settings.Presentation.Sound.Enabled || settings.Presentation.Speech.Rate != -20 {
|
||||
if err != nil || selected != userPath || settings.Presentation.Sound.Enabled || settings.Presentation.Speech.Rate != 0 {
|
||||
t.Fatalf("user selection merged system values: %+v %s %v", settings, selected, err)
|
||||
}
|
||||
if err := os.WriteFile(userPath, []byte("invalid = true"), 0600); err != nil {
|
||||
@@ -151,7 +151,7 @@ func TestShippedExampleMatchesDefaults(t *testing.T) {
|
||||
func TestSpeechParameterDefaultsAndBounds(t *testing.T) {
|
||||
for _, data := range []string{"version=1\n", "version=2\n", "version=3\n"} {
|
||||
settings, err := Decode([]byte(data))
|
||||
if err != nil || settings.Presentation.Speech.Rate != -20 || settings.Presentation.Speech.Pitch != 0 || settings.Presentation.Speech.Volume != 100 {
|
||||
if err != nil || settings.Presentation.Speech.Rate != 0 || settings.Presentation.Speech.Pitch != 0 || settings.Presentation.Speech.Volume != 100 {
|
||||
t.Fatal(settings, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ func TestStartupSaveDestinationAndLegacySettingsIgnored(t *testing.T) {
|
||||
if err := os.WriteFile(legacyPath, legacy, 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
requested, destination, rate := "", userPath, -20
|
||||
requested, destination, rate := "", userPath, 0
|
||||
if scenario != "defaults" {
|
||||
system := Defaults()
|
||||
system.Presentation.Speech.Rate = 30
|
||||
|
||||
@@ -52,7 +52,7 @@ func TestSettingsFormCoversSchemaAndReturnsIsolatedDraft(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if draft.Presentation.Speech.Enabled || draft.Presentation.Speech.Rate != -19 || !base.Presentation.Speech.Enabled || base.Presentation.Speech.Rate != -20 {
|
||||
if draft.Presentation.Speech.Enabled || draft.Presentation.Speech.Rate != 1 || !base.Presentation.Speech.Enabled || base.Presentation.Speech.Rate != 0 {
|
||||
t.Fatal("draft isolation", draft, base)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user