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 ...

Motivation:

Explain here the context, and why you're making that change.
What is the problem you're trying to solve.

Modifications:

Describe the modifications you've done.

Result:

After your change, what will change.
This commit is contained in:
Helge Heß authored and Johannes Weiss committed 2018-08-29 15:39:49 +01:00
1 parent be97c8e5bc
commit f1f3a64155
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.