Using out instead of outputFile

This commit is contained in:
saxon 2018-07-04 22:15:24 +09:30
parent b59e756d53
commit 76909221a9
1 changed files with 6 additions and 6 deletions

View File

@ -68,13 +68,13 @@ func TestH264Parser(t *testing.T) {
select { select {
case parser.InputChan() <- data[i]: case parser.InputChan() <- data[i]:
case frame := <-parser.OutputChan(): case frame := <-parser.OutputChan():
outputFile, err := os.Create("testOutput/" + strconv.Itoa(n) + ".h264_frame") out, err := os.Create("testOutput/" + strconv.Itoa(n) + ".h264_frame")
if err != nil { if err != nil {
t.Errorf("Should not have got error creating output file!") t.Errorf("Should not have got error creating output file!")
return return
} }
outputFile.Write(frame) out.Write(frame)
outputFile.Close() out.Close()
n++ n++
default: default:
} }
@ -113,13 +113,13 @@ func TestMJPEGParser(t *testing.T) {
log.Println("Writing jpegs to files!") log.Println("Writing jpegs to files!")
for i := 0; len(parser.GetOutputChan()) > 0; i++ { for i := 0; len(parser.GetOutputChan()) > 0; i++ {
// Open a new output file // Open a new output file
outputFile, err := os.Create("testOutput/image" + strconv.Itoa(i) + ".jpeg") out, err := os.Create("testOutput/image" + strconv.Itoa(i) + ".jpeg")
if err != nil { if err != nil {
t.Errorf("Should not have got error creating output file!") t.Errorf("Should not have got error creating output file!")
return return
} }
outputFile.Write(<-parser.GetOutputChan()) out.Write(<-parser.GetOutputChan())
outputFile.Close() out.Close()
} }
} }
*/ */