MCPcopy Create free account
hub / github.com/godbus/dbus / TestSequentialHandler_RemoveOneChannelOfOne

Function TestSequentialHandler_RemoveOneChannelOfOne

sequential_handler_test.go:65–83  ·  view source on GitHub ↗

Test that removing one channel results in no more messages being written to that channel.

(t *testing.T)

Source from the content-addressed store, hash-verified

63// Test that removing one channel results in no more messages being
64// written to that channel.
65func TestSequentialHandler_RemoveOneChannelOfOne(t *testing.T) {
66 t.Parallel()
67 handler := NewSequentialSignalHandler()
68
69 channelOne := make(chan *Signal)
70 handler.(SignalRegistrar).AddSignal(channelOne)
71
72 writeSignals(handler, 1000)
73
74 handler.(SignalRegistrar).RemoveSignal(channelOne)
75
76 count, closed := countSignals(channelOne)
77 if count > 1 {
78 t.Error("handler continued writing to channel after removal")
79 }
80 if closed {
81 t.Error("handler closed channel on .RemoveChannel()")
82 }
83}
84
85// Test that removing one channel results in no more messages being
86// written to that channel, and the other channels are unaffected.

Callers

nothing calls this directly

Calls 6

writeSignalsFunction · 0.85
countSignalsFunction · 0.85
AddSignalMethod · 0.65
RemoveSignalMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…