mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-08-28 04:46:50 -04:00
TestLookupEmptyNameFails was an identical copy of TestLookupInvalidSid in the same file. This commit changes the account name queried by the former to an empty string which is what the name of the test case suggests. Signed-off-by: Michael Hofmann <michael.hofmann@bitgestalt.com>
29 lines
727 B
Go
29 lines
727 B
Go
// +build windows
|
|
|
|
package winio
|
|
|
|
import "testing"
|
|
|
|
func TestLookupInvalidSid(t *testing.T) {
|
|
_, err := LookupSidByName(".\\weoifjdsklfj")
|
|
aerr, ok := err.(*AccountLookupError)
|
|
if !ok || aerr.Err != cERROR_NONE_MAPPED {
|
|
t.Fatalf("expected AccountLookupError with ERROR_NONE_MAPPED, got %s", err)
|
|
}
|
|
}
|
|
|
|
func TestLookupValidSid(t *testing.T) {
|
|
sid, err := LookupSidByName("Everyone")
|
|
if err != nil || sid != "S-1-1-0" {
|
|
t.Fatalf("expected S-1-1-0, got %s, %s", sid, err)
|
|
}
|
|
}
|
|
|
|
func TestLookupEmptyNameFails(t *testing.T) {
|
|
_, err := LookupSidByName("")
|
|
aerr, ok := err.(*AccountLookupError)
|
|
if !ok || aerr.Err != cERROR_NONE_MAPPED {
|
|
t.Fatalf("expected AccountLookupError with ERROR_NONE_MAPPED, got %s", err)
|
|
}
|
|
}
|