unix: test (*FdSet).Clear in TestFdSet

Follow-up for CL 205397 so all *FdSet functionality is tested.

Change-Id: Ieb5dce6ad020ce1252cae7f3fe96ba6bf0069f5e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215241
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Tobias Klauser
2020-01-20 15:18:20 +00:00
committed by Tobias Klauser
parent c1edf53553
commit 655fe14d74
+10
View File
@@ -50,4 +50,14 @@ func TestFdSet(t *testing.T) {
}
}
}
for fd := 1; fd < unix.FD_SETSIZE; fd += 2 {
fdSet.Clear(fd)
}
for fd := 0; fd < unix.FD_SETSIZE; fd++ {
if fdSet.IsSet(fd) {
t.Fatalf("Clear(%d) did not clear fd", fd)
}
}
}