Lines Matching refs:ctx

63     struct test_ctx *ctx;
67 ctx = talloc_zero(global_talloc_context, struct test_ctx);
68 fail_if(ctx == NULL, "Could not allocate memory for test context");
70 ctx->ev = tevent_context_init(ctx);
71 if (ctx->ev == NULL) {
72 talloc_free(ctx);
76 ret = resolv_init(ctx, ctx->ev, 5, &ctx->resolv);
78 talloc_free(ctx);
86 ctx->fo_ctx = fo_context_init(ctx, &fopts);
87 if (ctx->fo_ctx == NULL) {
88 talloc_free(ctx);
92 return ctx;
106 struct test_ctx *ctx;
110 ctx = setup_test();
111 ck_leaks_push(ctx);
117 ck_leaks_push(ctx);
118 ret = fo_new_service(ctx->fo_ctx, buf, NULL, &services[i]);
122 ret = fo_new_service(ctx->fo_ctx, "service_3", NULL, &service);
129 ret = fo_get_service(ctx->fo_ctx, buf, &service);
133 ck_leaks_pop(ctx);
135 ret = fo_get_service(ctx->fo_ctx, buf, &service);
139 ck_leaks_pop(ctx);
140 talloc_free(ctx);
229 struct test_ctx *ctx;
232 ctx = setup_test();
233 fail_if(ctx == NULL);
236 fail_if(fo_new_service(ctx->fo_ctx, "http", NULL, &service[0]) != EOK);
238 fail_if(fo_new_service(ctx->fo_ctx, "ldap", NULL, &service[1]) != EOK);
240 fail_if(fo_new_service(ctx->fo_ctx, "ntp", NULL, &service[2]) != EOK);
254 get_request(ctx, service[0], EOK, 20, PORT_WORKING, -1);
255 get_request(ctx, service[0], EOK, 20, PORT_WORKING, SERVER_WORKING);
256 get_request(ctx, service[0], EOK, 20, -1, SERVER_NOT_WORKING);
257 get_request(ctx, service[0], EOK, 80, PORT_WORKING, -1);
258 get_request(ctx, service[0], EOK, 80, PORT_NOT_WORKING, -1);
259 get_request(ctx, service[0], ENOENT, 0, -1, -1);
261 get_request(ctx, service[1], EOK, 389, PORT_WORKING, -1);
262 get_request(ctx, service[1], EOK, 389, -1, SERVER_NOT_WORKING);
263 get_request(ctx, service[1], ENOENT, 0, -1, -1);
265 get_request(ctx, service[2], EOK, 123, -1, -1);
267 talloc_free(ctx);