aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-09-17 22:05:40 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitdcd26bcfcc691f24508a7b6bf04c15042a4668ea (patch)
treef47df3dc79a5ac0b89507890d25843e9c724161b /tests
parentb095aedd386e076d1f5a56b7384b836e653387d1 (diff)
Fix function call resolved type
Diffstat (limited to 'tests')
-rw-r--r--tests/glfw.amal6
-rw-r--r--tests/main.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/glfw.amal b/tests/glfw.amal
index b888dac..d0f02d4 100644
--- a/tests/glfw.amal
+++ b/tests/glfw.amal
@@ -1,10 +1,14 @@
extern const glfwInit: fn() i32;
extern const glfwTerminate: fn() i32; // should return void....
extern const glfwCreateWindow: fn(x: i32, y: i32, title: str, monitor: usize, share: usize) usize;
+extern const glfwWindowShouldClose: fn(window: usize) i64;
const main = fn {
glfwInit();
- glfwCreateWindow(50, 50, "hello, world", 0, 0);
+ const window = glfwCreateWindow(50, 50, "hello, world", 0, 0);
+ while glfwWindowShouldClose(window) == 0 {
+
+ }
glfwTerminate();
//const a = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1;
} \ No newline at end of file
diff --git a/tests/main.c b/tests/main.c
index 1a86769..265a0ea 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -204,7 +204,7 @@ static void test_load_gl(void) {
fprintf(stderr, "Unexpected error (alloc failure)\n");
FAIL_TEST_CLEANUP(full_path);
}
- if(amal_program_register_extern_func(&program, create_buffer_view_auto("print_extern_num"), print_extern_num, sizeof(i64)) != 0) {
+ if(amal_program_register_extern_func(&program, create_buffer_view_auto("glfwWindowShouldClose"), glfwWindowShouldClose, sizeof(void*)) != 0) {
fprintf(stderr, "Unexpected error (alloc failure)\n");
FAIL_TEST_CLEANUP(full_path);
}