MCPcopy Index your code
hub / github.com/tinode/chat / testHubLoop

Method testHubLoop

server/topic_test.go:177–194  ·  view source on GitHub ↗
(t *testing.T, results map[string][]*ServerComMessage, done chan bool)

Source from the content-addressed store, hash-verified

175}
176
177func (h *Hub) testHubLoop(t *testing.T, results map[string][]*ServerComMessage, done chan bool) {
178 t.Helper()
179 for msg := range h.routeSrv {
180 if msg.RcptTo == "" {
181 // Don't call t.Fatal from goroutine - instead send error info back
182 results["__ERROR__"] = []*ServerComMessage{{
183 Ctrl: &MsgServerCtrl{
184 Code: 500,
185 Text: "Hub.route received a message without addressee.",
186 },
187 }}
188 done <- true
189 return
190 }
191 results[msg.RcptTo] = append(results[msg.RcptTo], msg)
192 }
193 done <- true
194}
195
196func TestHandleBroadcastDataP2P(t *testing.T) {
197 numUsers := 2

Callers 1

setUpMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected