summaryrefslogtreecommitdiff
path: root/vendor/github.com/AllenDang/w32/advapi32_test.go
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2019-01-12 18:39:45 +0100
committerRuben Pollan <meskio@sindominio.net>2019-01-17 12:30:32 +0100
commitb1247d2d0d51108c910a73891ff3116e5f032ab1 (patch)
treee9948964f0bfb1ad2df3bc7bad02aa1f41ccfbd8 /vendor/github.com/AllenDang/w32/advapi32_test.go
parentefcb8312e31b5c2261b1a1e95ace55b322cfcc27 (diff)
[pkg] all your deps are vendored to us
Diffstat (limited to 'vendor/github.com/AllenDang/w32/advapi32_test.go')
-rw-r--r--vendor/github.com/AllenDang/w32/advapi32_test.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/vendor/github.com/AllenDang/w32/advapi32_test.go b/vendor/github.com/AllenDang/w32/advapi32_test.go
new file mode 100644
index 0000000..72a9198
--- /dev/null
+++ b/vendor/github.com/AllenDang/w32/advapi32_test.go
@@ -0,0 +1,41 @@
+package w32
+
+import (
+ "testing"
+)
+
+func TestInitializeSecurityDescriptor(t *testing.T) {
+ sd, err := InitializeSecurityDescriptor(1)
+ if err != nil {
+ t.Errorf("Failed: %v", err)
+ }
+ t.Logf("SD:\n%#v\n", *sd)
+}
+
+func TestSetSecurityDescriptorDacl(t *testing.T) {
+
+ sd, err := InitializeSecurityDescriptor(1)
+ if err != nil {
+ t.Errorf("Failed to initialize: %v", err)
+ }
+ err = SetSecurityDescriptorDacl(sd, nil)
+ if err != nil {
+ t.Errorf("Failed to set NULL DACL: %v", err)
+ }
+ t.Logf("[OK] Set NULL DACL")
+
+ empty := &ACL{
+ AclRevision: 4,
+ Sbz1: 0,
+ AclSize: 4,
+ AceCount: 0,
+ Sbz2: 0,
+ }
+ err = SetSecurityDescriptorDacl(sd, empty)
+ if err != nil {
+ t.Errorf("Failed to set empty DACL: %v", err)
+ }
+ t.Logf("[OK] Set empty DACL")
+ t.Logf("SD:\n%#v\n", *sd)
+
+}