File: test_dump.lua

package info (click to toggle)
bpfcc 0.31.0%2Bds-7
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 27,208 kB
  • sloc: ansic: 758,058; python: 40,671; cpp: 25,637; sh: 780; makefile: 279
file content (10 lines) | stat: -rw-r--r-- 310 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
local suite = require("test_helper")
local TestDump = {}

function TestDump:test_dump_func()
  local raw = "\xb7\x00\x00\x00\x01\x00\x00\x00\x95\x00\x00\x00\x00\x00\x00\x00"
  local b = BPF:new{text=[[int entry(void) { return 1; }]]}
  assert_equals(b:dump_func("entry"), raw)
end

suite("TestDump", TestDump)