From 45b9a1cf1d1969b0ac79a6ac3f814fdd0bf1ad76 Mon Sep 17 00:00:00 2001 From: David Li Date: Tue, 18 Feb 2025 01:47:26 -0500 Subject: [PATCH] format --- arrow/memory/buffer_test.go | 2 +- arrow/memory/mallocator/mallocator_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arrow/memory/buffer_test.go b/arrow/memory/buffer_test.go index f95e74ea..c971a980 100644 --- a/arrow/memory/buffer_test.go +++ b/arrow/memory/buffer_test.go @@ -36,7 +36,7 @@ func TestNewResizableBuffer(t *testing.T) { assert.NotNil(t, buf.Bytes()) assert.Equal(t, exp, len(buf.Bytes())) assert.Equal(t, exp, buf.Len()) - assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf.Buf()[0])) % 64) + assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf.Buf()[0]))%64) buf.Release() // refCount == 1 assert.NotNil(t, buf.Bytes()) diff --git a/arrow/memory/mallocator/mallocator_test.go b/arrow/memory/mallocator/mallocator_test.go index 647b7535..77864c3a 100644 --- a/arrow/memory/mallocator/mallocator_test.go +++ b/arrow/memory/mallocator/mallocator_test.go @@ -140,10 +140,10 @@ func TestMallocatorAligned(t *testing.T) { assert.GreaterOrEqual(t, int64(128), a.AllocatedBytes()) - assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf[0])) % 64) + assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf[0]))%64) buf, alloc = aligned.ReallocateAligned(96, buf, alloc) - assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf[0])) % 64) + assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf[0]))%64) aligned.Free(alloc) assert.Equal(t, int64(0), a.AllocatedBytes()) @@ -160,7 +160,7 @@ func TestMallocatorAlignedBuffer(t *testing.T) { // 20 -> round up to 64 -> add 64 bytes padding assert.GreaterOrEqual(t, int64(128), a.AllocatedBytes()) addr := uintptr(unsafe.Pointer(&buf.Buf()[0])) - assert.Equal(t, uintptr(0), addr % 64) + assert.Equal(t, uintptr(0), addr%64) buf.Reserve(40) // There should have been no reallocation @@ -170,5 +170,5 @@ func TestMallocatorAlignedBuffer(t *testing.T) { // Now the buffer is reallocated, make sure the new address is also aligned assert.NotEqual(t, addr, uintptr(unsafe.Pointer(&buf.Buf()[0]))) addr = uintptr(unsafe.Pointer(&buf.Buf()[0])) - assert.Equal(t, uintptr(0), addr % 64) + assert.Equal(t, uintptr(0), addr%64) }