-
Notifications
You must be signed in to change notification settings - Fork 839
Expand file tree
/
Copy pathtypes_windows_test.go
More file actions
37 lines (29 loc) · 1.04 KB
/
types_windows_test.go
File metadata and controls
37 lines (29 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package ebpf
import (
"os"
"testing"
"github.com/go-quicktest/qt"
"golang.org/x/sys/windows"
)
func TestWindowsProgramTypeForGUID(t *testing.T) {
sampleGUID := windows.GUID{
Data1: 0xf788ef4a, Data2: 0x207d, Data3: 0x4dc3,
Data4: [...]byte{0x85, 0xcf, 0x0f, 0x2e, 0xa1, 0x07, 0x21, 0x3c},
}
_, err := WindowsProgramTypeForGUID("{00000000-0000-0000-0000-000000000001}")
qt.Assert(t, qt.ErrorIs(err, os.ErrNotExist))
programType, err := WindowsProgramTypeForGUID(sampleGUID.String())
qt.Assert(t, qt.IsNil(err))
qt.Assert(t, qt.Equals(WindowsSample, programType))
}
func TestWindowsAttachTypeForGUID(t *testing.T) {
sampleGUID := windows.GUID{
Data1: 0xf788ef4b, Data2: 0x207d, Data3: 0x4dc3,
Data4: [...]byte{0x85, 0xcf, 0x0f, 0x2e, 0xa1, 0x07, 0x21, 0x3c},
}
_, err := WindowsAttachTypeForGUID("{00000000-0000-0000-0000-000000000001}")
qt.Assert(t, qt.ErrorIs(err, os.ErrNotExist))
attachType, err := WindowsAttachTypeForGUID(sampleGUID.String())
qt.Assert(t, qt.IsNil(err))
qt.Assert(t, qt.Equals(AttachWindowsSample, attachType))
}