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" {
132132}
133133
134134test "compare equality of optional and non-optional pointer" {
135 const a = @intToPtr(*const usize, 0x123456789);
136 const b = @intToPtr(?*usize, 0x123456789);
135 const a = @intToPtr(*const usize, 0x12345678);
136 const b = @intToPtr(?*usize, 0x12345678);
137137 expect(a == b);
138138 expect(b == a);
139139}
test/stage1/behavior/struct.zig+8-4
......@@ -2,7 +2,7 @@ const std = @import("std");
22const expect = std.testing.expect;
33const expectEqualSlices = std.testing.expectEqualSlices;
44const builtin = @import("builtin");
5const maxInt = std.math.maxInt;
5const maxInt = std.math.maxInt;
66const StructWithNoFields = struct {
77 fn add(a: i32, b: i32) i32 {
88 return a + b;
......@@ -256,7 +256,11 @@ const Foo96Bits = packed struct {
256256test "packed struct 24bits" {
257257 comptime {
258258 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 }
260264 }
261265
262266 var value = Foo96Bits{
......@@ -505,10 +509,10 @@ test "packed struct with u0 field access" {
505509 comptime expect(s.f0 == 0);
506510}
507511
508const S0 = struct{
512const S0 = struct {
509513 bar: S1,
510514
511 pub const S1 = struct{
515 pub const S1 = struct {
512516 value: u8,
513517 };
514518