fix tests failing on stage2 release modes due to setRuntimeSafety not being recognized
This commit is contained in:
@@ -251,6 +251,9 @@ test "*const ?[*]const T to [*c]const [*c]const T" {
|
||||
test "array coersion to undefined at runtime" {
|
||||
@setRuntimeSafety(true);
|
||||
|
||||
// setRuntimeSafety isn't recognized on stage2
|
||||
if (@import("builtin").zig_is_stage2 and (@import("builtin").mode != .Debug or @import("builtin").mode != .ReleaseSafe)) return error.SkipZigTest;
|
||||
|
||||
var array = [4]u8{ 3, 4, 5, 6 };
|
||||
var undefined_val = [4]u8{ 0xAA, 0xAA, 0xAA, 0xAA };
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ test "uint128" {
|
||||
test "undefined 128 bit int" {
|
||||
@setRuntimeSafety(true);
|
||||
|
||||
// setRuntimeSafety isn't recognized on stage2
|
||||
if (@import("builtin").zig_is_stage2 and (@import("builtin").mode != .Debug or @import("builtin").mode != .ReleaseSafe)) return error.SkipZigTest;
|
||||
|
||||
var undef: u128 = undefined;
|
||||
var undef_signed: i128 = undefined;
|
||||
try expect(undef == 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and @bitCast(u128, undef_signed) == undef);
|
||||
|
||||
Reference in New Issue
Block a user