2019-02-01 09:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
* Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package setupapi
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"golang.org/x/sys/windows"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestSetupDiDestroyDeviceInfoList(t *testing.T) {
|
|
|
|
err := SetupDiDestroyDeviceInfoList(DevInfo(windows.InvalidHandle))
|
2019-04-12 23:58:53 +00:00
|
|
|
if errWin, ok := err.(syscall.Errno); !ok || errWin != windows.ERROR_INVALID_HANDLE {
|
2019-02-01 09:58:06 +00:00
|
|
|
t.Errorf("SetupDiDestroyDeviceInfoList(nil, ...) should fail with ERROR_INVALID_HANDLE")
|
|
|
|
}
|
|
|
|
}
|