File: test_dump.lua

package info (click to toggle)
bpfcc 0.18.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,368 kB
  • sloc: ansic: 132,727; python: 36,226; cpp: 26,973; sh: 710; yacc: 525; makefile: 141; lex: 94
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)