MCPcopy Index your code
hub / github.com/Monibuca/engine / TestReorder

Function TestReorder

util/reorder_test.go:15–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13}
14
15func TestReorder(t *testing.T) {
16 t.Run(t.Name(), func(t *testing.T) {
17 var recoder RTPReorder[*stuff]
18 for i := (uint16)(0); i < 25; i++ {
19 recoder.Push(i*2, &stuff{seq: i * 2})
20 }
21 if recoder.Pop() != nil {
22 t.Error("pop nil")
23 }
24 for i := (uint16)(0); i < 25; i++ {
25 x := recoder.Push(i*2+1, &stuff{seq: i*2 + 1})
26 if x != nil {
27 t.Logf("%d", x.seq)
28 }
29 for {
30 if x = recoder.Pop(); x == nil {
31 break
32 } else {
33 t.Logf("%d", x.seq)
34 }
35 }
36 }
37 })
38}

Callers

nothing calls this directly

Calls 3

PopMethod · 0.80
PushMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected