glfw: correct test order
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
888cd5ade6
commit
bad1b9f246
1 changed files with 74 additions and 74 deletions
|
|
@ -2563,7 +2563,7 @@ test "setDropCallback" {
|
||||||
}).callback) catch |err| std.debug.print("can't set window drop callback, not supported by OS maybe? error={}\n", .{err});
|
}).callback) catch |err| std.debug.print("can't set window drop callback, not supported by OS maybe? error={}\n", .{err});
|
||||||
}
|
}
|
||||||
|
|
||||||
test "setScrollCallback" {
|
test "setKeyCallback" {
|
||||||
const glfw = @import("main.zig");
|
const glfw = @import("main.zig");
|
||||||
try glfw.init();
|
try glfw.init();
|
||||||
defer glfw.terminate();
|
defer glfw.terminate();
|
||||||
|
|
@ -2576,75 +2576,11 @@ test "setScrollCallback" {
|
||||||
};
|
};
|
||||||
defer window.destroy();
|
defer window.destroy();
|
||||||
|
|
||||||
window.setScrollCallback((struct {
|
window.setKeyCallback((struct {
|
||||||
fn callback(_window: Window, xoffset: f64, yoffset: f64) void {
|
fn callback(_window: Window, key: isize, scancode: isize, action: isize, mods: isize) void {
|
||||||
_ = _window;
|
_ = _window;
|
||||||
_ = xoffset;
|
_ = key;
|
||||||
_ = yoffset;
|
_ = scancode;
|
||||||
}
|
|
||||||
}).callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
test "setCursorEnterCallback" {
|
|
||||||
const glfw = @import("main.zig");
|
|
||||||
try glfw.init();
|
|
||||||
defer glfw.terminate();
|
|
||||||
|
|
||||||
const window = glfw.Window.create(640, 480, "Hello, Zig!", null, null) catch |err| {
|
|
||||||
// return without fail, because most of our CI environments are headless / we cannot open
|
|
||||||
// windows on them.
|
|
||||||
std.debug.print("note: failed to create window: {}\n", .{err});
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
defer window.destroy();
|
|
||||||
|
|
||||||
window.setCursorEnterCallback((struct {
|
|
||||||
fn callback(_window: Window, entered: bool) void {
|
|
||||||
_ = _window;
|
|
||||||
_ = entered;
|
|
||||||
}
|
|
||||||
}).callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
test "setCursorPosCallback" {
|
|
||||||
const glfw = @import("main.zig");
|
|
||||||
try glfw.init();
|
|
||||||
defer glfw.terminate();
|
|
||||||
|
|
||||||
const window = glfw.Window.create(640, 480, "Hello, Zig!", null, null) catch |err| {
|
|
||||||
// return without fail, because most of our CI environments are headless / we cannot open
|
|
||||||
// windows on them.
|
|
||||||
std.debug.print("note: failed to create window: {}\n", .{err});
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
defer window.destroy();
|
|
||||||
|
|
||||||
window.setCursorPosCallback((struct {
|
|
||||||
fn callback(_window: Window, xpos: f64, ypos: f64) void {
|
|
||||||
_ = _window;
|
|
||||||
_ = xpos;
|
|
||||||
_ = ypos;
|
|
||||||
}
|
|
||||||
}).callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
test "setMouseButtonCallback" {
|
|
||||||
const glfw = @import("main.zig");
|
|
||||||
try glfw.init();
|
|
||||||
defer glfw.terminate();
|
|
||||||
|
|
||||||
const window = glfw.Window.create(640, 480, "Hello, Zig!", null, null) catch |err| {
|
|
||||||
// return without fail, because most of our CI environments are headless / we cannot open
|
|
||||||
// windows on them.
|
|
||||||
std.debug.print("note: failed to create window: {}\n", .{err});
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
defer window.destroy();
|
|
||||||
|
|
||||||
window.setMouseButtonCallback((struct {
|
|
||||||
fn callback(_window: Window, button: isize, action: isize, mods: isize) void {
|
|
||||||
_ = _window;
|
|
||||||
_ = button;
|
|
||||||
_ = action;
|
_ = action;
|
||||||
_ = mods;
|
_ = mods;
|
||||||
}
|
}
|
||||||
|
|
@ -2672,7 +2608,7 @@ test "setCharCallback" {
|
||||||
}).callback);
|
}).callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "setKeyCallback" {
|
test "setMouseButtonCallback" {
|
||||||
const glfw = @import("main.zig");
|
const glfw = @import("main.zig");
|
||||||
try glfw.init();
|
try glfw.init();
|
||||||
defer glfw.terminate();
|
defer glfw.terminate();
|
||||||
|
|
@ -2685,13 +2621,77 @@ test "setKeyCallback" {
|
||||||
};
|
};
|
||||||
defer window.destroy();
|
defer window.destroy();
|
||||||
|
|
||||||
window.setKeyCallback((struct {
|
window.setMouseButtonCallback((struct {
|
||||||
fn callback(_window: Window, key: isize, scancode: isize, action: isize, mods: isize) void {
|
fn callback(_window: Window, button: isize, action: isize, mods: isize) void {
|
||||||
_ = _window;
|
_ = _window;
|
||||||
_ = key;
|
_ = button;
|
||||||
_ = scancode;
|
|
||||||
_ = action;
|
_ = action;
|
||||||
_ = mods;
|
_ = mods;
|
||||||
}
|
}
|
||||||
}).callback);
|
}).callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "setCursorPosCallback" {
|
||||||
|
const glfw = @import("main.zig");
|
||||||
|
try glfw.init();
|
||||||
|
defer glfw.terminate();
|
||||||
|
|
||||||
|
const window = glfw.Window.create(640, 480, "Hello, Zig!", null, null) catch |err| {
|
||||||
|
// return without fail, because most of our CI environments are headless / we cannot open
|
||||||
|
// windows on them.
|
||||||
|
std.debug.print("note: failed to create window: {}\n", .{err});
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
defer window.destroy();
|
||||||
|
|
||||||
|
window.setCursorPosCallback((struct {
|
||||||
|
fn callback(_window: Window, xpos: f64, ypos: f64) void {
|
||||||
|
_ = _window;
|
||||||
|
_ = xpos;
|
||||||
|
_ = ypos;
|
||||||
|
}
|
||||||
|
}).callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
test "setCursorEnterCallback" {
|
||||||
|
const glfw = @import("main.zig");
|
||||||
|
try glfw.init();
|
||||||
|
defer glfw.terminate();
|
||||||
|
|
||||||
|
const window = glfw.Window.create(640, 480, "Hello, Zig!", null, null) catch |err| {
|
||||||
|
// return without fail, because most of our CI environments are headless / we cannot open
|
||||||
|
// windows on them.
|
||||||
|
std.debug.print("note: failed to create window: {}\n", .{err});
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
defer window.destroy();
|
||||||
|
|
||||||
|
window.setCursorEnterCallback((struct {
|
||||||
|
fn callback(_window: Window, entered: bool) void {
|
||||||
|
_ = _window;
|
||||||
|
_ = entered;
|
||||||
|
}
|
||||||
|
}).callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
test "setScrollCallback" {
|
||||||
|
const glfw = @import("main.zig");
|
||||||
|
try glfw.init();
|
||||||
|
defer glfw.terminate();
|
||||||
|
|
||||||
|
const window = glfw.Window.create(640, 480, "Hello, Zig!", null, null) catch |err| {
|
||||||
|
// return without fail, because most of our CI environments are headless / we cannot open
|
||||||
|
// windows on them.
|
||||||
|
std.debug.print("note: failed to create window: {}\n", .{err});
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
defer window.destroy();
|
||||||
|
|
||||||
|
window.setScrollCallback((struct {
|
||||||
|
fn callback(_window: Window, xoffset: f64, yoffset: f64) void {
|
||||||
|
_ = _window;
|
||||||
|
_ = xoffset;
|
||||||
|
_ = yoffset;
|
||||||
|
}
|
||||||
|
}).callback);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue