From dc7af8fba398233963b420c8fb98b9ec825a0a18 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 30 Oct 2019 14:56:37 +0100 Subject: [PATCH] cmd/gogio: use a more difficult color for end-to-end tests RGB 0xff0000 is too easy to get right by accident. Signed-off-by: Elias Naur --- cmd/gogio/js_test.go | 4 ++-- cmd/gogio/testdata/red.go | 2 +- cmd/gogio/x11_test.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/gogio/js_test.go b/cmd/gogio/js_test.go index a04f2796..2c91fc18 100644 --- a/cmd/gogio/js_test.go +++ b/cmd/gogio/js_test.go @@ -127,8 +127,8 @@ func TestJSOnChrome(t *testing.T) { t.Fatalf("expected dimensions to be %d*%d, got %d*%d", wantSize, wantSize, size.X, size.Y) } - wantColor(t, img, 5, 5, 0xffff, 0x0, 0x0) - wantColor(t, img, 595, 595, 0xffff, 0x0, 0x0) + wantColor(t, img, 5, 5, 0xdede, 0xadad, 0xbebe) + wantColor(t, img, 595, 595, 0xdede, 0xadad, 0xbebe) } func wantColor(t *testing.T, img image.Image, x, y int, r, g, b uint32) { diff --git a/cmd/gogio/testdata/red.go b/cmd/gogio/testdata/red.go index 481b6a31..819f89e4 100644 --- a/cmd/gogio/testdata/red.go +++ b/cmd/gogio/testdata/red.go @@ -25,7 +25,7 @@ func main() { } func loop(w *app.Window) error { - background := color.RGBA{255, 0, 0, 255} + background := color.RGBA{R: 0xde, G: 0xad, B: 0xbe, A: 0xff} ops := new(op.Ops) for { e := <-w.Events() diff --git a/cmd/gogio/x11_test.go b/cmd/gogio/x11_test.go index 337e2118..9d26987d 100644 --- a/cmd/gogio/x11_test.go +++ b/cmd/gogio/x11_test.go @@ -170,7 +170,7 @@ func TestX11(t *testing.T) { t.Fatalf("expected dimensions to be %d*%d, got %d*%d", wantSize, wantSize, size.X, size.Y) } - wantColor(t, img, 5, 5, 0xffff, 0x0, 0x0) - wantColor(t, img, 595, 595, 0xffff, 0x0, 0x0) + wantColor(t, img, 5, 5, 0xdede, 0xadad, 0xbebe) + wantColor(t, img, 595, 595, 0xdede, 0xadad, 0xbebe) } }