mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Threading through null ptr
This commit is contained in:
parent
8fc663b735
commit
93b77a840a
2 changed files with 8 additions and 12 deletions
|
@ -25,9 +25,6 @@ comptime {
|
|||
@export(testing_roc_realloc, .{ .name = "roc_realloc", .linkage = .Strong });
|
||||
@export(testing_roc_dealloc, .{ .name = "roc_dealloc", .linkage = .Strong });
|
||||
@export(testing_roc_panic, .{ .name = "roc_panic", .linkage = .Strong });
|
||||
@export(testing_roc_expect_failed, .{ .name = "roc_expect_failed", .linkage = .Strong });
|
||||
} else {
|
||||
@export(expect_failed, .{ .name = "roc_expect_failed", .linkage = .Strong });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,14 +45,9 @@ fn testing_roc_dealloc(c_ptr: *c_void, _: u32) callconv(.C) void {
|
|||
std.testing.allocator.destroy(ptr);
|
||||
}
|
||||
|
||||
fn testing_roc_expect_failed() callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("Expect failed inside test\n", .{}) catch unreachable;
|
||||
}
|
||||
|
||||
fn expect_failed() callconv(.C) void {
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("Expect failed outside test\n", .{}) catch unreachable;
|
||||
export fn roc_expect_failed(func_ptr: usize) callconv(.C) void {
|
||||
const func = @intToPtr(fn () void, func_ptr);
|
||||
func();
|
||||
}
|
||||
|
||||
fn testing_roc_panic(c_ptr: *c_void, tag_id: u32) callconv(.C) void {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue