From df1087b09629381d55aa24786ecd121ffd540866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Garc=C3=ADa?= Date: Mon, 13 Dec 2021 20:51:09 +0100 Subject: [PATCH] =?UTF-8?q?Peque=C3=B1as=20correcciones=20de=20tests=20#49?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/autoeq/autoeq_test.go | 8 +++++--- pkg/autoeq/output.go | 2 +- pkg/autoeq/reader.go | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/autoeq/autoeq_test.go b/pkg/autoeq/autoeq_test.go index 01bf948..2bb54b7 100644 --- a/pkg/autoeq/autoeq_test.go +++ b/pkg/autoeq/autoeq_test.go @@ -14,12 +14,14 @@ func TestOpenParametricData(t *testing.T) { t.Log("Parametric EQ config reading test") fixture := "../../docs/examples/AutoEQ_parametric.txt" - returnedLines := OpenParametricData(fixture) + returnedLines, err := OpenParametricData(fixture) + assert.EqualValues(Success, err, "Error while opening parametric data") + returnedLinesType := reflect.TypeOf(returnedLines).String() wantedLen := 11 - assert.Equal(len(returnedLines), wantedLen, "Wrong number of bands read") - assert.Equal(returnedLinesType, "[]string", "Expected []string but found "+returnedLinesType) + assert.Equal(wantedLen, len(returnedLines), "Wrong number of bands read") + assert.Equal("[]string", returnedLinesType, "Expected []string but found "+returnedLinesType) } func TestCreateBandMap(t *testing.T) { diff --git a/pkg/autoeq/output.go b/pkg/autoeq/output.go index 5573f64..6b4af56 100644 --- a/pkg/autoeq/output.go +++ b/pkg/autoeq/output.go @@ -23,7 +23,7 @@ func NewOutput(eq equalizer) outputWrapper { func AutoeqToEasyEffects(configPath string) outputWrapper { lines, err := OpenParametricData(configPath) - if err != 0 { + if err != Success { NewLogger().Log(uint(err)) } diff --git a/pkg/autoeq/reader.go b/pkg/autoeq/reader.go index 21507e4..0b234d1 100644 --- a/pkg/autoeq/reader.go +++ b/pkg/autoeq/reader.go @@ -37,7 +37,7 @@ func OpenParametricData(path string) ([]string, ErrorType) { for sc.Scan() { lines = append(lines, sc.Text()) } - return lines, 0 + return lines, Success } func GetPreamp(configHeadline string) float32 {