graphics: Fix tests

This commit is contained in:
Hajime Hoshi 2017-05-27 17:25:47 +09:00
parent 1b1b996817
commit 0ab46b1780
2 changed files with 3 additions and 4 deletions

View File

@ -151,7 +151,6 @@ func TestColorMConcatSelf(t *testing.T) {
m := ColorM{}
for i := 0; i < 4; i++ {
for j := 0; j < 5; j++ {
println(i, j, float64((i+j)%5+1))
m.SetElement(i, j, float64((i+j)%5+1))
}
}

View File

@ -230,12 +230,12 @@ func TestImageScale(t *testing.T) {
return
}
for j := 0; j < h*2; j++ {
for i := 0; i < w*2; i++ {
for j := 0; j < h*scale; j++ {
for i := 0; i < w*scale; i++ {
c0 := img0.At(i/scale, j/scale).(color.RGBA)
c1 := img1.At(i, j).(color.RGBA)
if c0 != c1 {
t.Errorf("img0.At(%[1]d, %[2]d) should equal to img1.At(%[3]d, %[4]d) (with scale %[5]d) but not: %[6]v vs %[7]v", i/2, j/2, i, j, scale, c0, c1)
t.Fatalf("img0.At(%[1]d, %[2]d) should equal to img1.At(%[3]d, %[4]d) (with scale %[5]d) but not: %[6]v vs %[7]v", i/2, j/2, i, j, scale, c0, c1)
}
}
}