mirror of
https://github.com/ziglang/zig.git
synced 2026-02-16 14:28:57 +00:00
Fix some test cases to run on 32bit systems
This commit is contained in:
parent
51aaa02679
commit
6957927194
@ -132,8 +132,8 @@ test "initialize const optional C pointer to null" {
|
||||
}
|
||||
|
||||
test "compare equality of optional and non-optional pointer" {
|
||||
const a = @intToPtr(*const usize, 0x123456789);
|
||||
const b = @intToPtr(?*usize, 0x123456789);
|
||||
const a = @intToPtr(*const usize, 0x12345678);
|
||||
const b = @intToPtr(?*usize, 0x12345678);
|
||||
expect(a == b);
|
||||
expect(b == a);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ const std = @import("std");
|
||||
const expect = std.testing.expect;
|
||||
const expectEqualSlices = std.testing.expectEqualSlices;
|
||||
const builtin = @import("builtin");
|
||||
const maxInt = std.math.maxInt;
|
||||
const maxInt = std.math.maxInt;
|
||||
const StructWithNoFields = struct {
|
||||
fn add(a: i32, b: i32) i32 {
|
||||
return a + b;
|
||||
@ -256,7 +256,11 @@ const Foo96Bits = packed struct {
|
||||
test "packed struct 24bits" {
|
||||
comptime {
|
||||
expect(@sizeOf(Foo24Bits) == 4);
|
||||
expect(@sizeOf(Foo96Bits) == 16);
|
||||
if (@sizeOf(usize) == 4) {
|
||||
expect(@sizeOf(Foo96Bits) == 12);
|
||||
} else {
|
||||
expect(@sizeOf(Foo96Bits) == 16);
|
||||
}
|
||||
}
|
||||
|
||||
var value = Foo96Bits{
|
||||
@ -505,10 +509,10 @@ test "packed struct with u0 field access" {
|
||||
comptime expect(s.f0 == 0);
|
||||
}
|
||||
|
||||
const S0 = struct{
|
||||
const S0 = struct {
|
||||
bar: S1,
|
||||
|
||||
pub const S1 = struct{
|
||||
pub const S1 = struct {
|
||||
value: u8,
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user