sync/atomic: add Swap to nil deref test

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12870043
This commit is contained in:
Dmitriy Vyukov 2013-08-13 21:18:33 +04:00
parent 66c58cea67
commit d3f36dbfc7
1 changed files with 6 additions and 0 deletions

View File

@ -1466,6 +1466,12 @@ func TestNilDeref(t *testing.T) {
func() { CompareAndSwapUint64(nil, 0, 0) },
func() { CompareAndSwapUintptr(nil, 0, 0) },
func() { CompareAndSwapPointer(nil, nil, nil) },
func() { SwapInt32(nil, 0) },
func() { SwapUint32(nil, 0) },
func() { SwapInt64(nil, 0) },
func() { SwapUint64(nil, 0) },
func() { SwapUintptr(nil, 0) },
func() { SwapPointer(nil, nil) },
func() { AddInt32(nil, 0) },
func() { AddUint32(nil, 0) },
func() { AddInt64(nil, 0) },