aboutsummaryrefslogtreecommitdiff
path: root/tun/wintun/setupapi/zsetupapi_windows_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tun/wintun/setupapi/zsetupapi_windows_test.go')
-rw-r--r--tun/wintun/setupapi/zsetupapi_windows_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/tun/wintun/setupapi/zsetupapi_windows_test.go b/tun/wintun/setupapi/zsetupapi_windows_test.go
new file mode 100644
index 0000000..09b9195
--- /dev/null
+++ b/tun/wintun/setupapi/zsetupapi_windows_test.go
@@ -0,0 +1,20 @@
+/* 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))
+ if errWin, ok := err.(syscall.Errno); !ok || errWin != 6 /*ERROR_INVALID_HANDLE*/ {
+ t.Errorf("SetupDiDestroyDeviceInfoList(nil, ...) should fail with ERROR_INVALID_HANDLE")
+ }
+}