aboutsummaryrefslogtreecommitdiff
path: root/src/image/image_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/image/image_test.go')
-rw-r--r--src/image/image_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/image/image_test.go b/src/image/image_test.go
index c64b6107b7..7f41bcb6c7 100644
--- a/src/image/image_test.go
+++ b/src/image/image_test.go
@@ -213,7 +213,9 @@ func TestRGBA64Image(t *testing.T) {
NewPaletted(r, palette.Plan9),
NewRGBA(r),
NewRGBA64(r),
+ NewUniform(color.RGBA64{}),
NewYCbCr(r, YCbCrSubsampleRatio444),
+ r,
}
for _, tc := range testCases {
switch tc := tc.(type) {
@@ -226,6 +228,9 @@ func TestRGBA64Image(t *testing.T) {
// means that setting one pixel can modify neighboring pixels. They
// don't have Set or SetRGBA64 methods because that side effect could
// be surprising. Here, we just memset the channel buffers instead.
+ //
+ // The Uniform and Rectangle types are also special-cased, as they
+ // don't have a Set or SetRGBA64 method.
case interface {
SetRGBA64(x, y int, c color.RGBA64)
}:
@@ -237,11 +242,18 @@ func TestRGBA64Image(t *testing.T) {
memset(tc.YCbCr.Cr, 0x99)
memset(tc.A, 0xAA)
+ case *Uniform:
+ tc.C = color.RGBA64{0x7FFF, 0x3FFF, 0x0000, 0x7FFF}
+
case *YCbCr:
memset(tc.Y, 0x77)
memset(tc.Cb, 0x88)
memset(tc.Cr, 0x99)
+ case Rectangle:
+ // No-op. Rectangle pixels' colors are immutable. They're always
+ // color.Opaque.
+
default:
t.Errorf("could not initialize pixels for %T", tc)
continue