2014-07-30 00:00:24 +00:00
|
|
|
package op
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestExecuteStackProgram(t *testing.T) {
|
|
|
|
var (
|
|
|
|
instructions = []byte{DW_OP_consts, 0x1c, DW_OP_consts, 0x1c, DW_OP_plus}
|
|
|
|
expected = int64(56)
|
|
|
|
)
|
2017-10-05 07:26:19 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|