summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-01-03 10:04:38 +0100
committerThomas Haller <thaller@redhat.com>2020-01-28 10:54:14 +0100
commit8dc760d2c2edeeed550de3289d4519ff27e13cfa (patch)
tree7bdaf6bfc5b381c4f4b2a7db608205434ae669ce
parent18512274ea7b253452eb38a6df214b1473aceac9 (diff)
downloadNetworkManager-8dc760d2c2edeeed550de3289d4519ff27e13cfa.tar.gz
libnm/secret-agent/tests: test async/sync initialization of NMSecretAgentOld
Use nmtstc_context_object_new() to create the NMSecretAgentOld. This randomly uses sync or async initialization, and checks whether the main context gets iterated.
-rw-r--r--libnm/tests/test-secret-agent.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/libnm/tests/test-secret-agent.c b/libnm/tests/test-secret-agent.c
index 317098c853..a6d745932f 100644
--- a/libnm/tests/test-secret-agent.c
+++ b/libnm/tests/test-secret-agent.c
@@ -124,17 +124,11 @@ test_secret_agent_init (TestSecretAgent *agent)
static NMSecretAgentOld *
test_secret_agent_new (void)
{
- NMSecretAgentOld *agent;
- GError *error = NULL;
-
- agent = g_initable_new (test_secret_agent_get_type (),
- NULL,
- &error,
- NM_SECRET_AGENT_OLD_IDENTIFIER, "test-secret-agent",
- NM_SECRET_AGENT_OLD_AUTO_REGISTER, FALSE,
- NULL);
- nmtst_assert_success (agent, error);
- return agent;
+ return nmtstc_context_object_new (test_secret_agent_get_type (),
+ TRUE,
+ NM_SECRET_AGENT_OLD_IDENTIFIER, "test-secret-agent",
+ NM_SECRET_AGENT_OLD_AUTO_REGISTER, FALSE,
+ NULL);
}
static void