forked from security/hakurei
This uses the Go map and is verified against libseccomp. Signed-off-by: Ophestra <cat@gensokyo.uk>
21 lines
444 B
Go
21 lines
444 B
Go
package seccomp
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestSyscallResolveName(t *testing.T) {
|
|
for name, want := range Syscalls() {
|
|
t.Run(name, func(t *testing.T) {
|
|
if got := syscallResolveName(name); got != want {
|
|
t.Errorf("syscallResolveName(%q) = %d, want %d",
|
|
name, got, want)
|
|
}
|
|
if got, ok := SyscallResolveName(name); !ok || got != want {
|
|
t.Errorf("SyscallResolveName(%q) = %d, want %d",
|
|
name, got, want)
|
|
}
|
|
})
|
|
}
|
|
}
|