Made the Connection panel more usable for runtime testing

This commit is contained in:
Dmitry Sergeev
2026-09-01 01:28:36 +03:00
parent 047f334413
commit a4626fbb19
3 changed files with 132 additions and 40 deletions
+13
View File
@@ -10,6 +10,19 @@ const (
TopologySynchronized
)
func (t SessionTopology) String() string {
switch t {
case TopologyIdle:
return "idle"
case TopologyIndependent:
return "independent"
case TopologySynchronized:
return "synchronized"
default:
return fmt.Sprintf("SessionTopology(%d)", uint8(t))
}
}
type SyncPredicate func(video, audio FeedConfig) bool
type SessionPlan struct {
+17
View File
@@ -5,6 +5,23 @@ import (
"testing"
)
func TestSessionTopologyString(t *testing.T) {
tests := []struct {
topology SessionTopology
want string
}{
{TopologyIdle, "idle"},
{TopologyIndependent, "independent"},
{TopologySynchronized, "synchronized"},
{SessionTopology(99), "SessionTopology(99)"},
}
for _, tt := range tests {
if got := tt.topology.String(); got != tt.want {
t.Errorf("%d.String() = %q, want %q", tt.topology, got, tt.want)
}
}
}
func TestBuildSessionPlan(t *testing.T) {
base := validCommandSession()
stoppedVideo := stoppedFeed(base.Video)