1 // Copyright 2019 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
12 "golang.org/x/sys/unix"
15 func TestFdSet(t *testing.T) {
18 for fd := 0; fd < unix.FD_SETSIZE; fd++ {
20 t.Fatalf("Zero did not clear fd %d", fd)
25 for fd := 0; fd < unix.FD_SETSIZE; fd++ {
27 t.Fatalf("IsSet(%d): expected true, got false", fd)
32 for fd := 0; fd < unix.FD_SETSIZE; fd++ {
34 t.Fatalf("Zero did not clear fd %d", fd)
38 for fd := 1; fd < unix.FD_SETSIZE; fd += 2 {
42 for fd := 0; fd < unix.FD_SETSIZE; fd++ {
45 t.Fatalf("IsSet(%d): expected true, got false", fd)
49 t.Fatalf("IsSet(%d): expected false, got true", fd)
54 for fd := 1; fd < unix.FD_SETSIZE; fd += 2 {
58 for fd := 0; fd < unix.FD_SETSIZE; fd++ {
60 t.Fatalf("Clear(%d) did not clear fd", fd)