From 16a76c5785aa7349bf3f9ef48cee56236196f495 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 12 Mar 2020 05:05:46 +1100 Subject: Make test-simple clean up and exit after 15 seconds --- tests/examples/test.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/examples/test.c b/tests/examples/test.c index 10da180..d2faa80 100644 --- a/tests/examples/test.c +++ b/tests/examples/test.c @@ -35,7 +35,7 @@ _mapped_external_port (GUPnPSimpleIgd *igd, gchar *proto, proto, external_ip, replaces_external_ip, external_port, local_ip, local_port, description); - src = g_timeout_source_new_seconds (30); + src = g_timeout_source_new_seconds (10); g_source_set_callback (src, _remove_port, user_data, NULL); g_source_attach (src, ctx); } @@ -86,9 +86,16 @@ main (int argc, char **argv) gupnp_simple_igd_add_port (igd, "TCP", external_port, argv[2], internal_port, 20, argv[4]); + GSource *src = g_timeout_source_new_seconds (15); + g_source_set_callback (src, (GSourceFunc) g_main_loop_quit, loop, NULL); + g_source_attach (src, ctx); + g_main_loop_run (loop); g_object_unref (igd); + + g_main_context_pop_thread_default (ctx); + g_main_loop_unref (loop); g_main_context_unref (ctx); -- cgit v1.2.1