返回 DeepSeek-Reasonix
hang_watchdog_windows_test.go
根目录 / desktop / hang_watchdog_windows_test.go
1 //go:build windows
2
3 package main
4
5 import "testing"
6
7 func TestCurrentProcessTopLevelWindowReusesEnumCallback(t *testing.T) {
8 if enumWindowsCallback == 0 {
9 t.Fatal("EnumWindows callback was not registered")
10 }
11
12 // Go's Windows runtime currently supports a finite callback table. The old
13 // implementation allocated one callback per poll and exhausted that table
14 // during a normal long-running session.
15 for i := 0; i < 2100; i++ {
16 _ = currentProcessTopLevelWindow()
17 }
18 }
19
19 lines GO