         var data = a.withUnsafeBufferPointer {
             return Data(buffer: $0)
         }
-        let expectedSize = strideof(UInt8.self) * a.count
+        let expectedSize = MemoryLayout<UInt8>.stride * a.count
         expectEqual(expectedSize, data.count)
         
         let underlyingBuffer = unsafeBitCast(malloc(expectedSize - 1)!, to: UnsafeMutablePointer<UInt8>.self)

        var data = a.withUnsafeBufferPointer {
            return Data(buffer: $0)
        }
        let expectedSize = strideof(Int32.self) * a.count
        expectEqual(expectedSize, data.count)
        
        let underlyingBuffer = unsafeBitCast(malloc(expectedSize + 1)!, to: UnsafeMutablePointer<UInt8>.self)

    
    func testCopyBytes() {
        let c = 10
        let underlyingBuffer = malloc(c * MemoryLayout<UInt16>.stride)!
        let u16Ptr = underlyingBuffer.bindMemory(to: UInt16.self, capacity: c)
        let buffer = UnsafeMutableBufferPointer<UInt16>(start: u16Ptr, count: c)
        
        buffer[0] = 0
        buffer[1] = 0
        
        var data = Data(capacity: c * MemoryLayout<UInt16>.stride)
        data.resetBytes(in: 0..<c * MemoryLayout<UInt16>.stride)
        data[0] = 0xFF
        data[1] = 0xFF
        let copiedCount = data.copyBytes(to: buffer)
        expectEqual(copiedCount, c * MemoryLayout<UInt16>.stride)
        
        expectEqual(buffer[0], 0xFFFF)
        free(underlyingBuffer)
