mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
std: re-enable a bunch of tests that now pass
closes https://github.com/ziglang/zig/issues/21893 closes https://github.com/ziglang/zig/issues/23806 closes https://github.com/ziglang/zig/issues/23807 closes https://github.com/ziglang/zig/issues/24191 closes https://codeberg.org/ziglang/zig/issues/30220
This commit is contained in:
@@ -137,7 +137,6 @@ test "File.setLength" {
|
||||
test "legacy setLength" {
|
||||
// https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission)
|
||||
if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest;
|
||||
if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23806
|
||||
|
||||
const io = testing.io;
|
||||
|
||||
|
||||
@@ -780,8 +780,6 @@ fn testExpect(comptime H: type, seed: anytype, input: []const u8, expected: u64)
|
||||
}
|
||||
|
||||
test "xxhash3" {
|
||||
if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
|
||||
|
||||
const H = XxHash3;
|
||||
// Non-Seeded Tests
|
||||
try testExpect(H, 0, "", 0x2d06800538d394c2);
|
||||
@@ -813,8 +811,6 @@ test "xxhash3" {
|
||||
}
|
||||
|
||||
test "xxhash3 smhasher" {
|
||||
if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
|
||||
|
||||
const Test = struct {
|
||||
fn do() !void {
|
||||
try expectEqual(verify.smhasher(XxHash3.hash), 0x9a636405);
|
||||
@@ -826,8 +822,6 @@ test "xxhash3 smhasher" {
|
||||
}
|
||||
|
||||
test "xxhash3 iterative api" {
|
||||
if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
|
||||
|
||||
const Test = struct {
|
||||
fn do() !void {
|
||||
try verify.iterativeApi(XxHash3);
|
||||
|
||||
@@ -484,7 +484,7 @@ fn toFloat(comptime Float: type) !void {
|
||||
);
|
||||
}
|
||||
test toFloat {
|
||||
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24191
|
||||
if (builtin.cpu.arch == .x86) return error.SkipZigTest;
|
||||
try toFloat(f16);
|
||||
try toFloat(f32);
|
||||
try toFloat(f64);
|
||||
@@ -2801,8 +2801,6 @@ test "bitNotWrap more than two limbs" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
// LLVM: unexpected runtime library name: __umodei4
|
||||
if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch.isWasm()) return error.SkipZigTest; // TODO
|
||||
|
||||
var a = try Managed.initSet(testing.allocator, maxInt(Limb));
|
||||
defer a.deinit();
|
||||
|
||||
@@ -139,8 +139,6 @@ test log10_int {
|
||||
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch.isWasm()) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch == .hexagon) return error.SkipZigTest;
|
||||
|
||||
inline for (
|
||||
.{ u8, u16, u32, u64, u128, u256, u512 },
|
||||
|
||||
@@ -10,8 +10,6 @@ const expectEqual = std.testing.expectEqual;
|
||||
const fs = std.fs;
|
||||
|
||||
test "fallocate" {
|
||||
if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/30220
|
||||
|
||||
const io = std.testing.io;
|
||||
|
||||
var tmp = std.testing.tmpDir(.{});
|
||||
|
||||
@@ -157,13 +157,6 @@ pub fn join(a: anytype, b: anytype) @Vector(vectorLength(@TypeOf(a)) + vectorLen
|
||||
/// Returns a vector whose elements alternates between those of each input vector.
|
||||
/// For example, `interlace(.{[4]u32{11, 12, 13, 14}, [4]u32{21, 22, 23, 24}})` returns a vector containing `.{11, 21, 12, 22, 13, 23, 14, 24}`.
|
||||
pub fn interlace(vecs: anytype) @Vector(vectorLength(@TypeOf(vecs[0])) * vecs.len, std.meta.Child(@TypeOf(vecs[0]))) {
|
||||
// interlace doesn't work on MIPS, for some reason.
|
||||
// Notes from earlier debug attempt:
|
||||
// The indices are correct. The problem seems to be with the @shuffle builtin.
|
||||
// On MIPS, the test that interlaces small_base gives { 0, 2, 0, 0, 64, 255, 248, 200, 0, 0 }.
|
||||
// Calling this with two inputs seems to work fine, but I'll let the compile error trigger for all inputs, just to be safe.
|
||||
if (builtin.cpu.arch.isMIPS()) @compileError("TODO: Find out why interlace() doesn't work on MIPS");
|
||||
|
||||
const VecType = @TypeOf(vecs[0]);
|
||||
const vecs_arr = @as([vecs.len]VecType, vecs);
|
||||
const Child = std.meta.Child(@TypeOf(vecs_arr[0]));
|
||||
@@ -247,13 +240,11 @@ test "vector patterns" {
|
||||
try std.testing.expectEqual([8]u32{ 10, 20, 30, 40, 55, 66, 77, 88 }, join(base, other_base));
|
||||
try std.testing.expectEqual([2]u32{ 20, 30 }, extract(base, 1, 2));
|
||||
|
||||
if (!builtin.cpu.arch.isMIPS()) {
|
||||
try std.testing.expectEqual([8]u32{ 10, 55, 20, 66, 30, 77, 40, 88 }, interlace(.{ base, other_base }));
|
||||
|
||||
const small_braid = interlace(small_bases);
|
||||
try std.testing.expectEqual([10]u8{ 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }, small_braid);
|
||||
try std.testing.expectEqual(small_bases, deinterlace(small_bases.len, small_braid));
|
||||
}
|
||||
}
|
||||
|
||||
/// Joins two vectors, shifts them leftwards (towards lower indices) and extracts the leftmost elements into a vector the length of a and b.
|
||||
@@ -384,9 +375,6 @@ pub fn prefixScanWithFunc(
|
||||
/// For example, this should be 0 for addition or 1 for multiplication.
|
||||
comptime identity: std.meta.Child(@TypeOf(vec)),
|
||||
) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec) {
|
||||
// I haven't debugged this, but it might be a cousin of sorts to what's going on with interlace.
|
||||
if (builtin.cpu.arch.isMIPS()) @compileError("TODO: Find out why prefixScan doesn't work on MIPS");
|
||||
|
||||
const len = vectorLength(@TypeOf(vec));
|
||||
|
||||
if (hop == 0) @compileError("hop can not be 0; you'd be going nowhere forever!");
|
||||
@@ -456,11 +444,6 @@ pub fn prefixScan(comptime op: std.builtin.ReduceOp, comptime hop: isize, vec: a
|
||||
}
|
||||
|
||||
test "vector prefix scan" {
|
||||
if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21893
|
||||
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
|
||||
|
||||
if (builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
|
||||
|
||||
const int_base = @Vector(4, i32){ 11, 23, 9, -21 };
|
||||
const float_base = @Vector(4, f32){ 2, 0.5, -10, 6.54321 };
|
||||
const bool_base = @Vector(4, bool){ true, false, true, false };
|
||||
|
||||
Reference in New Issue
Block a user