MCPcopy Create free account
hub / github.com/HugoSmits86/nativewebp / TestImageDecodeRegistration

Function TestImageDecodeRegistration

reader_test.go:21–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestImageDecodeRegistration(t *testing.T) {
22 img := generateTestImageNRGBA(8, 16, 64, true)
23 buf := new(bytes.Buffer)
24
25 if err := Encode(buf, img, nil); err != nil {
26 t.Fatalf("Encode failed: %v", err)
27 }
28
29 img, format, err := image.Decode(buf)
30 if err != nil {
31 t.Errorf("image.Decode error %v", err)
32 return
33 }
34
35 if format != "webp" {
36 t.Errorf("expected format as webp got %v", format)
37 return
38 }
39}
40
41func TestDecode(t *testing.T) {
42 img := generateTestImageNRGBA(8, 8, 64, true)

Callers

nothing calls this directly

Calls 2

generateTestImageNRGBAFunction · 0.85
EncodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…