Make tests work on 32-bit (#486)

* 32-bit fix for tests: Replace 0xDEADBEEF w/ 0x1337BEEF

Motivation:

Make tests compile on Raspberry Pi.

Modifications:

- Change tests so that they compile on 32-bit machines,
like Raspi. Replaced 0xDEADBEEF which doesn't fit into
an Int32, w/ 0x1337BEEF.
- make ByteBuffer work better on 32-bit
- fix other wrong assertions and limits that are too big on 32bit

Also use TimeAmount.Value in one test.

Result:

Tests will compile on Raspi ...
This commit is contained in:
Helge Heß authored and Johannes Weiss committed 2018-08-16 18:05:11 +01:00
1 parent 0ce3cf5b79
commit e8c04e0eca
9 files changed
+83 -35

No files matched your search

@@ -16,7 +16,14 @@ import NIO
private let maxOneByteSize = 125
private let maxTwoByteSize = Int(UInt16.max)
private let maxNIOFrameSize = Int(UInt32.max)
#if arch(arm) // 32-bit, Raspi/AppleWatch/etc
// Note(hh): This is not a _proper_ fix, but necessary because
// other places extend on that. Should be fine in
// practice on 32-bit platforms.
private let maxNIOFrameSize = Int(Int32.max / 4)
#else
private let maxNIOFrameSize = Int(UInt32.max)
#endif
/// An inbound `ChannelHandler` that serializes structured websocket frames into a byte stream
/// for sending on the network.