aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/sokol_gfx_test.c
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2022-11-21 19:44:48 +0100
committerAndre Weissflog <floooh@gmail.com>2022-11-21 19:44:48 +0100
commit9611b05061b98684c5457444e9eb3d646622c57e (patch)
tree046b2734e1f68c9306e7605b177ba4cf1450afc2 /tests/functional/sokol_gfx_test.c
parent67b554b903f77b27c6da8289477a8a127e86324f (diff)
sokol_gfx.h: wip clean up resource creation/destruction
Diffstat (limited to 'tests/functional/sokol_gfx_test.c')
-rw-r--r--tests/functional/sokol_gfx_test.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/functional/sokol_gfx_test.c b/tests/functional/sokol_gfx_test.c
index 43266545..87d3fbac 100644
--- a/tests/functional/sokol_gfx_test.c
+++ b/tests/functional/sokol_gfx_test.c
@@ -11,6 +11,12 @@
#define T(b) EXPECT_TRUE(b)
+static int num_log_called = 0;
+static void test_logger(const char* msg, void* userdata) {
+ (void)msg; (void)userdata;
+ num_log_called++;
+}
+
UTEST(sokol_gfx, init_shutdown) {
sg_setup(&(sg_desc){0});
T(sg_isvalid());
@@ -1023,3 +1029,14 @@ UTEST(sokol_gfx, commit_listener_array_full) {
T(commit_listener.userdata == 128);
sg_shutdown();
}
+
+UTEST(sokol_gfx, alloc_destroy) {
+ num_log_called = 0;
+ sg_setup(&(sg_desc){
+ .logger = { .log_cb = test_logger }
+ });
+ sg_buffer vbuf = sg_alloc_buffer();
+ sg_destroy_buffer(vbuf);
+ T(0 == num_log_called);
+ sg_shutdown();
+}