Skip to content

Commit 29298aa

Browse files
alexbrainmancherrymui
authored andcommitted
windows: delete TestGetKeyboardLayout
According to https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getforegroundwindow GetForegroundWindow can return nil in some circumstances. So GetForegroundWindow cannot be used in the TestGetKeyboardLayout. Just delete the test for now. Fixes golang/go#68671 Change-Id: I7e05ac2f19b1a6310a3f7f690c6d02b0d1f5571e Reviewed-on: https://go-review.googlesource.com/c/sys/+/602335 Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: David Chase <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ayman Bagabas <[email protected]>
1 parent aa1c4c8 commit 29298aa

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

windows/syscall_windows_test.go

-11
Original file line numberDiff line numberDiff line change
@@ -1438,17 +1438,6 @@ uintptr_t beep(void) {
14381438
}
14391439
}
14401440

1441-
func TestGetKeyboardLayout(t *testing.T) {
1442-
fg := windows.GetForegroundWindow()
1443-
tid, err := windows.GetWindowThreadProcessId(fg, nil)
1444-
if err != nil {
1445-
t.Fatalf("GetWindowThreadProcessId failed: %v", err)
1446-
}
1447-
1448-
// We don't care about the result, just that it doesn't crash.
1449-
_ = windows.GetKeyboardLayout(tid)
1450-
}
1451-
14521441
func TestToUnicodeEx(t *testing.T) {
14531442
var utf16Buf [16]uint16
14541443

0 commit comments

Comments
 (0)