mirror of
https://github.com/gen2brain/cam2ip.git
synced 2026-07-01 13:08:08 +00:00
20 lines
510 B
Go
20 lines
510 B
Go
//go:build !android
|
|
|
|
package camera
|
|
|
|
import "testing"
|
|
|
|
func TestSelectFormat(t *testing.T) {
|
|
if f, ok := selectFormat([]uint32{yuyvFourCC, mjpgFourCC}); !ok || f != mjpgFourCC {
|
|
t.Errorf("expected MJPG to win over YUYV, got %d ok=%v", f, ok)
|
|
}
|
|
|
|
if f, ok := selectFormat([]uint32{greyFourCC, yuyvFourCC}); !ok || f != yuyvFourCC {
|
|
t.Errorf("expected YUYV to win over GREY, got %d ok=%v", f, ok)
|
|
}
|
|
|
|
if _, ok := selectFormat([]uint32{fourcc("XVID")}); ok {
|
|
t.Error("expected no supported format")
|
|
}
|
|
}
|