mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-28 04:46:44 -04:00
windows: make TestSystemModuleVersions more tolerant
One file can't be read on LUCI's Windows image:
syscall_windows_test.go:892: CimFS.SYS: The specified resource type cannot be found in the image file.
That doesn't seem like a good enough reason to fail the test. Skip the
file if this error is encountered.
Change-Id: Id9a65b3ff748bbf7ef7fac37d3741c16e001a4b0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/505220
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Heschi Kreinick <heschi@google.com>
Auto-Submit: Heschi Kreinick <heschi@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
This commit is contained in:
committed by
Gopher Robot
parent
d1abdad3a4
commit
0a92922092
@@ -888,22 +888,21 @@ func TestSystemModuleVersions(t *testing.T) {
|
||||
var zero windows.Handle
|
||||
infoSize, err := windows.GetFileVersionInfoSize(driverPath, &zero)
|
||||
if err != nil {
|
||||
if err != windows.ERROR_FILE_NOT_FOUND {
|
||||
t.Error(err)
|
||||
if err != windows.ERROR_FILE_NOT_FOUND && err != windows.ERROR_RESOURCE_TYPE_NOT_FOUND {
|
||||
t.Errorf("%v: %v", moduleName, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
versionInfo := make([]byte, infoSize)
|
||||
err = windows.GetFileVersionInfo(driverPath, 0, infoSize, unsafe.Pointer(&versionInfo[0]))
|
||||
if err != nil && err != windows.ERROR_FILE_NOT_FOUND {
|
||||
t.Error(err)
|
||||
if err = windows.GetFileVersionInfo(driverPath, 0, infoSize, unsafe.Pointer(&versionInfo[0])); err != nil {
|
||||
t.Errorf("%v: %v", moduleName, err)
|
||||
continue
|
||||
}
|
||||
var fixedInfo *windows.VS_FIXEDFILEINFO
|
||||
fixedInfoLen := uint32(unsafe.Sizeof(*fixedInfo))
|
||||
err = windows.VerQueryValue(unsafe.Pointer(&versionInfo[0]), `\`, (unsafe.Pointer)(&fixedInfo), &fixedInfoLen)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
t.Errorf("%v: %v", moduleName, err)
|
||||
continue
|
||||
}
|
||||
t.Logf("%s: v%d.%d.%d.%d", moduleName,
|
||||
|
||||
Reference in New Issue
Block a user