MCPcopy Create free account
hub / github.com/CPChain/chain / TestClearQueue

Function TestClearQueue

protocols/cpc/syncer/queue_test.go:29–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestClearQueue(t *testing.T) {
30 q := newQueue(100)
31 q.put(resultTask{"test"})
32 q.put(resultTask{"test1"})
33 q.put(resultTask{"test2"})
34
35 if q.size != 3 {
36 t.Error("queue size is error")
37 }
38
39 q.clear()
40
41 if !q.empty() {
42 t.Error("queue must be empty")
43 }
44}
45
46func TestQueueGetTimeout(t *testing.T) {
47 q := newQueue(100)

Callers

nothing calls this directly

Calls 5

newQueueFunction · 0.85
clearMethod · 0.80
ErrorMethod · 0.65
putMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected