delve/pkg/dwarf/op/op_test.go

19 lines
400 B
Go
Raw Normal View History

2014-07-30 00:00:24 +00:00
package op
import "testing"
func TestExecuteStackProgram(t *testing.T) {
var (
instructions = []byte{byte(DW_OP_consts), 0x1c, byte(DW_OP_consts), 0x1c, byte(DW_OP_plus)}
2014-07-30 00:00:24 +00:00
expected = int64(56)
)
actual, _, err := ExecuteStackProgram(DwarfRegisters{}, instructions)
2014-07-30 00:00:24 +00:00
if err != nil {
t.Fatal(err)
}
if actual != expected {
t.Fatalf("actual %d != expected %d", actual, expected)
}
}