github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/pkg/report/openbsd_test.go (about)

     1  // Copyright 2018 syzkaller project authors. All rights reserved.
     2  // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  package report
     5  
     6  import (
     7  	"testing"
     8  )
     9  
    10  func TestOpenbsdSymbolizeLine(t *testing.T) {
    11  	tests := []symbolizeLineTest{
    12  		// Normal symbolization.
    13  		{
    14  			"closef(ffffffff,ffffffff) at closef+0xaf\n",
    15  			"closef(ffffffff,ffffffff) at closef+0xaf kern_descrip.c:1241\n",
    16  		},
    17  		// Inlined frames.
    18  		{
    19  			"sleep_finish_all(ffffffff,32) at sleep_finish_all+0x22\n",
    20  			"sleep_finish_all(ffffffff,32) at sleep_finish_all+0x22 sleep_finish_timeout kern_synch.c:336 [inline]\n" +
    21  				"sleep_finish_all(ffffffff,32) at sleep_finish_all+0x22 kern_synch.c:157\n",
    22  		},
    23  		// Missing symbol.
    24  		{
    25  			"foo(ffffffff,ffffffff) at foo+0x1e",
    26  			"foo(ffffffff,ffffffff) at foo+0x1e",
    27  		},
    28  		// Witness symbolization.
    29  		{
    30  			"#4  closef+0xaf\n",
    31  			"#4  closef+0xaf kern_descrip.c:1241\n",
    32  		},
    33  		{
    34  			"#10 closef+0xaf\n",
    35  			"#10 closef+0xaf kern_descrip.c:1241\n",
    36  		},
    37  	}
    38  	testSymbolizeLine(t, ctorOpenbsd, tests)
    39  }