github.com/cilium/ebpf@v0.15.1-0.20240517100537-8079b37aa138/btf/ext_info_test.go (about)

     1  package btf
     2  
     3  import (
     4  	"bytes"
     5  	"strings"
     6  	"testing"
     7  
     8  	"github.com/cilium/ebpf/internal"
     9  )
    10  
    11  func TestParseExtInfoBigRecordSize(t *testing.T) {
    12  	rd := strings.NewReader("\xff\xff\xff\xff\x00\x00\x00\x000709171295166016")
    13  	table, err := readStringTable(bytes.NewReader([]byte{0}), nil)
    14  	if err != nil {
    15  		t.Fatal(err)
    16  	}
    17  
    18  	if _, err := parseFuncInfos(rd, internal.NativeEndian, table); err == nil {
    19  		t.Error("Parsing func info with large record size doesn't return an error")
    20  	}
    21  
    22  	if _, err := parseLineInfos(rd, internal.NativeEndian, table); err == nil {
    23  		t.Error("Parsing line info with large record size doesn't return an error")
    24  	}
    25  }