aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/netbsd_test.go
blob: 24c144ac0257f9d1a04aab4d4b52ae11726de20e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2018 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

package report

import (
	"testing"
)

func TestNetbsdSymbolizeLine(t *testing.T) {
	tests := []symbolizeLineTest{
		// Normal symbolization.
		{
			"closef(ffffffff,ffffffff) at netbsd:closef+0xaf\n",
			"closef(ffffffff,ffffffff) at netbsd:closef+0xaf kern_descrip.c:1241\n",
		},
		// Inlined frames.
		{
			"sleep_finish_all(ffffffff,32) at netbsd:sleep_finish_all+0x22\n",
			"sleep_finish_all(ffffffff,32) at netbsd:sleep_finish_all+0x22 sleep_finish_timeout kern_synch.c:336 [inline]\n" +
				"sleep_finish_all(ffffffff,32) at netbsd:sleep_finish_all+0x22 kern_synch.c:157\n",
		},
		// Missing symbol.
		{
			"foo(ffffffff,ffffffff) at netbsd:foo+0x1e",
			"foo(ffffffff,ffffffff) at netbsd:foo+0x1e",
		},
		// Witness symbolization.
		{
			"#4  closef+0xaf\n",
			"#4  closef+0xaf kern_descrip.c:1241\n",
		},
		{
			"#10 closef+0xaf\n",
			"#10 closef+0xaf kern_descrip.c:1241\n",
		},
	}
	testSymbolizeLine(t, ctorNetbsd, tests)
}