mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-02 23:27:31 -04:00
unix: use same TestSelect on all Unices
Also change t.Error messages to use "got foo, expected bar" notation. Change-Id: Ia0b452f96b08cbb69a0b64cc2a467b5cf94e72da Reviewed-on: https://go-review.googlesource.com/c/sys/+/207858 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
e882bf8e40
commit
f068ffe820
@@ -123,26 +123,6 @@ func TestUtimesNanoAt(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSelect(t *testing.T) {
|
||||
_, err := unix.Select(0, nil, nil, nil, &unix.Timeval{Sec: 0, Usec: 0})
|
||||
if err != nil {
|
||||
t.Fatalf("Select: %v", err)
|
||||
}
|
||||
|
||||
dur := 150 * time.Millisecond
|
||||
tv := unix.NsecToTimeval(int64(dur))
|
||||
start := time.Now()
|
||||
_, err = unix.Select(0, nil, nil, nil, &tv)
|
||||
took := time.Since(start)
|
||||
if err != nil {
|
||||
t.Fatalf("Select: %v", err)
|
||||
}
|
||||
|
||||
if took < dur {
|
||||
t.Errorf("Select: timeout should have been at least %v, got %v", dur, took)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPselect(t *testing.T) {
|
||||
if runtime.GOARCH == "ppc64" {
|
||||
t.Skip("pselect issue with structure timespec on AIX 7.2 tl0, skipping test")
|
||||
|
||||
Reference in New Issue
Block a user