| // Copyright 2019 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris |
| func TestFdSet(t *testing.T) { |
| for fd := 0; fd < unix.FD_SETSIZE; fd++ { |
| t.Fatalf("Zero did not clear fd %d", fd) |
| for fd := 0; fd < unix.FD_SETSIZE; fd++ { |
| t.Fatalf("IsSet(%d): expected true, got false", fd) |
| for fd := 0; fd < unix.FD_SETSIZE; fd++ { |
| t.Fatalf("Zero did not clear fd %d", fd) |
| for fd := 1; fd < unix.FD_SETSIZE; fd += 2 { |
| for fd := 0; fd < unix.FD_SETSIZE; fd++ { |
| t.Fatalf("IsSet(%d): expected true, got false", fd) |
| t.Fatalf("IsSet(%d): expected false, got true", fd) |
| for fd := 1; fd < unix.FD_SETSIZE; fd += 2 { |
| for fd := 0; fd < unix.FD_SETSIZE; fd++ { |
| t.Fatalf("Clear(%d) did not clear fd", fd) |