Skip to content
Snippets Groups Projects
Commit bb82b083 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

tests: config-policy: make sure the link is activated before stopping

parent e1686eb1
No related branches found
No related tags found
No related merge requests found
......@@ -214,12 +214,31 @@ config_policy_teardown (TestFixture *f, gconstpointer user_data)
wp_base_test_fixture_teardown (&f->base);
}
static void
on_state_changed (WpEndpointLink *ep_link, WpEndpointLinkState old_state,
WpEndpointLinkState new_state, const gchar *error, TestFixture *f)
{
switch (new_state) {
case WP_ENDPOINT_LINK_STATE_ACTIVE:
break;
case WP_ENDPOINT_LINK_STATE_ERROR:
wp_message_object ("link failed: %s", error);
g_test_fail ();
case WP_ENDPOINT_LINK_STATE_INACTIVE:
case WP_ENDPOINT_LINK_STATE_PREPARING:
default:
return;
}
g_main_loop_quit (f->base.loop);
}
static void
on_link_activated (WpPlugin *ctx, WpEndpointLink *ep_link,
TestFixture *f)
{
g_assert_nonnull (ep_link);
g_main_loop_quit (f->base.loop);
g_signal_connect (ep_link, "state-changed", (GCallback) on_state_changed, f);
}
static void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment