aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/net/fd_mutex_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-07-22 18:15:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-07-22 18:15:38 +0000
commit22b955cca564a9a3a5b8c9d9dd1e295b7943c128 (patch)
treeabdbd898676e1f853fca2d7e031d105d7ebcf676 /libgo/go/net/fd_mutex_test.go
parent9d04a3af4c6491536badf6bde9707c907e4d196b (diff)
downloadgcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.zip
gcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.tar.gz
gcc-22b955cca564a9a3a5b8c9d9dd1e295b7943c128.tar.bz2
libgo: update to go1.7rc3
Reviewed-on: https://go-review.googlesource.com/25150 From-SVN: r238662
Diffstat (limited to 'libgo/go/net/fd_mutex_test.go')
-rw-r--r--libgo/go/net/fd_mutex_test.go72
1 files changed, 36 insertions, 36 deletions
diff --git a/libgo/go/net/fd_mutex_test.go b/libgo/go/net/fd_mutex_test.go
index c34ec59..3542c70 100644
--- a/libgo/go/net/fd_mutex_test.go
+++ b/libgo/go/net/fd_mutex_test.go
@@ -14,44 +14,44 @@ import (
func TestMutexLock(t *testing.T) {
var mu fdMutex
- if !mu.Incref() {
+ if !mu.incref() {
t.Fatal("broken")
}
- if mu.Decref() {
+ if mu.decref() {
t.Fatal("broken")
}
- if !mu.RWLock(true) {
+ if !mu.rwlock(true) {
t.Fatal("broken")
}
- if mu.RWUnlock(true) {
+ if mu.rwunlock(true) {
t.Fatal("broken")
}
- if !mu.RWLock(false) {
+ if !mu.rwlock(false) {
t.Fatal("broken")
}
- if mu.RWUnlock(false) {
+ if mu.rwunlock(false) {
t.Fatal("broken")
}
}
func TestMutexClose(t *testing.T) {
var mu fdMutex
- if !mu.IncrefAndClose() {
+ if !mu.increfAndClose() {
t.Fatal("broken")
}
- if mu.Incref() {
+ if mu.incref() {
t.Fatal("broken")
}
- if mu.RWLock(true) {
+ if mu.rwlock(true) {
t.Fatal("broken")
}
- if mu.RWLock(false) {
+ if mu.rwlock(false) {
t.Fatal("broken")
}
- if mu.IncrefAndClose() {
+ if mu.increfAndClose() {
t.Fatal("broken")
}
}
@@ -59,10 +59,10 @@ func TestMutexClose(t *testing.T) {
func TestMutexCloseUnblock(t *testing.T) {
c := make(chan bool)
var mu fdMutex
- mu.RWLock(true)
+ mu.rwlock(true)
for i := 0; i < 4; i++ {
go func() {
- if mu.RWLock(true) {
+ if mu.rwlock(true) {
t.Error("broken")
return
}
@@ -76,7 +76,7 @@ func TestMutexCloseUnblock(t *testing.T) {
t.Fatal("broken")
default:
}
- mu.IncrefAndClose() // Must unblock the readers.
+ mu.increfAndClose() // Must unblock the readers.
for i := 0; i < 4; i++ {
select {
case <-c:
@@ -84,10 +84,10 @@ func TestMutexCloseUnblock(t *testing.T) {
t.Fatal("broken")
}
}
- if mu.Decref() {
+ if mu.decref() {
t.Fatal("broken")
}
- if !mu.RWUnlock(true) {
+ if !mu.rwunlock(true) {
t.Fatal("broken")
}
}
@@ -103,21 +103,21 @@ func TestMutexPanic(t *testing.T) {
}
var mu fdMutex
- ensurePanics(func() { mu.Decref() })
- ensurePanics(func() { mu.RWUnlock(true) })
- ensurePanics(func() { mu.RWUnlock(false) })
+ ensurePanics(func() { mu.decref() })
+ ensurePanics(func() { mu.rwunlock(true) })
+ ensurePanics(func() { mu.rwunlock(false) })
- ensurePanics(func() { mu.Incref(); mu.Decref(); mu.Decref() })
- ensurePanics(func() { mu.RWLock(true); mu.RWUnlock(true); mu.RWUnlock(true) })
- ensurePanics(func() { mu.RWLock(false); mu.RWUnlock(false); mu.RWUnlock(false) })
+ ensurePanics(func() { mu.incref(); mu.decref(); mu.decref() })
+ ensurePanics(func() { mu.rwlock(true); mu.rwunlock(true); mu.rwunlock(true) })
+ ensurePanics(func() { mu.rwlock(false); mu.rwunlock(false); mu.rwunlock(false) })
// ensure that it's still not broken
- mu.Incref()
- mu.Decref()
- mu.RWLock(true)
- mu.RWUnlock(true)
- mu.RWLock(false)
- mu.RWUnlock(false)
+ mu.incref()
+ mu.decref()
+ mu.rwlock(true)
+ mu.rwunlock(true)
+ mu.rwlock(false)
+ mu.rwunlock(false)
}
func TestMutexStress(t *testing.T) {
@@ -138,16 +138,16 @@ func TestMutexStress(t *testing.T) {
for i := 0; i < N; i++ {
switch r.Intn(3) {
case 0:
- if !mu.Incref() {
+ if !mu.incref() {
t.Error("broken")
return
}
- if mu.Decref() {
+ if mu.decref() {
t.Error("broken")
return
}
case 1:
- if !mu.RWLock(true) {
+ if !mu.rwlock(true) {
t.Error("broken")
return
}
@@ -158,12 +158,12 @@ func TestMutexStress(t *testing.T) {
}
readState[0]++
readState[1]++
- if mu.RWUnlock(true) {
+ if mu.rwunlock(true) {
t.Error("broken")
return
}
case 2:
- if !mu.RWLock(false) {
+ if !mu.rwlock(false) {
t.Error("broken")
return
}
@@ -174,7 +174,7 @@ func TestMutexStress(t *testing.T) {
}
writeState[0]++
writeState[1]++
- if mu.RWUnlock(false) {
+ if mu.rwunlock(false) {
t.Error("broken")
return
}
@@ -186,10 +186,10 @@ func TestMutexStress(t *testing.T) {
for p := 0; p < P; p++ {
<-done
}
- if !mu.IncrefAndClose() {
+ if !mu.increfAndClose() {
t.Fatal("broken")
}
- if !mu.Decref() {
+ if !mu.decref() {
t.Fatal("broken")
}
}