aboutsummaryrefslogtreecommitdiffstats
path: root/tun/wintun/setupapi/zsetupapi_windows_test.go
blob: 5b5f369da00ed578189da1b6dec651ca1e956750 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* SPDX-License-Identifier: MIT
 *
 * Copyright (C) 2020 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 != windows.ERROR_INVALID_HANDLE {
		t.Errorf("SetupDiDestroyDeviceInfoList(nil, ...) should fail with ERROR_INVALID_HANDLE")
	}
}