Lines Matching refs:test_ctx
92 struct sbus_get_id_ctx *test_ctx = talloc_get_type(pvt,
95 test_ctx->reply_handler(NULL, test_ctx->reply_pvt);
119 struct sbus_get_id_ctx *test_ctx;
122 test_ctx = talloc(global_talloc_context, struct sbus_get_id_ctx);
123 assert_non_null(test_ctx);
125 test_ctx->conn = talloc(test_ctx, struct sbus_connection);
126 assert_non_null(test_ctx->conn);
127 test_ctx->conn->connection_type = SBUS_CONN_TYPE_SYSBUS;
128 ret = sss_hash_create(test_ctx->conn, 32, &test_ctx->conn->clients);
131 test_ctx->stc = create_ev_test_ctx(test_ctx);
132 assert_non_null(test_ctx->stc);
134 *state = test_ctx;
135 global_test_ctx = test_ctx;
143 struct sbus_get_id_ctx *test_ctx = tevent_req_callback_data(req,
150 test_ctx->stc->done = true;
151 assert_int_equal(uid, test_ctx->expected);
159 struct sbus_get_id_ctx *test_ctx = talloc_get_type(*state,
164 test_ctx->expected = 42;
165 uid = test_ctx->expected;
174 req = sbus_get_sender_id_send(test_ctx, test_ctx->stc->ev,
175 test_ctx->conn, __FILE__);
176 tevent_req_set_callback(req, sbus_int_test_get_uid_done, test_ctx);
178 ret = test_ev_loop(test_ctx->stc);
180 assert_int_equal(test_ctx->last_hash_lookup, HASH_ERROR_KEY_NOT_FOUND);
183 req = sbus_get_sender_id_send(test_ctx, test_ctx->stc->ev,
184 test_ctx->conn, __FILE__);
185 tevent_req_set_callback(req, sbus_int_test_get_uid_done, test_ctx);
187 ret = test_ev_loop(test_ctx->stc);
189 assert_int_equal(test_ctx->last_hash_lookup, HASH_SUCCESS);
196 struct sbus_get_id_ctx *test_ctx = tevent_req_callback_data(req,
202 test_ctx->stc->done = true;
209 struct sbus_get_id_ctx *test_ctx = talloc_get_type(*state,
212 test_ctx->expected = -1;
214 req = sbus_get_sender_id_send(test_ctx, test_ctx->stc->ev,
215 test_ctx->conn, NULL);
216 tevent_req_set_callback(req, sbus_int_test_get_uid_no_sender_done, test_ctx);
218 ret = test_ev_loop(test_ctx->stc);
224 struct sbus_get_id_ctx *test_ctx = talloc_get_type(*state,
226 talloc_free(test_ctx);