diff --git a/audio/internal/convert/float32_test.go b/audio/internal/convert/float32_test.go index 84ebca609..268459e19 100644 --- a/audio/internal/convert/float32_test.go +++ b/audio/internal/convert/float32_test.go @@ -92,11 +92,14 @@ func TestFloat32(t *testing.T) { break } if seek { - if _, err := r.Seek(0, io.SeekCurrent); err != nil { - if err != io.EOF { - t.Fatal(err) + // Shifting by incomplete bytes should not affect the result. + for i := 0; i < 4; i++ { + if _, err := r.Seek(int64(i), io.SeekCurrent); err != nil { + if err != io.EOF { + t.Fatal(err) + } + break } - break } } } diff --git a/audio/internal/convert/resampling_test.go b/audio/internal/convert/resampling_test.go index 6dcf54a74..e8bc17c4f 100644 --- a/audio/internal/convert/resampling_test.go +++ b/audio/internal/convert/resampling_test.go @@ -105,7 +105,7 @@ func TestResampling(t *testing.T) { t.Fatal(err) } // Shifting by incomplete bytes should not affect the result. - for i := 0; i < bitDepthInBytes*2-1; i++ { + for i := 0; i < bitDepthInBytes*2; i++ { pos, err := outS.Seek(int64(i), io.SeekCurrent) if err != nil { t.Fatal(err) diff --git a/audio/internal/convert/stereof32_test.go b/audio/internal/convert/stereof32_test.go index 8398cb3b0..33f22b721 100644 --- a/audio/internal/convert/stereof32_test.go +++ b/audio/internal/convert/stereof32_test.go @@ -87,11 +87,14 @@ func TestStereoF32(t *testing.T) { } break } - if _, err := s.Seek(0, io.SeekCurrent); err != nil { - if err != io.EOF { - t.Fatal(err) + // Shifting by incomplete bytes should not affect the result. + for i := 0; i < 4*2; i++ { + if _, err := s.Seek(int64(i), io.SeekCurrent); err != nil { + if err != io.EOF { + t.Fatal(err) + } + break } - break } } want := outBytes