From 4ad2c3733845abd9ee8892a323b0fa0d80f37e34 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Fri, 13 Jan 2023 13:53:17 +0000 Subject: [PATCH] Avoid integer literals that won't fit. (#2348) Motivation: While the "giant buffer" test doesn't run on 32-bit systems, it does need to compile. That means we can't set a pointer to a value that won't fit into an Int. Modifications: Smaller pointers! Result: The compile should work again. --- Tests/NIOCoreTests/ByteBufferTest.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/NIOCoreTests/ByteBufferTest.swift b/Tests/NIOCoreTests/ByteBufferTest.swift index 3305dc47..47597aa2 100644 --- a/Tests/NIOCoreTests/ByteBufferTest.swift +++ b/Tests/NIOCoreTests/ByteBufferTest.swift @@ -1756,9 +1756,9 @@ class ByteBufferTest: XCTestCase { // This allocator assumes that we'll never call realloc. let fakeAllocator = ByteBufferAllocator( - hookedMalloc: { _ in .init(bitPattern: 0xdeadbeef) }, + hookedMalloc: { _ in .init(bitPattern: 0xdedbeef) }, hookedRealloc: { _, _ in fatalError() }, - hookedFree: { precondition($0 == .init(bitPattern: 0xdeadbeef)!) }, + hookedFree: { precondition($0 == .init(bitPattern: 0xdedbeef)!) }, hookedMemcpy: {_, _, _ in } )