Commit 0195a293 authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by Brad Fitzpatrick

internal/syscall/windows/registry: fix strict assumptions in TestWalkFullRegistry

It turns out that Windows has "legitimate" keys that have bogus type
values or bogus lengths that don't correspond with their type. On up to
date Windows 10 systems, this test always fails for this reason.

So, this commit alters the test to simply log the discrepancy and move
on.

Fixes #35084

Change-Id: I56e12cc62aff49cfcc38ff01a19dfe53153976a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/202678
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent dded5876
......@@ -551,7 +551,9 @@ func walkKey(t *testing.T, k registry.Key, kname string) {
case registry.DWORD, registry.QWORD:
_, _, err := k.GetIntegerValue(name)
if err != nil {
t.Error(err)
// Sometimes legitimate keys have the wrong sizes, which don't correspond with
// their required size, due to Windows bugs.
t.Logf("warning: GetIntegerValue for type %d of %s of %s failed: %v", valtype, name, kname, err)
}
case registry.BINARY:
_, _, err := k.GetBinaryValue(name)
......@@ -566,7 +568,8 @@ func walkKey(t *testing.T, k registry.Key, kname string) {
case registry.FULL_RESOURCE_DESCRIPTOR, registry.RESOURCE_LIST, registry.RESOURCE_REQUIREMENTS_LIST:
// TODO: not implemented
default:
t.Fatalf("value type %d of %s of %s failed: %v", valtype, name, kname, err)
// Sometimes legitimate keys have the wrong value type, due to Windows bugs.
t.Logf("warning: value type %d of %s of %s failed: %v", valtype, name, kname, err)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment