From e6c2cf5f00826385018292e80935dd8972b55950 Mon Sep 17 00:00:00 2001 From: saxon Date: Wed, 4 Jul 2018 22:19:45 +0930 Subject: [PATCH] Improved error message --- parser/parser_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parser/parser_test.go b/parser/parser_test.go index dfb95f11..066dbf11 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -28,6 +28,7 @@ LICENSE package parser import ( + "fmt" "io/ioutil" "log" "os" @@ -68,9 +69,10 @@ func TestH264Parser(t *testing.T) { select { case parser.InputChan() <- data[i]: case frame := <-parser.OutputChan(): - out, err := os.Create("testOutput/" + strconv.Itoa(n) + ".h264_frame") + path := fmt.Sprintf("testOutput/" + strconv.Itoa(n) + "h264_frame") + out, err := os.Create(path) if err != nil { - t.Errorf("Should not have got error creating output file!") + t.Errorf("Unexpected error creating %q: %v", path, err) return } out.Write(frame)