| 1 | package ringbuf |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/go-quicktest/qt" |
| 7 | |
| 8 | "github.com/cilium/ebpf" |
| 9 | "github.com/cilium/ebpf/internal" |
| 10 | "github.com/cilium/ebpf/internal/platform" |
| 11 | "github.com/cilium/ebpf/internal/testutils" |
| 12 | ) |
| 13 | |
| 14 | func mustRun(tb testing.TB, prog *ebpf.Program) { |
| 15 | tb.Helper() |
| 16 | |
| 17 | opts := &ebpf.RunOptions{ |
| 18 | Data: internal.EmptyBPFContext, |
| 19 | } |
| 20 | if platform.IsWindows { |
| 21 | opts.Context = make([]byte, 32) |
| 22 | } |
| 23 | |
| 24 | ret, err := prog.Run(opts) |
| 25 | testutils.SkipIfNotSupported(tb, err) |
| 26 | qt.Assert(tb, qt.IsNil(err)) |
| 27 | |
| 28 | qt.Assert(tb, qt.Equals(ret, uint32(0))) |
| 29 | } |