From 99a10c160658c46dce7e827f656dfbfc9fb54b90 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 4 Aug 2021 15:28:33 +1000 Subject: [PATCH] protocol: assert if the loop initialization fails on the connection test This test needs an environment set up to load everything correctly, running it directly results in a segfault. Let's make sure we assert on a NULL loop to make this look slightly more planned. --- src/modules/module-protocol-native/test-connection.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/module-protocol-native/test-connection.c b/src/modules/module-protocol-native/test-connection.c index 666f0c942..09ad6ed19 100644 --- a/src/modules/module-protocol-native/test-connection.c +++ b/src/modules/module-protocol-native/test-connection.c @@ -191,6 +191,7 @@ int main(int argc, char *argv[]) pw_init(&argc, &argv); loop = pw_main_loop_new(NULL); + spa_assert_se(loop != NULL); context = pw_context_new(pw_main_loop_get_loop(loop), NULL, 0); if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {