From 655fe14d7479994387fe12003042545d0c2859a5 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 20 Jan 2020 13:36:15 +0100 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- unix/fdset_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/unix/fdset_test.go b/unix/fdset_test.go index e092785c..d0c2d8a7 100644 --- a/unix/fdset_test.go +++ b/unix/fdset_test.go @@ -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) + } + } }