authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-18 10:59:56+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-18 10:59:56+02:00
log695792719450facba99adf2b6711392657975268
tree4c0470583ced5e4bc41339ba953c9cd1af0e861d
parent51aaa02679002ba65b270414bf94860fdcbe7c59

Fix some test cases to run on 32bit systems


2 files changed, 10 insertions(+), 6 deletions(-)

test/stage1/behavior/pointers.zig+2-2
...@@ -132,8 +132,8 @@ test "initialize const optional C pointer to null" {...@@ -132,8 +132,8 @@ test "initialize const optional C pointer to null" {
132}132}
133133
134test "compare equality of optional and non-optional pointer" {134test "compare equality of optional and non-optional pointer" {
135 const a = @intToPtr(*const usize, 0x123456789);135 const a = @intToPtr(*const usize, 0x12345678);
136 const b = @intToPtr(?*usize, 0x123456789);136 const b = @intToPtr(?*usize, 0x12345678);
137 expect(a == b);137 expect(a == b);
138 expect(b == a);138 expect(b == a);
139}139}
test/stage1/behavior/struct.zig+8-4
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const expect = std.testing.expect;2const expect = std.testing.expect;
3const expectEqualSlices = std.testing.expectEqualSlices;3const expectEqualSlices = std.testing.expectEqualSlices;
4const builtin = @import("builtin");4const builtin = @import("builtin");
5const maxInt = std.math.maxInt; 5const maxInt = std.math.maxInt;
6const StructWithNoFields = struct {6const StructWithNoFields = struct {
7 fn add(a: i32, b: i32) i32 {7 fn add(a: i32, b: i32) i32 {
8 return a + b;8 return a + b;
...@@ -256,7 +256,11 @@ const Foo96Bits = packed struct {...@@ -256,7 +256,11 @@ const Foo96Bits = packed struct {
256test "packed struct 24bits" {256test "packed struct 24bits" {
257 comptime {257 comptime {
258 expect(@sizeOf(Foo24Bits) == 4);258 expect(@sizeOf(Foo24Bits) == 4);
259 expect(@sizeOf(Foo96Bits) == 16);259 if (@sizeOf(usize) == 4) {
260 expect(@sizeOf(Foo96Bits) == 12);
261 } else {
262 expect(@sizeOf(Foo96Bits) == 16);
263 }
260 }264 }
261265
262 var value = Foo96Bits{266 var value = Foo96Bits{
...@@ -505,10 +509,10 @@ test "packed struct with u0 field access" {...@@ -505,10 +509,10 @@ test "packed struct with u0 field access" {
505 comptime expect(s.f0 == 0);509 comptime expect(s.f0 == 0);
506}510}
507511
508const S0 = struct{512const S0 = struct {
509 bar: S1,513 bar: S1,
510514
511 pub const S1 = struct{515 pub const S1 = struct {
512 value: u8,516 value: u8,
513 };517 };
514518