Skip to content

Commit

Permalink
tests: achive 100% coverage for go/atomic2
Browse files Browse the repository at this point in the history
Signed-off-by: Manik Rana <[email protected]>
  • Loading branch information
Maniktherana committed Jan 17, 2024
1 parent c1f9c80 commit c648c7e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions go/atomic2/atomic128_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ import (
)

func TestCompareAndSwap(t *testing.T) {
runCompareAndSwap(t)
}

func TestCompareAndSwapWriteBarrier(t *testing.T) {
writeBarrier.enabled = true
require.True(t, writeBarrier.enabled, "writeBarrier should be enabled")

runCompareAndSwap(t)
}

func runCompareAndSwap(t *testing.T) {
i1 := new(int)
i2 := new(int)
n := &PointerAndUint64[int]{p: unsafe.Pointer(i1), u: 12345}
Expand Down

0 comments on commit c648c7e

Please sign in to comment.