nswrap/ast/deprecated_attr_test.go

49 lines
2.1 KiB
Go
Raw Normal View History

2019-04-09 11:52:21 -04:00
package ast
import (
"testing"
)
func TestDeprecatedAttr(t *testing.T) {
2019-06-04 00:14:04 -04:00
nodes := map[string]testNode{
`0x7fec4b0ab9c0 <line:180:48, col:63> "This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead." ""`: testNode{&DeprecatedAttr{
2019-04-09 11:52:21 -04:00
Addr: 0x7fec4b0ab9c0,
Pos: NewPositionFromString("line:180:48, col:63"),
Message1: "This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.",
Message2: "",
IsInherited: false,
ChildNodes: []Node{},
},
0x7fec4b0ab9c0,
NewPositionFromString("line:180:48, col:63"),
[]Node{},
2019-06-04 00:14:04 -04:00
},
`0xb75d00 <line:1107:12> "This function or variable may be unsafe. Consider using _snwprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details." ""`: testNode{&DeprecatedAttr{
2019-04-09 11:52:21 -04:00
Addr: 0xb75d00,
Pos: NewPositionFromString("line:1107:12"),
Message1: "This function or variable may be unsafe. Consider using _snwprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.",
Message2: "",
IsInherited: false,
ChildNodes: []Node{},
},
0xb75d00,
NewPositionFromString("line:1107:12"),
[]Node{},
2019-06-04 00:14:04 -04:00
},
`0xb75d00 <line:1107:12> Inherited "This function or variable may be unsafe. Consider using _snwprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details." ""`: testNode{&DeprecatedAttr{
2019-04-09 11:52:21 -04:00
Addr: 0xb75d00,
Pos: NewPositionFromString("line:1107:12"),
Message1: "This function or variable may be unsafe. Consider using _snwprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.",
Message2: "",
IsInherited: true,
ChildNodes: []Node{},
},
0xb75d00,
NewPositionFromString("line:1107:12"),
[]Node{},
2019-06-04 00:14:04 -04:00
},
2019-04-09 11:52:21 -04:00
}
runNodeTests(t, nodes)
}