Skip to content

Commit a25a487

Browse files
committed
add tests for dbg
1 parent 89736ae commit a25a487

File tree

3 files changed

+407
-0
lines changed

3 files changed

+407
-0
lines changed
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
package dbg
2+
3+
import "testing"
4+
5+
func TestSetDebugParse(t *testing.T) {
6+
tests := []struct {
7+
name string
8+
}{
9+
{
10+
name: "TestSetDebugParse",
11+
},
12+
}
13+
for _, tt := range tests {
14+
t.Run(tt.name, func(t *testing.T) {
15+
SetDebugParse()
16+
if !GetDebugParse() {
17+
t.Errorf("GetDebugParse() = %v, want %v", false, true)
18+
}
19+
})
20+
}
21+
}
22+
23+
func TestSetDebugAll(t *testing.T) {
24+
tests := []struct {
25+
name string
26+
}{
27+
{
28+
name: "TestSetDebugAll",
29+
},
30+
}
31+
for _, tt := range tests {
32+
t.Run(tt.name, func(t *testing.T) {
33+
SetDebugAll()
34+
if flags != DbgFlagAll {
35+
t.Errorf("flags = %v, want %v", flags, DbgFlagAll)
36+
}
37+
})
38+
}
39+
}
40+
41+
func TestSetDebugVisitTop(t *testing.T) {
42+
tests := []struct {
43+
name string
44+
}{
45+
{
46+
name: "TestSetDebugVisitTop",
47+
},
48+
}
49+
for _, tt := range tests {
50+
t.Run(tt.name, func(t *testing.T) {
51+
SetDebugVisitTop()
52+
if !GetDebugVisitTop() {
53+
t.Errorf("GetDebugVisitTop() = %v, want %v", false, true)
54+
}
55+
})
56+
}
57+
}
58+
59+
func TestSetDebugProcess(t *testing.T) {
60+
tests := []struct {
61+
name string
62+
}{
63+
{
64+
name: "TestSetDebugProcess",
65+
},
66+
}
67+
for _, tt := range tests {
68+
t.Run(tt.name, func(t *testing.T) {
69+
SetDebugProcess()
70+
if !GetDebugProcess() {
71+
t.Errorf("GetDebugProcess() = %v, want %v", false, true)
72+
}
73+
})
74+
}
75+
}
76+
77+
func TestSetDebugGetCurFile(t *testing.T) {
78+
tests := []struct {
79+
name string
80+
}{
81+
{
82+
name: "TestSetDebugGetCurFile",
83+
},
84+
}
85+
for _, tt := range tests {
86+
t.Run(tt.name, func(t *testing.T) {
87+
SetDebugGetCurFile()
88+
if !GetDebugGetCurFile() {
89+
t.Errorf("GetDebugGetCurFile() = %v, want %v", false, true)
90+
}
91+
})
92+
}
93+
}
94+
95+
func TestSetDebugMacro(t *testing.T) {
96+
tests := []struct {
97+
name string
98+
}{
99+
{
100+
name: "TestSetDebugMacro",
101+
},
102+
}
103+
for _, tt := range tests {
104+
t.Run(tt.name, func(t *testing.T) {
105+
SetDebugMacro()
106+
if !GetDebugMacro() {
107+
t.Errorf("GetDebugMacro() = %v, want %v", false, true)
108+
}
109+
})
110+
}
111+
}
112+
113+
func TestSetDebugFileType(t *testing.T) {
114+
tests := []struct {
115+
name string
116+
}{
117+
{
118+
name: "TestSetDebugFileType",
119+
},
120+
}
121+
for _, tt := range tests {
122+
t.Run(tt.name, func(t *testing.T) {
123+
SetDebugFileType()
124+
if !GetDebugFileType() {
125+
t.Errorf("GetDebugFileType() = %v, want %v", false, true)
126+
}
127+
})
128+
}
129+
}

_xtool/llcppsymg/dbg/debug_test.go

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
package dbg
2+
3+
import (
4+
"testing"
5+
)
6+
7+
func TestSetDebugSymbol(t *testing.T) {
8+
tests := []struct {
9+
name string
10+
}{
11+
{
12+
name: "TestSetDebugSymbol",
13+
},
14+
}
15+
for _, tt := range tests {
16+
t.Run(tt.name, func(t *testing.T) {
17+
SetDebugSymbol()
18+
if !GetDebugSymbol() {
19+
t.Errorf("GetDebugSymbol() = got %v, want %v", false, true)
20+
}
21+
})
22+
}
23+
}
24+
25+
func TestSetDebugParseIsMethod(t *testing.T) {
26+
tests := []struct {
27+
name string
28+
}{
29+
{
30+
name: "TestSetDebugParseIsMethod",
31+
},
32+
}
33+
for _, tt := range tests {
34+
t.Run(tt.name, func(t *testing.T) {
35+
SetDebugParseIsMethod()
36+
if !GetDebugParseIsMethod() {
37+
t.Errorf("GetDebugParseIsMethod() = got %v, want %v", false, true)
38+
}
39+
})
40+
}
41+
}
42+
43+
func TestSetDebugEditSymMap(t *testing.T) {
44+
tests := []struct {
45+
name string
46+
}{
47+
{
48+
name: "TestSetDebugEditSymMap",
49+
},
50+
}
51+
for _, tt := range tests {
52+
t.Run(tt.name, func(t *testing.T) {
53+
SetDebugEditSymMap()
54+
if !GetDebugEditSymMap() {
55+
t.Errorf("GetDebugEditSymMap() = %v, want %v", false, true)
56+
}
57+
})
58+
}
59+
}
60+
61+
func TestSetDebugVisitTop(t *testing.T) {
62+
tests := []struct {
63+
name string
64+
}{
65+
{
66+
"TestSetDebugVisitTop",
67+
},
68+
}
69+
for _, tt := range tests {
70+
t.Run(tt.name, func(t *testing.T) {
71+
SetDebugVisitTop()
72+
if !GetDebugVisitTop() {
73+
t.Errorf("GetDebugVisitTop() = %v, want %v", false, true)
74+
}
75+
})
76+
}
77+
}
78+
79+
func TestSetDebugCollectFuncInfo(t *testing.T) {
80+
tests := []struct {
81+
name string
82+
}{
83+
{
84+
name: "TestSetDebugCollectFuncInfo",
85+
},
86+
}
87+
for _, tt := range tests {
88+
t.Run(tt.name, func(t *testing.T) {
89+
SetDebugCollectFuncInfo()
90+
if !GetDebugCollectFuncInfo() {
91+
t.Errorf("GetDebugCollectFuncInfo() got = %v, want %v", false, true)
92+
}
93+
})
94+
}
95+
}
96+
97+
func TestSetDebugNewSymbol(t *testing.T) {
98+
tests := []struct {
99+
name string
100+
}{
101+
{
102+
name: "TestSetDebugNewSymbol",
103+
},
104+
}
105+
for _, tt := range tests {
106+
t.Run(tt.name, func(t *testing.T) {
107+
SetDebugNewSymbol()
108+
if !GetDebugNewSymbol() {
109+
t.Errorf("GetDebugNewSymbol() = %v, want %v", false, true)
110+
}
111+
})
112+
}
113+
}
114+
115+
func TestSetDebugFileType(t *testing.T) {
116+
tests := []struct {
117+
name string
118+
}{
119+
{
120+
name: "TestSetDebugFileType",
121+
},
122+
}
123+
for _, tt := range tests {
124+
t.Run(tt.name, func(t *testing.T) {
125+
SetDebugFileType()
126+
if !GetDebugFileType() {
127+
t.Errorf("GetDebugFileType() = %v, want %v", false, true)
128+
}
129+
})
130+
}
131+
}

0 commit comments

Comments
 (0)