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

Function TestSequentialHandler_TerminateTerminates

sequential_handler_test.go:153–167  ·  view source on GitHub ↗

Verifies that after termination, the handler does not process any further signals.

(t *testing.T)

Source from the content-addressed store, hash-verified

151
152// Verifies that after termination, the handler does not process any further signals.
153func TestSequentialHandler_TerminateTerminates(t *testing.T) {
154 t.Parallel()
155 handler := NewSequentialSignalHandler()
156 handler.(Terminator).Terminate()
157
158 channelOne := make(chan *Signal)
159 handler.(SignalRegistrar).AddSignal(channelOne)
160
161 writeSignals(handler, 10)
162
163 count, _ := countSignals(channelOne)
164 if count > 0 {
165 t.Errorf("handler continued operating after termination; read %v signals", count)
166 }
167}
168
169// Verifies calling .Terminate() more than once is equivalent to calling it just once.
170func TestSequentialHandler_TerminateIdemopotent(t *testing.T) {

Callers

nothing calls this directly

Calls 5

writeSignalsFunction · 0.85
countSignalsFunction · 0.85
TerminateMethod · 0.65
AddSignalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…