diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/glfw.amal | 6 | ||||
-rw-r--r-- | tests/main.c | 2 |
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); } |