2019-04-09 11:52:21 -04:00
|
|
|
package ast
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestParenExpr(t *testing.T) {
|
2019-06-04 00:14:04 -04:00
|
|
|
nodes := map[string]testNode{
|
2019-06-11 12:38:22 -04:00
|
|
|
`0x7fb0bc8b2308 <col:10, col:25> 'unsigned char'`: testNode{&ParenExpr{
|
2019-04-09 11:52:21 -04:00
|
|
|
Addr: 0x7fb0bc8b2308,
|
|
|
|
Pos: NewPositionFromString("col:10, col:25"),
|
|
|
|
Type: "unsigned char",
|
|
|
|
Type2: "",
|
|
|
|
Lvalue: false,
|
|
|
|
IsBitfield: false,
|
|
|
|
ChildNodes: []Node{},
|
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
0x7fb0bc8b2308,
|
|
|
|
NewPositionFromString("col:10, col:25"),
|
|
|
|
[]Node{},
|
2019-06-04 00:14:04 -04:00
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
`0x1ff8708 <col:14, col:17> 'T_ENUM':'T_ENUM' lvalue`: testNode{&ParenExpr{
|
2019-04-09 11:52:21 -04:00
|
|
|
Addr: 0x1ff8708,
|
|
|
|
Pos: NewPositionFromString("col:14, col:17"),
|
|
|
|
Type: "T_ENUM",
|
|
|
|
Type2: "T_ENUM",
|
|
|
|
Lvalue: true,
|
|
|
|
IsBitfield: false,
|
|
|
|
ChildNodes: []Node{},
|
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
0x1ff8708,
|
|
|
|
NewPositionFromString("col:14, col:17"),
|
|
|
|
[]Node{},
|
2019-06-04 00:14:04 -04:00
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
`0x55efc60798b0 <col:15, col:27> 'bft':'unsigned int' lvalue bitfield`: testNode{&ParenExpr{
|
2019-04-09 11:52:21 -04:00
|
|
|
Addr: 0x55efc60798b0,
|
|
|
|
Pos: NewPositionFromString("col:15, col:27"),
|
|
|
|
Type: "bft",
|
|
|
|
Type2: "unsigned int",
|
|
|
|
Lvalue: true,
|
|
|
|
IsBitfield: true,
|
|
|
|
ChildNodes: []Node{},
|
|
|
|
},
|
2019-06-11 12:38:22 -04:00
|
|
|
0x55efc60798b0,
|
|
|
|
NewPositionFromString("col:15, col:27"),
|
|
|
|
[]Node{},
|
2019-06-04 00:14:04 -04:00
|
|
|
},
|
2019-04-09 11:52:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
runNodeTests(t, nodes)
|
|
|
|
}
|