package daemon import ( "testing" "github.com/lwoodard/rtsp-streamer/internal/config" ) func TestClockRectCorners(t *testing.T) { cl := config.Clock{Width: 300, Height: 72, Margin: 24} const w, h = 1920, 1080 cases := map[string][2]int{ "bottom-right": {1920 - 300 - 24, 1080 - 72 - 24}, "bottom-left": {24, 1080 - 72 - 24}, "top-right": {1920 - 300 - 24, 24}, "top-left": {24, 24}, "": {1920 - 300 - 24, 1080 - 72 - 24}, // default = bottom-right } for corner, want := range cases { cl.Corner = corner r := clockRect(w, h, cl) if r.X != want[0] || r.Y != want[1] { t.Errorf("corner %q: got (%d,%d), want (%d,%d)", corner, r.X, r.Y, want[0], want[1]) } if r.W != 300 || r.H != 72 { t.Errorf("corner %q: size (%d,%d), want (300,72)", corner, r.W, r.H) } } }