nswrap/ast/constant_array_type_test.go

33 lines
648 B
Go
Raw Normal View History

2019-04-09 11:52:21 -04:00
package ast
import (
"testing"
)
func TestConstantArrayType(t *testing.T) {
2019-06-04 00:14:04 -04:00
nodes := map[string]testNode{
`0x7f94ad016a40 'struct __va_list_tag [1]' 1 `: testNode{&ConstantArrayType{
2019-04-09 11:52:21 -04:00
Addr: 0x7f94ad016a40,
Type: "struct __va_list_tag [1]",
Size: 1,
ChildNodes: []Node{},
},
0x7f94ad016a40,
NewPositionFromString(""),
[]Node{},
2019-06-04 00:14:04 -04:00
},
`0x7f8c5f059d20 'char [37]' 37 `: testNode{&ConstantArrayType{
2019-04-09 11:52:21 -04:00
Addr: 0x7f8c5f059d20,
Type: "char [37]",
Size: 37,
ChildNodes: []Node{},
},
0x7f8c5f059d20,
NewPositionFromString(""),
[]Node{},
2019-06-04 00:14:04 -04:00
},
2019-04-09 11:52:21 -04:00
}
runNodeTests(t, nodes)
}