Lines Matching refs:ctx

59     struct inotify_test_ctx *ctx;
62 ctx = talloc_zero(mem_ctx, struct inotify_test_ctx);
63 if (ctx == NULL) {
67 ctx->tctx = create_ev_test_ctx(ctx);
68 if (ctx->tctx == NULL) {
69 talloc_free(ctx);
75 ctx->fail_te = tevent_add_timer(ctx->tctx->ev, ctx,
76 tv, test_timeout, ctx);
77 if (ctx->fail_te == NULL) {
79 talloc_free(ctx);
83 return ctx;
88 struct inotify_test_ctx *ctx;
91 ctx = common_setup(NULL);
92 if (ctx == NULL) {
96 ctx->filename = talloc_strdup(ctx, "test_inotify.XXXXXX");
97 if (ctx->filename == NULL) {
98 talloc_free(ctx);
102 fd = mkstemp(ctx->filename);
104 talloc_free(ctx);
109 *state = ctx;
115 struct inotify_test_ctx *ctx;
117 ctx = common_setup(NULL);
118 if (ctx == NULL) {
122 ctx->dirname = talloc_strdup(ctx, "test_inotify_dir.XXXXXX");
123 if (ctx->dirname == NULL) {
124 talloc_free(ctx);
128 ctx->dirname = mkdtemp(ctx->dirname);
129 if (ctx->dirname == NULL) {
130 talloc_free(ctx);
134 ctx->filename = talloc_asprintf(ctx, "%s/testfile", ctx->dirname);
135 if (ctx->filename == NULL) {
136 talloc_free(ctx);
140 *state = ctx;
146 struct inotify_test_ctx *ctx = talloc_get_type_abort(*state,
150 ret = unlink(ctx->filename);
155 talloc_free(ctx);
161 struct inotify_test_ctx *ctx = talloc_get_type_abort(*state,
165 ret = unlink(ctx->filename);
170 ret = rmdir(ctx->dirname);
175 talloc_free(ctx);
244 struct snotify_ctx *ctx;
249 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
252 assert_non_null(ctx);
278 talloc_free(ctx);
328 struct snotify_ctx *ctx;
333 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
336 assert_non_null(ctx);
389 struct snotify_ctx *ctx;
397 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
401 assert_non_null(ctx);
420 struct snotify_ctx *ctx;
428 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
432 assert_non_null(ctx);
490 struct snotify_ctx *ctx;
499 ctx = snotify_create(test_ctx, test_ctx->tctx->ev, SNOTIFY_WATCH_DIR,
503 assert_non_null(ctx);